Find the general solution to $\csc \theta + \sec \theta = 1$ 
Find the general solution to $$\csc\theta + \sec\theta =1$$

This is how I solved.
We have, 
\begin{align}
\csc\theta + \sec\theta &=1\\
\frac1{\sin\theta} + \frac1{\cos\theta}& =1\\
\frac{\sin\theta+\cos\theta}{\sin\theta\cos\theta} &=1\\
(\sin\theta + \cos\theta)^2 &= (\sin\theta\cos\theta)^2 \\
1 + 2\sin\theta\cos\theta &= \frac{4\sin^2\theta\cos^2\theta}4\\
1 + \sin2\theta &= \frac{(2\sin\theta\cos\theta)^2 }4\\
4 + 4\sin2\theta &= \sin^2 2\theta\\
\sin^2 2\theta - 4\sin2\theta - 4 &= 0\\
\sin2\theta &= 2 - 2\sqrt2\end{align}
Now here I am stuck. Can someone please help me proceed further? 
 A: Your squaring of the equation $$\cos x+\sin x=\cos x\>\sin x\tag{1}$$ has introduced spurious solutions. In fact the value ${1\over2}\arcsin\bigl(2-2\sqrt{2}\bigr)\approx-0.488147$ does not solve the given problem.
Drawing the graphs of $x\mapsto  \cos x+\sin x$ and $x\mapsto\cos x\>\sin x$ shows a symmetry with respect to $x={\pi\over4}$. We therefore put $x:={\pi\over4}+t$ and then have
$$\cos x+\sin x=\sqrt{2}\>\cos t,\qquad\cos x\>\sin x={1\over2}\cos(2t)\ .$$
Plugging this into $(1)$ we obtain
$$\sqrt{2}\cos t={1\over2}(2\cos^2 t-1)\ ,$$
so that $\cos t={\sqrt{2}\over2}-1$, or
$$ t=\pm \alpha,\quad{\rm with}\quad \alpha:=\arccos{\sqrt{2}-2\over2}=1.86805\ .$$
This leads to the $x$-values
$$x_1={\pi\over4}-\alpha=-1.08265,\qquad x_2={\pi\over4}+\alpha=2.65345\ .$$
Looking at the graphs we see that these solutions repeat with periodicity $2\pi$.
A: Hint
Again avoid squaring as it immediately introduces 
When do we get extraneous roots?
$\sin x\cos x=\sin x+\cos x=y,$
$y=\sqrt2\cos(x-45^\circ)\implies-\sqrt2\le y\le?$(say)
$$y^2=1+2\sin x\cos x$$
Let $y^2-1=2y\iff y^2-2y-1=0$
$y=1\pm\sqrt2$
$\implies y=1-\sqrt2$
$\implies\cos(x-45^\circ)=\dfrac1{\sqrt2}-1$
