Find coordinate points where the tangent line is horizontal for $f(x) = –\sin(8x) + 6\cos(4x) – 8x$ Problem:
Consider the function $f(x) = –\sin(8x) + 6\cos(4x) – 8x$  where $–\pi/4 < x < \pi/2$.  Find the exact $x$-coordinates of the points on the graph of f at which there is a horizontal tangent line. 
This is my attempt. 
Find derivative
$$ f’(x) = -\cos(8x)\cdot8 – 6\sin(4x)\cdot4 – 8 $$
$$f’(x) = -8\cos(8x) – 24\sin(4x) – 8$$
$$ f’(x) = -8(\cos(8x) + 3\sin(4x))$$
$$f’(x) = 0 $$
$$0 = -8(\cos(8x) + 3\sin(4x) + 1)$$
Use double angle formula $1-\sin(4x)$ to replace $\cos(8x)$
$$0 = -8(1 – \sin^2(4x) + 3\sin(4x) + 1)$$ 
 Let $u = \sin(4x)$
$$ 0 = 1 – u^2 + 3u + 1$$
$$ 0 = -u^2 + 3u + 2$$
Use quadratic formula to solve for $u$. 
$$\sin(x) = (3\pm \sqrt{17}) / 2$$
Answer can only be negative due to out of bounds so $\sin(x) = (3-\sqrt17) / 2$
Multiply equation by $4$ because $\cos(4x) $
$$\sin(4x) = [4\cdot(3-\sqrt{17})] / 2$$
I tried multiplying by $4$ but $\sin$ becomes out of bounds
So I just tried to get the inverse of $\sin(x)$ to find the reference angle. 
  $$\sin^{-1}(\frac{3–\sqrt{17}}{2}) = -0.596\text{rad} = -34^\circ$$
$$x = (\pi + 0.596), (2\pi-0.596), (-0.596), (-\pi+0.596)$$
After graphing these tangent lines in a calculator, the points are close but not exact and thus are not horizontal. I've done other horizontal tangent line problems but this one, it seems I have to use the quadratic formula to find $\sin(x)$, rather than factoring. 
Any advice on what I'm doing wrong would be greatly appreciated. 

Let $$g(x) = f(x/4) = -\sin 2x + 6 \cos x - 2x.$$  Then 
$$\begin{align*}
g'(x) &= -2 \cos 2x - 6 \sin x - 2 \newline
&= -2 (1 - 2 \sin^2 x) - 6 \sin x - 2 \newline
&= 2 (2 \sin^2 x - 3 \sin x - 2) \newline
&= 2 (2 \sin x + 1)(\sin x - 2).
\end{align*}$$
Hence the critical points of $g$ occur when $\sin x = -1/2$ (it is not possible for $\sin x = 2$).  There are four such $x \in (-\pi, 2\pi)$:  $$x \in \left\{-\frac{5\pi}{6}, - \frac{\pi}{6}, \frac{7\pi}{6}, \frac{11\pi}{6}\right\}.$$  Consequently, the critical points of $f$ occur when $\sin 4x = -1/2$, and for $-\pi/4 < x < \pi/2$, this occurs at $$x \in \left\{ -\frac{5\pi}{24}, - \frac{\pi}{24}, \frac{7\pi}{24}, \frac{11\pi}{24} \right\}.$$
