Two lines $L_1$ and $L_2$ lie in the $x$-$y$ plane and have cartesian equations $y=m_1x+c_1$ and $y=m_2x+c_2$ respectively. Use vector methods to show that if $\theta$ is the angle between $L_1$ and $L_2$ then: $$ \tan \theta = \frac{m_1 - m_2}{1+m_1m_2} $$
Letting $u = i+m_1j$ and $v=i+m_2j$:
$$ u\cdot v = |u|\space|v|\space\cos\theta \\ 1+m_1m_2 = \sqrt{1^2 + m_1^2}\sqrt{1^2+m_2^2}\cos\theta \\ \cos\theta = \frac{1+m_1m_2}{1+m_1+m_2+m_1m_2} $$
How can I get $\tan\theta$ out of it?
To avoid later complications, I will assume $m_1>m_2$. If this is not the case, then I can swap the labels of the lines $L_1$ and $L_2$; this flips the sign of both $\tan\theta$ and of $m_1-m_2$, and thus leaves the formula invariant. So I can assume as above without loss of generality.
As noted in the OP, we have the dot product identity $u\cdot v=|u||v|\cos\theta$. But we also have the cross product identity $u\times v = (|u||v|\sin\theta)\hat{n}$ where $\hat{n}$ is the unit direction vector determined by the right-hand rule (e.g. $i\times j=k=\hat{n}$).
Direct algebra then gives $\tan\theta= \dfrac{(u\times v)\cdot \hat{n}}{u \cdot v}=\dfrac{m_2-m_1}{1+m_1m_2}(\hat{z}\cdot \hat{n}).$ Since $m_1>m_2$ by assumption, we have $\hat{n}=-k$ by the RH rule. We therefore pick up a minus from the dot product, verifying the desired identity.