If a line makes angles $\alpha, \beta, \gamma$ with the $x, y, z$ axes, then $\sin^2{\alpha} + \sin^2{\beta} + \sin^2{\gamma} = 2 $ The following is the question in my textbook:-

If a straight line makes  angle $\alpha$, $\beta$, $\gamma$ with the $x, y, z$ axes respectively, then show that $\sin^2{\alpha} + \sin^2{\beta} + \sin^2{\gamma} = 2 $? 

Here is what I have done:-
Since $\alpha$, $\beta$, $\gamma$ are the angles made by the line with the axes so $\cos\alpha$, $\cos\beta$, $\cos\gamma$ are the direction cosines of the line
now 
$$\sin^2\theta + \cos^2\theta = 1$$
$$\sin^2\theta = 1 - \cos^2\theta$$
so 
$$\sin^2\alpha + \sin^2\beta + \sin^2\gamma = 1 - \cos^2\alpha + 1 - \cos^2\beta + 1 - \cos^2\gamma$$$$ =3 - (\cos^2\alpha + \cos^2\beta + \cos^2\gamma)$$
now since $\cos\alpha$, $\cos\beta$, $\cos\gamma$ are the direction cosines of the line so $\cos^2\alpha + \cos^2\beta + \cos^2\gamma = 1$
so
$$3 - \cos^2\alpha + \cos^2\beta + \cos^2\gamma= 3 - 1$$ 
$$=2- answer$$
My question was that have I done it correctly and if not what is the correct way of doing it. 

Yes, the solution is correct. Turning $\sin^2$ into $1-\cos^2 $ reduces the problem to the sum of squared cosines being $1$, and the latter fact is essentially the distance formula. Indeed, move the line so that it passes through the origin and pick a point $(u,v,w)$ on the line at distance $1$ from the origin. Then $u^2+v^2+w^2=1$. On the other hand, $u,v,w$ are exactly the direction cosines.
