Trigonometry - parameter For which real parameter values $n$ equation $\frac{4n+3}{6}-\sin4x\cos4x-(n+\frac{2}{3})\sin(4x-\frac{\pi}{4})=0$ have exactly three solutions for $x \in [\frac{\pi}{16}, \frac{5\pi}{16}]$
Well I rewrite this equation as $4n+3-6\sin4x\cos4x-(3n+2)\sqrt2(\sin4x-\cos4x)=0 $ , but I don't know what's next
 A: Here is how. Starting from the equation
$$ 4n+3-6\sin4x\cos4x-(3n+2)\sqrt2(\sin4x-\cos4x)=0. $$
We write it in the form
$$ \implies 4n+3-6\sin4x\cos4x=(3n+2)\sqrt2(\sin4x-\cos4x)$$

$$ \implies (4n+3-6\sin4x\cos4x)^2=( (3n+2)\sqrt2(\sin4x-\cos4x))^2. $$

Now, square both sides of the last equation, simplify, and then use the identity 

$$  \cos^2(4x) = 1 -\sin^2(4x), $$

that results in a quadratic equation in $\sin(4x)$ which you need to solve. 
A: First, I apologize for the length of the answer and my incapability to minimize answer as HINT only.
Squaring should be avoided as it immediately introduces Extraneous roots  
Using $\sin2A=2\sin A\cos A$
$$4n+3-3\sin8x-(6n+4)\sin\left(4x-\frac\pi4\right)=0$$
Let $\displaystyle 4x-\frac\pi4=y$
$\displaystyle\implies(i)8x=\frac\pi2+2y,\sin8x=\sin\left(\frac\pi2+2y\right)=\cos2y=1-2\sin^2y $
and $(ii)$ as $\displaystyle\frac\pi{16}\le x\le\frac{5\pi}{16},\frac\pi4\le4x\le\frac{5\pi}4$
$\displaystyle\implies0\le4x-\frac\pi4\le\pi\implies0\le y\le\pi \ \ \ \ (2)$
So, we have $\displaystyle 4n+3-3(1-2\sin^2y)-(6n+4)\sin y=0 $
$\displaystyle\implies6\sin^2y-(6n+4)\sin y+4n=0 \  \ \  \ (1)$
$\displaystyle\implies\sin y=n,\frac23 $
If $y_1$ is a solution of $(1)$, so will be $\pi-y_1$ as $\sin(\pi-B)=\sin B$
Then we shall have either two or four solutions unless for one solution $\displaystyle y_1=\pi-y_1\iff y_1=\frac\pi2\implies \sin y_1=1$
$\displaystyle\sin y=-1$ also makes  $\sin(\pi-y)=\sin y$ But from $(2),\sin y\ge0$
We already have two solutions due to $\displaystyle\sin y=\frac23$
So, $n$ must be $1$
