[Math] The Most general solution satisfying equations $\tan x=-1$ and $\cos x=1/\sqrt{2}$

trigonometry

The most general value of $x$ satisfying the equations $\tan x=-1$ and $\cos x=1/\sqrt{2}$, is found to be $x=2n\pi+\frac{7\pi}{4}$.

My approach:
$$
\frac{\sin x}{\cos x}=-1\implies \sqrt{2}\sin x=-1\implies\sin x=\frac{-1}{\sqrt{2}}=\sin (\frac{\pi}{4}+\frac{\pi}{2})=\sin\frac{3\pi}{4}\\\implies x=n\pi+(-1)^n\frac{3\pi}{4}
$$
If I consider the cosine function
$$
\cos x=\frac{\sin x}{\tan x}=-\sin x=-\sin\frac{3\pi}{4}=\cos(\frac{3\pi}{4}+\frac{\pi}{2})=\cos\frac{5\pi}{4} \implies x=2n\pi+\frac{5\pi}{4}
$$
Is their anything wrong with my approach ?How do I compare different forms of general solutions without inputting for $n$ ?

Best Answer

Here is what you got wrong:

$$\frac{\sin x}{\cos x}=-1\implies \sqrt{2}\sin x=-1\implies\sin x=\frac{-1}{\sqrt{2}}$$

So you got $\sin x<0$ and $\cos x>0$. Then you are in the $4$th quadrant.

$$\sin x=\frac{-1}{\sqrt{2}}=\sin \left(\frac{7\pi}{4}\right) \Rightarrow x=\frac{7\pi}{4}+2n\pi$$

P.S.: You got wrong because $\frac{5\pi}{4}$ is in $3$th quadrant and $\frac{3\pi}{4}$ is in $2$th quadrant.