A cube is a rectangular parallelopiped having equal length, breadth and height. Let OADBFEGC be the cube with each side of length a units.
The four diagonals are OE, AF, BG and CD.
The direction \cos ines of the diagonal OE which is the line joining two points O and E are
$$\dfrac {a-0}{\sqrt {a^2+a^2+a^2}}, \dfrac {a-0}{\sqrt {a^2+a^2+a^2}}, \dfrac {a-0}{\sqrt {a^2+a^2+a^2}}$$
i.e. $$\dfrac {1}{\sqrt 3}, \dfrac {1}{\sqrt 3}, \dfrac {1}{\sqrt 3}$$
Similarly, the direction \cos ines of AF, BG and CD are $$(-\dfrac {1}{\sqrt 3}, \dfrac {1}{\sqrt 3}, \dfrac {1}{\sqrt 3}); (\dfrac {1}{\sqrt 3}-\dfrac {1}{\sqrt 3}, \dfrac {1}{\sqrt 3}); (\dfrac {1}{\sqrt 3},\dfrac {1}{\sqrt 3},-\dfrac {1}{\sqrt 3})$$, respectively.
Let l, m, n be the direction \cos ines of the given line which makes angles $$\alpha, \beta, \gamma, \delta$$ with OE, AF, BG, CD, respectively. Then
$$\cos \alpha =\dfrac {1}{\sqrt 3}(l+m+n); \cos \beta =\dfrac {1}{\sqrt 3}(-l+m+n)$$;
$$\cos \gamma =\dfrac {1}{\sqrt 3}(l-m+n); \cos \delta =\dfrac {1}{\sqrt 3}(l+m+n)$$;
Squaring and adding, we get
$$cso^2\alpha +\cos ^2\beta +\cos ^2\gamma +\cos ^2\delta \\=\dfrac {1}{3}[(1+m+n)^2+(-1+m+n)^2+(l-m+n)^2+(l+m+n)^2]\\=\dfrac {1}{3}[4(l^2+m^2+n^2)]=\dfrac {4}{3}$$
(as $$l^2+m^2+n^2=1)$$