Focal length of a pair of lenses My textbook claims that for a pair of thin lenses separated by a distance $d$ the combined focal length of the system is:
$$\frac{1}{f}= \frac{1}{f_1} + \frac{1}{f_2} - \frac{d}{f_1f_2}.$$
Can this be shown using ray-tracing? If so, how? I find it interesting that there doesn't seem to be any dependence on whether the lenses are positive/negative or whether d is greater or smaller than the focal lengths of the particular lenses.
 A: I haven't actually done the derivation but the approach you would take would be to write a ray tracing matrix for the whole system, including the object distance $s_1$ and the image distance $s_2$:
$$
\begin{bmatrix}x_f \\ \theta_f\end{bmatrix} =
\begin{bmatrix}1 & s_2 \\ 0 & 1\end{bmatrix}
\begin{bmatrix}1 & 0 \\ -1/f_2 & 1\end{bmatrix}
\begin{bmatrix}1 & d \\ 0 & 1\end{bmatrix}
\begin{bmatrix}1 & 0 \\ -1/f_1 & 1\end{bmatrix}
\begin{bmatrix}1 & s_1 \\ 0 & 1\end{bmatrix}
\begin{bmatrix}x_i \\ \theta_i\end{bmatrix}
$$
Then you do the tedious matrix multiplication so that you get coefficients $A,B,C,D$ for your equation system in terms of $d,f_1,f_2,s_1,s_2$:
$$
\begin{bmatrix}x_f \\ \theta_f\end{bmatrix} =
\begin{bmatrix}A & B \\ C & D\end{bmatrix}
\begin{bmatrix}x_i \\ \theta_i\end{bmatrix}
$$
When an image is formed, all the rays starting from position $x_i$ end up at $x_f$ regardless of their initial angle $\theta_i$. So in the equation $x_f = Ax_i + B\theta_i$, you can set $B=0$ and from there derive an expression for $\frac{1}{s_1} + \frac{1}{s_2}$ which is the focal length of the whole system.
This expression, which is hopefully the same as what your book says, will certainly depend on $f_1$, $f_2$, and $d$. If you plot each one while keeping the other two constant, you can see how they depend when e.g. one lens is negative and the other positive, or the distance is greater or smaller than the focal length.
