Geometric optics question (from 2001 GRE) 

In the diagram above, two lenses with focal lengths $f_1 = 20$ cm and $f_2 = 10$ cm are placed $40$ cm and $70$ cm from an object $O$, respectively. Where is the final image formed by the two-lens system, in relation to the second lens? 
(a) 5 cm to its right 
(b) 13.3 cm to its right
(c) infinitely far to its right
(d) 13.3 cm to its left 
(e) 100 cm to its left

I can use the thin lens equation $$\frac{1}{s} + \frac{1}{s'} = \frac{1}{f}$$ (where $s$ is the object distance, $s'$ is the image distance, and $f$ is the focal length, up to sign, which is what makes this business confusing) to determine that in the absence of a second lens there would be an image $40$ cm to the right of the first lens.
According to this online solution we must take the image of the first lens to be the object of the second lens and use the above equation again to get choice (a). 
How is that allowed? Doesn't the second lens totally interfere with/ obstruct the formation of the first image, making this a complicated problem?
 A: It works because the thin lens equation works for virtual images (i.e. $s'<0$) and virtual objects (i.e. $s<0$). To see why that is true, lets derive the thin lens equation with the following two assumptions:


*

*A light ray passing through the center of a lens does not bend.

*a light ray entering normal to the lens bends and passes through the focal point.


The rays originate from a point on the object, pass through the lens, then converge at a point that generates an image, like shown for a convex lens:

The similar triangles with angle $\alpha$ have legs that are in proportion:
$$ \frac{y_o + y_i}{s + s'} = \frac {y_o}{s} $$
And the similar triangles with angle $\beta$ have legs that are in proportion:
$$ \frac{y_o + y_i}{s'} = \frac{y_o}{f} $$
Dividing these two equations and rearranging gives the thin lens equation:
$$ { 1 \over s } + {1 \over s'} = {1 \over f} $$
Note that $s,s',y_o,f$ are all positive while $y_i$ is negative in this example. What would happen if we made $s$ negative? That would amount to placing $s$ on the same side as $s'$:

The object at $s$ is called virtual because it is located where the light rays would converge to if the lens wasn't there. The above rules for (1) and (2) rays still apply however, so we can generate a real image. And so long as you treat $s$ as negative (i.e. let $s - s' = -(s+s')$ ) you will get the thin lens equation by analyzing the two triangles.
