Deriving the Lens Formula (1/a + 1/b = 1/f from Similar Triangles)

Similar triangles from the ray through the center

The lens formula is not something to memorize. It comes out of the ray diagram. All it rests on is two pairs of similar triangles, and this scene shows the first pair.

Draw a ray that leaves the tip of the object and goes straight through the center of the lens. On the object side, this line makes a triangle whose height is the object height and whose base is the distance to the lens. On the image side, it makes a triangle whose height is the image height and whose base is the distance from the lens to the image.

Where the two triangles meet on the optical axis, the angles facing each other are equal, and each triangle has a side perpendicular to the axis. So they are similar. In similar triangles the ratios of corresponding sides are equal, so holds. This is the first equation.

This ratio directly gives the size of the image as a multiple of the size of the object. That is why the magnification is .

Similar triangles from the ray parallel to the axis

Now draw another ray from the tip of the object, this time parallel to the axis. After leaving the lens, this light passes through the focus and goes on to the tip of the image.

Look at the height where this ray meets the lens. Because the light came in parallel to the axis, this height is exactly the object height . So between the lens and the focus there is a triangle with height and base .

Between the focus and the image there is also a triangle with height and base . At the focus, the angles of these two triangles that face each other are equal, and each has a side perpendicular to the optical axis, so they are similar too.

So holds. This is the second equation. We have now written in two ways.

Set the two equal and simplify

Since we have written the same in two ways, the two must be equal: . From here on, it is just a matter of rearranging the equation.

Cross-multiplying to clear the denominators gives , and expanding the right side gives . Both and have disappeared. This means the height of the object has nothing to do with where the image forms.

Finally, divide both sides by . The left side becomes and the right side becomes , so moving one term to the other side gives .

We write it with reciprocals because this form is the shortest and is symmetric. Swapping and does not change the equation. If you put an object where the image was, its image forms where the original object was, because light follows the same path in reverse.

What the formula says

Now that we have the formula, let us read the picture from the equation. The sum of and is always the same value, .

Moving the object toward the lens makes smaller and larger. Since the sum stays the same, has no choice but to get smaller by the same amount. So gets larger, and the image moves farther away. This balance is why the image in the figure runs off to the right.

Bring the object all the way to the focus, and , so becomes exactly . That means has grown infinitely large, and no image forms anywhere. This is the case where the light leaving the lens travels in parallel.

Move the object inside the focus, and becomes negative, so is negative too. A negative means that the image forms to the left of the lens, not to the right. This is a virtual image. The formula did not turn into a different one along the way. The same single equation simply tells the cases apart by sign.