Two related simple trigonometric equations First I've got:
$$\sin(x)+\cos(x)=0 \;\;\;\;\mathrm{(*)}$$
So:
$$\sin(x)=-\cos(x)$$
$$\sin^2(x)=\cos^2(x)$$
$$\sin^2(x)=1-\sin^2(x)$$
$$2\sin^2(x)=1 \;\;\;\;\mathrm{(**)}$$
but
(*) and (**) give different results (like in Wolfram Alpha)

Second
$$\sin(x)-\cos(x)=1\;\;\;\;\mathrm{(*)}$$
So:
$$\sin^2(x)+\cos^2(x)-2\sin(x)\cos(x)=1\;\;\;\;\mathrm{(**)}$$
Similarly (*) and (**) don't match.
What am I missing? Thanks in advance.
 A: Some of the solutions will be the same, however, notice that:
$\sin(x) = -\cos(x)$ and $\sin(x) = \cos(x)$ both lead to the same equation $\sin^2(x) = \cos^2(x)$, and so some of the solutions will solve one but not the other (and vice versa).
This also applies to your second result. Whenever you square something, you have to take into account the fact that you are solving another set of equations.
For example, if $x^2 = 25$ we know that this has two solutions for the case where $x=5$ or the case where $x=-5$.
This is why you are finding that some of the solutions do not match your original equation. Those other answers will be solutions to the other equation which you haven’t considered.
A: Your So means there is an implication, not an equivalence. In such a case, your final result may contain extraneous solutions.
Here, when you square both sides in $\sin x=-\cos x$, to get $\sin^2 x=\cos^2 x$, you are also going to get the solutions of $\sin x=\cos x$.
Therefore, where you solve an equation by implications, you MUST check in the end which solutions are really solutions of the initial problem.
From the final $2\sin^2x=1$, you get immediately that $\sin x=\pm\frac{\sqrt2}{2}$.
For $\sin x=\frac{\sqrt2}{2}$, the solutions are $x=\frac{\pi}{4}+2k\pi$ and $x=\frac{3\pi}{4}+2k\pi$.
For $\sin x=-\frac{\sqrt2}{2}$, the solutions are $x=-\frac{\pi}{4}+2k\pi$ and $x=-\frac{3\pi}{4}+2k\pi$.
You can check that the solutions to $\sin x=-\cos x$ are actually $x=-\frac{\pi}{4}+2k\pi$ and $x=\frac{3\pi}{4}+2k\pi$.

There is another way that does not require implications.
Consider $\sin (x+\frac\pi4)=\cos\frac\pi4\sin x+\sin\frac\pi4\cos x=\frac{\sqrt2}2(\sin x+\cos x)$.
Therefore,
$$\sin x+\cos x=0\iff \sqrt2\sin (x+\frac\pi4)=0$$
Here it's an equivalence, so we are going to get the correct solutions. You can check that it's again $x=-\frac{\pi}{4}+2k\pi$ and $x=\frac{3\pi}{4}+2k\pi$.
A: When you square both sides you risk introducing artificial solutions.
For example, suppose you have the expression
$x = -1$
And you square both sides
$x^2 = 1$
Then this suggests $x = \pm 1.$  Squaring introduced a false solution of $x = 1$
When we go from
$\sin x = -\cos x$
To
$\sin^2 = \cos^2 x$
We have introduced a false solution.
What to do about it?  At
$2\sin^2 x = 1\\
\sin x = \pm \sqrt 2\\
x = \frac {\pi}{4}, \frac {3\pi}{4},\text { etc.}$
We must check for which of those solutions $\sin x$ and $\cos x$ have opposite signs.
$x = \frac {3\pi}{4} + n\pi$
One way to aviod this problem is to say:
$\sin x = -\cos x\\
\tan x = -1$
