Determining when $(\sin(\theta) - \cos(\theta))(2+\sin(\theta) \cos(\theta)) \leq 2$ Question:
$(\sin(\theta)-\cos(\theta))(2+\sin(\theta)\cos(\theta)) \leq 2 \qquad \text{ LHS} \\ $
Answer key:
$\implies  \frac{1}{2}(\cos(\theta)-\sin(\theta)+2\sin(\theta)\cos(\theta)+3)(\sin(\theta)-\cos(\theta)-1) \leq 0 \qquad \text{ RHS} $
I verified RHS = LHS. However, to get to the RHS part, they have factored it somehow and I can't figure out an intuitive way to do so. If anybody has a more intuitive solution (does not have to be the same as what is given here), please provide it. From this step onwards we can easily solve the question because:
$\implies  (\sqrt{2}\sin\left(\frac{\pi}{4} - \theta\right)+\sin(2 \theta)+3)(\sin(\theta)-\cos(\theta)-1) \leq 0\\ $
$ \implies  (\sin(\theta)-\cos(\theta)-1) \leq0 \because  (3 + \sqrt{2}\sin\left(\frac{\pi}{4} - \theta\right)+\sin(2 \theta)) >0 \text{ }\forall \theta \in \mathbb{R} \\ $

Doubt:

I have no idea how the went from the LHS part to the RHS part. Is there an intuitive way to solve $(\sin(\theta)-\cos(\theta))(2+\sin(\theta)\cos(\theta)) \leq 2$? In this solution they have simply said:
$$(\sin(\theta)-\cos(\theta))(2+\sin(\theta)\cos(\theta)) -2 \leq 0 \\ \implies 
\frac{1}{2}(\cos(\theta)-\sin(\theta)+2\sin(\theta)\cos(\theta)+3)(\sin(\theta)-\cos(\theta)-1) \leq 0 \\$$
Please provide a logical way to solve it. Thanks in advance.

I'm looking for a no calculator solution where each step is motivated. And prove one factor is always positive or negative and use the other factor to find the region would be appreciated. Although, if there is another method, (as long as its intuitive) that works too

$$(\sin(\theta) - \cos(\theta))(2+\sin(\theta) \cos(\theta)) \leq 2$$
Let $x = \cos \theta$ and $y = \sin \theta$. Then we get
\begin{align}
   (y - x)(2+xy) &\leq 2 \\
   x^2 + y^2 &= 1
\end{align}
We can now argue
\begin{align}
      -(y-x)^2 &= -1 + 2xy \\
   5 - (y-x)^2 &=  2(2 + xy) \\
\hline
   (y-x)(5 - (y-x)^2) &\le 4
\end{align}
Let $z = y-x$ and we find
\begin{align}
   z(5 - z^2) &\le 4 \\
   z^3 - 5z + 4 \ge 0 \\
   (z-1)(z^2+z-4) \ge 0 \\
   \hline
   z \ge \dfrac{\sqrt{17}-1}{2} \\
   -\frac{\sqrt{17}+1}{2} \le z \le 1
\end{align}
The first answer is superfluous. The second needs to be modified to
$$-\sqrt{2} \le z \le 1$$
$$-\sqrt{2} \le \sin \theta - \cos \theta \le 1$$
$$-\sqrt{2} \le \sqrt 2 \sin\left(x - \frac{\pi}{4} \right) \le 1$$
$$-1 \le \sin\left(x - \frac{\pi}{4} \right) \le \frac{1}{\sqrt 2}$$
$$\theta \in \left[(2n-1)\pi, \frac{\pi}{2}(4n+1) \right] \qquad \forall n \in \Bbb Z$$
