We have, $8(1 - {\cos ^2}x) + 2(4{\cos ^3}x - 3\cos x) + 6\cos x = 7$

$ \Rightarrow 8{\cos ^3}x - 8{\cos ^2}x + 1 = 0$

Let $cos x = t$

So, $8{t^3} - 8{t^2} + 1 = 0$

$t=\frac {1}{2}$ satisfies the equation.

So, $4{t^2}(2t - 1) - 2t(2t - 1) - (2t - 1) = 0$

$ \Rightarrow (2t - 1)(4{t^2} - 2t - 1) = 0$

So, $t = \frac{1}{2},\frac{{1 \pm \sqrt 5 }}{4} = \cos x$

Thus, $x = \frac{\pi }{3},\frac{{\pi }}{5}$ as $x \in \left[ {0,\frac{\pi }{2}} \right]$ in which cos x cannot be negative. $\frac{{1 - \sqrt 5 }}{4}$ solution is rejected.