You have not paid enough attention to the limits of your integration - the two integrals you are adding are not over the same interval.
The method to use here is quite similar to yours in using the same trick correctly, without disturbing the interval of integration:
$$\frac{2\sin x}{\sin x + \cos x}=\frac {\sin x +\cos x}{\sin x +\cos x}+\frac {\sin x - \cos x}{\sin x + \cos x}$$
You might need a little more explanation of the interval issue.
Integrals are additive in two ways.
First, if the same function is integrated over disjoint intervals (later measurable sets) then we can integrate over the union of the intervals and the integral over the whole is the sum of the integrals over the parts.
Second, if we integrate different functions over the same interval (measurable set), the sum of the integrals is equal to the integral of the sum of the functions.
Apply your method to the integral of $x^2$ and use the substitution $y=-x$. The integral you get is the integral of $-x^2$. Adding the two you get twice the integral is zero, which is nonsense, because the function you are integrating is positive except at $x=0$. What has happened here is that you have swapped the limits of integration, and you need to reverse the sign to straighten them out.
Your method has both reversed the limits and translated them by $\frac {\pi} 2$. You can't add the integrals in this case and expected to get the right answer.
du/dx
, which happens to be a constant -1 here. But the answers don't seem to mention that. Am I just mis-remembering how to change integration variables? $\endgroup$