If $\tan A=n\tan B$, then find the maximum value of $(tan(A-B))^2$.

What I did was wrote $n-1=(\tan A-\tan B)/\tan B$. But I don't know how to write $1+\tan A\tan B$ in terms of n and when maximum will occur. The answer is $(n-1)(n-1)/4n$.