I know that Einstein’s theory of general relativity predicts that the wavelength of electromagnetic radiation will lengthen as it climbs out of a gravitational well. Photons must expend energy to escape, but at the same time must always travel at the speed of light, so this energy must be lost through a change of frequency rather than a change in speed. If the energy of the photon decreases, the frequency also decreases. This corresponds to an increase in the wavelength of the photon, or a shift to the red end of the electromagnetic spectrum – hence the name: gravitational redshift.
How can I get the gravitational redshift in terms of the wavelength?
I would really appreciate your help.