In a compound optical system, image formation happens in stages. The first lens forms an image, and that image then acts as the object for the next lens.
This process continues through the chain. Because of that, total magnification is not found from a single one-step formula. Instead, the magnification from each stage is computed separately and then multiplied together.
For one thin lens, the image distance is obtained from the thin-lens equation:
\[
\frac{1}{f}=\frac{1}{d_o}+\frac{1}{d_i}.
\]
Once the image distance is known, the linear magnification is
\[
m=-\frac{d_i}{d_o}.
\]
The minus sign is very important. If \(m\) is negative, the image is inverted relative to the object. If \(m\) is positive, the image is upright.
The magnitude \(|m|\) tells you whether the image is larger, smaller, or the same size:
\[
|m|>1 \Rightarrow \text{larger}, \qquad
|m|<1 \Rightarrow \text{smaller}, \qquad
|m|=1 \Rightarrow \text{same size}.
\]
In a system of several lenses, the image from one stage becomes the object for the next. So for lens 1 you first compute
\[
d_{i1}, \qquad m_1=-\frac{d_{i1}}{d_{o1}}.
\]
Then that image position determines the object distance for lens 2, which in a spaced system depends on the separation between the lenses.
After finding \(d_{o2}\), you compute
\[
d_{i2}, \qquad m_2=-\frac{d_{i2}}{d_{o2}}.
\]
The total magnification is then the product
\[
m_{\text{total}}=m_1m_2.
\]
For a three-lens system the same idea continues:
\[
m_{\text{total}}=m_1m_2m_3,
\]
and, more generally, for an \(n\)-lens chain,
\[
m_{\text{total}}=\prod_{k=1}^{n} m_k.
\]
This multiplicative structure is why image orientation can flip back and forth across a multi-element system. Every time a stage magnification is negative, that stage introduces an inversion.
If the total product ends up negative, the final image is inverted. If the total product is positive, the final image is upright.
Image type must also be tracked stage by stage. A stage can produce a real image if \(d_i>0\), meaning the image lies on the outgoing side of the lens.
It can produce a virtual image if \(d_i<0\), meaning the rays do not actually meet there and the image is found by backward extension.
In a compound system, even a virtual image from one stage can still serve as the object for the next stage.
That is why keeping the signs consistent is essential.
The animation in this calculator emphasizes that point. Two standard rays begin at the top of the object and pass through the lens chain.
At each lens, the rays are refracted again. If the final image is real, the outgoing rays physically converge to the final image point.
If the final image is virtual, the rays diverge after the last lens and their dashed backward extensions locate the image.
Intermediate images can also be displayed so that the lens-by-lens structure is easy to follow.
This tool is especially useful because students often memorize the magnification formula for one lens but lose track of how it extends to multi-stage systems.
The key idea is simple: compute the image of each stage, compute its magnification, and multiply.
That same logic underlies microscopes, telescopes, relay optics, and more advanced imaging systems.
At the university level, the same ideas connect naturally to matrix optics and angular magnification. But even before that, the chain-of-images perspective is already powerful:
it explains why optical systems can enlarge, reduce, flip, or re-flip images depending on how the intermediate stages behave.