I'm working through past papers for A-Level C3 maths and i'm stuck on how the answer book arrived at the following rearrangement.

$\displaystyle \frac{\tan^2\theta-3}{1-3\tan^2\theta}=k^2$

Rearranged into form:

$\displaystyle \tan^2\theta=\frac{k^2+3}{1+3k^2}$

I'm sure there's some multiply divide by terms but I can't figure out which. Any help would be massively appreciated. Thanks.