The inverse problem of determining an unknown source term in a parabolic equation with the leading coefficient depending on time and space variables under a final overdetermination condition is considered. The series pattern solution of the problem is obtained by using the weighted homotopy analysis method (WHAM). A description of the method for solving the problem and identifying the unknown source term is derived. Finally, several examples are presented to illustrate this method.