The problem of phase retrieval from image and diffraction patterns is of importance in electron microscopy. In this paper the true phase can be extracted uniquely and accurately by Gerchberg-Saxton iterative algorithm for the wave function, its amplitude being unity or a linear function, while its phase being a parabolic, sinuous or exponential function.A computer program for retrieving the phase has been worked out. As an image wave function is given, its Fourier transform may be calculated by the discrete fast Fourier transform algorithm. So we can recover the phase with G-S algorithm, using a random initial phase between -π and +π. The numerical examples are given in detail. The phase retrieval solution is stable under fluctuation of input initial phase up to 1 rad.