This paper deals with the construction of closed form discrete numerical solutions of diffusion mixed problems with space varying properties and source term of the form
$r(x)u_t=[p(x)u_x]x + q(x)u= F(x,t)$ (1)
$u_x(0,t)-h1 u(0,t)=0, t>0$ (2)
$u_x(1,t)-h2 u(1,t)=0, t>0$ (3)
$u(x,0)=f(x), 0\leq x \leq 1$ (4)
Coefficients $p(x)$, $r(x)$ and constants $h1, h2$ are positive, while $q(x)$ and $F(x,t)$ are real numbers. After discretization of the problems (1)-(4), an eigenfunction method is developed to obtain a closed form solution of the discretized problem. The proposed approach has the advantage that the proposed closed form formula is applicable for any source term $F(x,t)$. An algorithm is proposed and stability properties and examples are also included.