Trigonometry equation. Not sure about solution. The equation goes as follows: 
$$\sin x +\cos x = 1 + \sin x \cos x$$
and here is how I solved it:
$$(\sin x+\cos x)^2=(1+\sin x\cos x)^2$$
$$\sin^2x+2\sin x\cos x+\cos^2x=1+2\sin x\cos x+2\sin^2x\cos^2x$$
$$2\sin^2x\cos^2x=0$$
$$ \cos x=0; \sin x=0$$
$$x_1=\pi/2 +k\pi$$
$$x_2=k\pi$$
Where did it go wrong?
Thanks in advance!
 A: The easiest way to solve this is just to factor everything like this:
$$\sin(x)+\cos(x)-\sin(x)\cos(x)-1=(\sin(x)-1)(\cos(x)-1)=0$$
So you can see immediatly that you have solutions when $\cos(x)=1$ or $\sin(x)=1$, thus $x=2k\pi$ or $x=\frac{\pi}{2}+2k\pi$
A: Hint.
Your work is correct, but incomplete. You have to verifiy the solutions because squaring you can introduce improper solutions and in your case these are the solutions for $k$ odd. 
A: On your second line, the third term on the right hand side shouldn't have a 2 in front of it.
When you square a binomial, you get the general form $$(a+b)^2 = a^2 + 2ab + b^2$$
So in your case $$(1 + \sin(x)\cos(x))^2 = 1 + 2\sin(x)\cos(x) + \sin^2(x)\cos^2(x)$$
From there, you should be able to solve for x quite easily
A: You have a mistake in calculating $(A+B)^2=A^2+2AB+B^2$ (though this mistake does not affect the result.)
In addition to this, $\cos x=0\ \text{or}\ \sin x=0$ is just a necessary condition. Because you squared the both sides, you need to check if they are sufficient. (For example, $x=3\pi/2$ is not a solution.)
