Answer
See below.
Work Step by Step
Step 1. Using the given figure, we have $\theta_2=\theta+\theta_1$, thus $\theta=\theta_2-\theta_1$
Step 2. We have $tan\theta=tan(\theta_2-\theta_1)=\frac{tan(\theta_2)-tan(\theta_1)}{1+tan(\theta_2)tan(\theta_1)}=\frac{m_2-m_1}{1+m_1m_2}$