If you're trying to establish an identity, the given equation is not an identity. The proper identity would be as follows:
(1 - sin(x) + cos(x))² = (1 - sin(x))² + 2 (1 - sin(x)) cos(x) + cos²(x)
… = (1 - 2 sin(x) + sin²(x)) + 2 (1 - sin(x)) cos(x) + cos²(x)
… = 2 - 2 sin(x) + 2 (1 - sin(x)) cos(x)
… = 2 - 2 sin(x) + 2 cos(x) - 2 sin(x) cos(x)
… = 2 (1 - sin(x) + cos(x) - sin(x) cos(x))
… = 2 (1 - sin(x) + cos(x) (1 - sin(x)))
… = 2 (1 - sin(x)) (1 + cos(x))
But if you're trying to solve an equation:
(1 - sin(x) + cos(x))² = 2 (1 + sin(x)) (1 + cos(x))
2 (1 - sin(x)) (1 + cos(x)) = 2 (1 + sin(x)) (1 + cos(x))
(1 - sin(x)) (1 + cos(x)) - (1 + sin(x)) (1 + cos(x)) = 0
(1 + cos(x)) (1 - sin(x) - 1 - sin(x)) = 0
-2 sin(x) (1 + cos(x)) = 0
sin(x) = 0 or 1 + cos(x) = 0
sin(x) = 0 or cos(x) = -1
[x = arcsin(0) + 2nπ or x = arcsin(0) + π + 2nπ] or
… [x = arccos(-1) + 2nπ]
We have arcsin(0) = 0 and arccos(-1) = π, so the solution set reduces to
x = 2nπ or x = (2n + 1)π
(where n is any integer)