Solve the equation $\sin x+\cos x=k \sin x \cos x$ for real $x$, where $k$ is a real constant. As I had solved the equation when $k=1$ in Quora and MSE by two methods, I started to investigate the equation for any real constant $k$:
$$
\sin x+\cos x=k \sin x \cos x,
$$
I first rewrite the equation as
$$
\sqrt{2} \cos \left(x-\frac{\pi}{4}\right)=\frac{k}{2}  \sin (2 x)
$$
Letting $ \displaystyle y=x-\frac{\pi}{4}$ yields
$$
\begin{array}{l}
\sqrt{2} \cos y=\frac{k}{2}\left(2 \cos ^{2} y-1\right) \\
2 k \cos ^{2} y-2 \sqrt{2} \cos y-k=0
\end{array}
$$
When $k\neq 0$, using quadratic formula gives
$$
\cos y=\frac{1 \pm \sqrt{1+k^{2}}}{\sqrt{2} k}
$$
For real $y$, we have to restrict $\displaystyle \frac{1 \pm \sqrt{1+k^{2}}}{\sqrt{2} k}$ in $[-1,1]$. Then I found that
$$
-1 \leqslant \frac{1+\sqrt{1+k^{2}}}{\sqrt{2} k} \leqslant 1 \Leftrightarrow \quad|k| \geqslant 2 \sqrt{2}
$$ and $$
-1 \leqslant \frac{1-\sqrt{1+k^{2}}}{\sqrt{2} k} \leqslant 1 \Leftrightarrow \quad k<0 \text { or } k>0
$$
Now we can conclude that
A. When $k\neq0$
$$x=n \pi-\frac{\pi}{4}$$
B. When $0\neq|k| \geqslant 2 \sqrt{2}, $
$$x=\frac{(8 n+1) \pi}{4} \pm \arccos \left(\frac{1\pm \sqrt{1+k^{2}}}{\sqrt{2} k}\right)$$
C. When $ 0 \neq|k|<2 \sqrt{2},$
$$ x= \frac{(8 n+1) \pi}{4}  \pm \arccos \left(\frac{1-\sqrt{1+k^{2}}}{\sqrt{2} k}\right)
$$
where $n\in Z.$
I am looking forward to seeing other methods to solve the equation.
Furthermore, how about $$a\sin x+b\cos x+c\sin x\cos x=0?$$

k should be necessarily $> 1$ because each part >1.
Say since there would be 4 solutions verified for a particular numerical case of given k=2
$$  1/\sin(t) + 1/ \cos(t)  = 2, $$
we get 4 approximate solutions by iteration,.. without graphing
$$(2.81901,3.45426,1.14103,-7.55065) $$
By graphing
