<s>[INST] What is wrong in this solution of $\sec x + \csc x = 2 \sqrt{2}$ 
Find number of solutions in the interval $[0,2\pi]$ of the equation - $$\csc x + \sec x = 2 \sqrt{2}.$$

$⇒ \dfrac{1}{\sin x}+ \dfrac{1}{\cos x }= 2 \sqrt2$
$⇒ \dfrac{\sin x +\cos x}{\sin x  \cos x} = 2 \sqrt 2 ⇒ (\sin x+\cos x)^2=8\sin^2x\cos^2x⇒1+2\sin x \cos x=8\sin^2x \cos^2x$
$⇒\sin x \cos x=-1/4 ,\sin x \cos x=1/2⇒2\sin x \cos x=-1/2 , 2\sin x\cos x=1$
$⇒\sin2x =-1/2 , \sin2x=1.$ But if we check manually , $\sin2x=-1/2$ is not a solution.
$⇒\sin 2x =1⇒2x=(-1)^{n}\dfrac{\pi}{2}+n\pi⇒x=(-1)^{n}\dfrac{\pi}{4}+\dfrac{n\pi}{2}⇒$ For $[0,2\pi], \boxed{x=\dfrac{\pi}{4},\dfrac{5 \pi}{4}}$ are solutions.
But if we check the graph neither are the solutions . But $\pi /4 $ is a solution but $5\pi /4 $ is not a solution if we plug values manually.

Can someone point out the mistake? Thanks
$\text{References:}$ Link for above graph : https://www.desmos.com/calculator/eaakqvd9y5
 [/INST] As noticed in the comments, the issue is that by squaring we can add solutions, as for the following trivial example
$$x=-1 \implies x^2 =1 \implies x=1 \lor x=-1$$

In this case to avoid this issue we can proceed as follows (since $\sin x\cos x\neq 0$):
$$\dfrac{1}{\sin x}+ \dfrac{1}{\cos x }= 2 \sqrt2 \iff \cos x + \sin x = 2 \sqrt2 \sin x \cos x$$
with
$$2 \sin x \cos x =(\cos x + \sin x)^2-1$$
and thus
$$\sqrt 2(\cos x + \sin x)^2-(\cos x + \sin x)-\sqrt 2=0$$
from wich we obtain
$$\cos x + \sin x=\sqrt 2 \:\lor \: \cos x + \sin x=-\frac{\sqrt 2}2$$
then we can use that $\cos x + \sin x= \sqrt 2 \sin \left(x+\frac \pi 4\right)$ to obtain the result.

As an alternative from here
$$\cos x + \sin x = 2 \sqrt2 \sin x \cos x$$
we have that
$$\sqrt 2 \sin \left(x+\frac \pi 4\right)= \sqrt 2 \sin (2x)$$
$$ \sin \left(x+\frac \pi 4\right)=  \sin (2x)$$
which leads to
$$x+\frac \pi 4 = 2x + 2k\pi \: \lor \: x+\frac \pi 4 = \pi -2x + 2k\pi$$
that is $x=\frac \pi 4 +\frac23k\pi$.

Here is a graph with a visualization for the solutions

</s>