The influence of surface viscosity and anchoring energy on the reorientation process of a nematic liquid crystal cell is theoretically investigated. The cell is a slab of thickness, d, whose limiting surfaces are characterised by different anchoring strengths and present easy directions parallel to the bounding surfaces, changing with time due to some external action. The exact space-time profile of the director angle is obtained by means of integral transform techniques and a Green function approach. From this formalism, the time dependence of the optical path difference is exactly determined and its behaviour is analysed in connection with the presence of surface viscosity and different anchoring energies. The problem is also exactly solved in the presence of a constant electric field. It is shown that the compatibility problem between the time derivative of the director field on the surface and in the bulk can be avoided.