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)) &gt;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
$f(x)$ has period $2$.
What happens in $[0,2]$ is repeated $50$ times in the same way, thus the ratio we have in this interval is the ratio of all the race.
Run points are $1/4$ and swim point are $3/4$, therefore the ratio $swim/run$ is $3$.
How did I find the points in the image below.
Solve
$$(\sin (2 \pi  x)-3) \sin \left(\frac{\pi }{4}-\pi  x\right)-\sin \left(3 \pi  x+\frac{\pi }{4}\right)=2 \sqrt{2}$$
solutions are $x=\frac12+2k;\;x=1+2k;\;k\in\mathbb{Z}$.
In the interval $[0,2]$ the are $\frac12,1$.
Solve
$$(\sin (2 \pi  x)-3) \sin \left(\frac{\pi }{4}-\pi  x\right)-\sin \left(3 \pi  x+\frac{\pi }{4}\right)=0$$
solutions are $x=\frac14+2k;\;\frac54+2k;\;k\in\mathbb{Z}$
In the interval $[0,2]$ the are $\frac14,\frac54$.
The set where $0\le f(x)\le 2\sqrt 2$ is $\left[\frac14,\frac12\right]\cup\left[1,\frac54\right]$
The length is $\frac12$ and represents $\frac14$ of the interval $[0,2]$ while the other part is $\frac34$. Thus the second part is three times the first part.

$$...$$
I have re-written this answer because, with the help of WolframAlpha here, I was surprised to discover
$$0\le \big(3-\sin(2\pi x)\big)\sin(\pi x - \frac{\pi}{4})-  \sin(3\pi x +\frac{\pi}{4})\le 2\sqrt{2}\\
\implies (2 n - 1)&lt;x\le \frac{2 \big(\pi n - \frac{3 π}{8}\big)}{\pi} \land n \in\mathbb{ Z}\\
\land \implies \frac{2 \big(\pi n + \frac{\pi}{8}\big)}{\pi}\le x\le\frac{(4 n + 1)}{2} \land n\in\mathbb{Z} $$
What the first &quot;implies&quot; means for $\space 0\le x\le 100\space$ is that there are discreet ranges of values that make this true as in these samples for $1\le n\le 6$
$$(1\le x \le \frac{5}{4}=1.25)\quad 
(3\le x \le \frac{13}{4}=3.25)\quad 
(5\le x \le \frac{21}{4}=5.25)\quad \\
(7\le x \le \frac{29}{4}=7.25)\quad 
(9\le x \le \frac{37}{4}=9.25)\quad 
(11\le x \le \frac{45}{4}=11.25)\quad $$
What the second &quot;implies&quot; means is that the following ranges apply for $\space x$ for $1\le n\le 6$.
$$\frac{9}{4}=2.25\le x \le \frac{5}{2}=2.5\qquad 
\frac{17}{4}=4.25\le x \le \frac{9}{2}=4.5\\ 
\frac{25}{4}=6.25\le x \le \frac{13}{2}=6.5\qquad 
\frac{33}{4}=8.25\le x \le \frac{17}{2}=8.5\\ 
\frac{41}{4}=10.25\le x \le \frac{21}{2}=10.5\qquad 
\frac{49}{4}=12.25\le x \le \frac{25}{2}=12.5$$
We can see that each value of $n$ generates $\space x\space$ with a total &quot;coverage of $\space 0.5\qquad $ Note that $\quad 1\le n \le 24\implies 1\le x \le 97\quad$ so there are $24\times0.5=12$ &quot;full-numbers-worth&quot; of $0\le x \le 100$ that satisfy $I.\quad$ However, the first &quot;implies&quot; above permits
$n=25\implies 99\le x \le 99.25\space $ and the second &quot;implies&quot; peermits  $n=0.0\implies 0.25\le x \le 0.5\quad $. There are a total of $100$ intervals of $0.25$ each so the members run $\frac14$ of the time.
This means that there members swim $\frac34$ of the time and the ratio of $\frac{swim}{run}$ is $\quad 3:1$