$OA,OB,OC,$ with $O$ as origin, are three mutually perpendicular lines whose direction cosines are $l_1,m_1,n_1;l_2,m_2,n_2$ and $l_3,m_3,n_3$ respectively. If the projections of $OA$ and $OB$ on the plane $z=0$ make angles $\phi_1$ and $\phi_2$, respectively, with the $X-$axis, prove that $\tan(\phi_1-\phi_2)=\pm\dfrac{n_3}{n_1n_2}$
I could not solve this question,the answer given in my book seems erroneous.Please help me.
The solution in your book is all right, it just skips the part that you were asking about earlier, I see you have edited that out. Still I'm just answering that part.
I assume that you know something about matrices. Even if you don't, just read this wiki on orthogonal matrices.
The given conditions in your question are sufficient to show that the matrix $$A=\begin{pmatrix} l_1&m_1&n_1\\l_2&m_2&n_2\\l_3&m_3&n_3 \end{pmatrix}$$ is an orthogonal matrix. It should be obvious now that $n_1^2+n_2^2+n_3^2=1$