# The following equation to solve :$\tan x+\cot x=\sqrt{2}(\cos x+\sin x)$

The following equation to solve :

$$\tan x+\cot x=\sqrt{2}(\cos x+\sin x)$$

My try:

$$\frac{2}{\sin 2x}=\sqrt{2}(\cos x+\sin x)$$

$$\left(\frac{2}{\sin 2x}\right)^2=(\sqrt{2}(\cos x+\sin x))^2$$

$$\left(\frac{2}{\sin 2x}\right)^2=2(1+\sin 2x)$$

$$2\sin^2 2x +2\sin ^3 2x=4$$

$$2\sin^2 2x +2\sin ^3 2x-4=0$$

$t=\sin 2x$

$$2t^3+2t^2-4=(t-1)(t^2+2t+4)$$

$$\sin 2x =1\\$$

is it right ?

Way back at the first line, you could say "$\cos x + \sin x$ is maximized at $x = \pi/4$, with value $\sqrt{2}$, so the right hand side is no more than 2; the left hand side, on the other hand, (for $\sin 2x$ positive, at least) is at least 2. To make these equal, you need either

• $\sin 2x = 1$ and $\cos x + \sin x = \sqrt{2}$ or

• $\sin 2x = -1$ and $\cos x + \sin x = -\sqrt{2}$

Now it's pretty easy to solve, and you don't need to mess with any cubics, etc.

But you asked if your solution was right, so let me address that. Right at the point where you squared both sides, you introduced the possibility of spurious roots, where the two sides are negatives of each other, but their squares are equal. You need to check that this does not happen for either of the solutions where $\sin 2x = 1$ (it doesn't), and at that point, you'll be done.

• You can reject $t=-1-\sqrt{2}$ since it's $<-1$ but how do you know that you can reject $t=-1+\sqrt{2}$? (without verifying it in the original equation - which would require significantly more work) – mrnovice Feb 25 '17 at 20:36
• When $t = -1 + \sqrt(2) \approx .414$, we have $2/s$, on the left hand side, is about $4$. On the right side, we have $1.414... * (s + c)$, where $s + c$ is at most $2$, hence the RHS is no more than about 2.8. – John Hughes Feb 25 '17 at 21:01
• Okay, but then this working must be included in an answer to the original question otherwise solutions could be missed. – mrnovice Feb 25 '17 at 21:03
• Ah...you're saying that the solutions to the quadratic factor must also be examined. But the discriminant is $b^2 - 4ac = 2^2 - 16 = -12$, so there are no real roots to the quadratic. (I assume that your $t = -1 \pm \sqrt{2}$ arose from a mistaken application of the quadratic formula -- if I'm wrong, correct me!) – John Hughes Feb 25 '17 at 21:06
• Ah yes I made an error, apologies. – mrnovice Feb 25 '17 at 21:08

Excluding $\sin x\cos x=0$, you can rewrite

$$\sqrt2(\cos x+\sin x)\sin x\cos x=1$$

or

$$\sin\left(x+\frac\pi4\right)\sin(2x)=1.$$

For this product to be $1$, both factors must be $1$ or $-1$.

Then

$$x+\frac\pi4=k\pi+\frac\pi2,\\2x=l\pi+\frac\pi2,$$

where $k$ and $l$ have the same parity. Then as $l=2k$, $l$ and $k$ are even and

$$x=2n\pi+\frac\pi4.$$

Avoid squaring whenever possible as it immediately introduces extraneous roots.

Method $\#1:$ Put $u=\dfrac{\cos x+\sin x}{\sqrt2}\implies2u^2=1+\sin2x$

$$\implies\dfrac2{2u^2-1}=2u\iff2u^3-u-1=0$$

Clearly, $u=1$ is a root. Please check for the other roots.

$\implies1=\dfrac{\cos x+\sin x}{\sqrt2}=\cos\left(x-\dfrac\pi4\right)$

$\implies x-\dfrac\pi4=2m\pi$ where $m$ is any integer.

Method $\#2:$

$\cos x+\sin x=\sqrt2\cos\left(x-\dfrac\pi4\right)$

$\sin2x=\cos2\left(x-\dfrac\pi4\right)=\left(\sqrt2\cos\left(x-\dfrac\pi4\right)\right)^2-1$