The authors have developed an efficient adaptive algorithm to control two types of errors--one arising from discretization due to the use of finite element methods, and the other arising from the use of approximate solutions of the discretized equations. They give a complete mathematical analysis of error estimates. This is illustrated by a numerical example using the Poisson equation with homogeneous boundary condition.