<s>[INST] The Most general solution satisfying equations $\tan x=-1$ and $\cos x=1/\sqrt{2}$ 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$ ?
 [/INST] $\tan \theta = -1 =\tan (\frac{3\pi}{4}) =\tan(\frac{7\pi}{4})$.
$\tan (\pi -\frac{3\pi}{4}) = \tan(\pi +\frac{3\pi}{4})$.
$\cos \theta =\frac{1}{\sqrt{2}}$.
$\cos \frac{\pi}{4} = \frac{1}{\sqrt{2}}$.
$\cos (2\pi -\frac{7\pi}{4}) =\frac{1}{\sqrt{2}} = \cos \frac{7\pi}{4}$.
Hence, the principal value for both $\tan \theta$ and $\cos \theta$ is $\frac{7\pi}{4}$.
Thus, the general value of $\theta$ is $2n\pi + \frac{7\pi}{4}$.
</s>