Problem in finding the maximum value of $\tan^2(\theta-\phi)$ 
If $\tan\theta$ = $n\tan\phi$,then what is the maximum value of $\tan^2(\theta-\phi)$?

My attempt: 
First I tried to reach $\tan^2(\theta-\phi)$ using the given condition, but couldn't. 
Next, I used the property that $AM\geq GM$ to reach: 
$$\dfrac{\sin^4(\theta-\phi)+\sec^4(\theta-\phi)}2  \geq \tan^2(\theta-\phi)$$
Now, I am unable to continue from here  by simplifying it. Can someone suggest some methods to proceed from here or provide a hint to solve this problem differently?
PS: The answer is $\frac{(n-1)^2}{4n}$.
 A: Let $L(\theta,\phi,\lambda)$ be the Lagrangian of your optimisation problem:
$$L(\theta,\phi\,\lambda) = \tan^2{(\theta-\phi)}-\lambda[\tan{(\theta)}-n\tan{(\phi)}]\tag{*}$$
The extrema of the Lagrangian are found with:
$$\vec{grad}\,L(\theta,\phi\,\lambda)=\vec{0}\tag{**}$$
Being the last equation of $(**)$ the constraint $\tan{(\theta)}=n\tan{(\phi)}$.
You can see that if $\lambda=0$ one reaches a minimum when $\theta=\phi$, and when it is not, the solution for $\phi$ and $\theta$ is given by the following equations:
$$\tan^2{(\theta)}=\frac{1}{n}\qquad \tan^2{(\phi)}=n  \tag{***}$$
Therefore the value of the function using $(**)$is:
$$\tan^2{(\theta-\phi)}=\left(\frac{\tan{(\theta)}-\tan{(\phi)}}{1+\tan{(\theta)}\tan{(\phi)}}\right)^2= \frac{1}{4}\left(\frac{1}{\sqrt{n}}-\sqrt{n}\right)^2=\frac{(n-1)^2}{4n}$$
A: If $\{\theta,\phi\}\subset\left(0,\frac{\pi}{2}\right)$ and $n>0$ then by AM-GM we obtain:
$$\tan^2(\theta-\phi)=\left(\frac{\tan\theta-\tan\phi}{1+\tan\theta\tan\phi}\right)^2=\left(\frac{(n-1)\tan\phi}{1+n\tan^2\phi}\right)^2=$$
$$=\frac{(n-1)^2}{(\cot\phi+n\tan\phi)^2}\leq\frac{(n-1)^2}{(2\sqrt{\cot\phi\cdot n\tan\phi})^2}=\frac{(n-1)^2}{4n}.$$
The equality occurs for $\cot\phi=n\tan\phi$, which says that $\frac{(n-1)^2}{4n}$ is the answer.
Otherwise, the maximum does not exist, of course, because we can get $\cot\phi+n\tan\phi\rightarrow0$. 
