A solution method for the Graetz problem for non-Newtonian fluids with Dirichlet and Neumann boundary conditions