Integration Substitution Problem 2 Let us assume a definite integral: say, $\int_0^{\frac{\pi}{2}} \frac{dx}{5+4 \sin x}$. Normally by substitution of $\tan\frac{\theta}{2}$ as t I can prove the answer is $\frac{1}{3} \ln 2$. But suppose I do not know any mathematics and I am foolish enough to substitute $(\sin x+\cos x)$ as $t$. Then when we change the limits it comes out to be 1 to 1. That is the answer would be zero. I am really confused.
 A: When you do a substitution, make sure that your variables are mapped $1$-to-$1$ in the range that you are interested in. In this case, the mapping $x \mapsto \sin x + \cos x$ is not $1$-to-$1$ for $x \in [0, \pi/2]$. When $x = 0$, $t = 1$, and as $x$ increases $t$ increases until $x$ reaches $\pi/4$, which is when $t = \sqrt 2$. Then, as $x$ keeps increasing, $t$ decreases from $\sqrt 2$ to $1$, which is when $x = \pi/2$. That means if you still want to use $t = \sin x + \cos x$, you need to split the integral into two smaller integrals for $x \in [0, \pi/4]$ and $x \in [\pi/4, \pi/2]$.
A: You have to read the "fine print".  For a substitution $g(x) = t$ in an integral $\int_a^b f(x)\ dx$ to be valid you need $g$ to be one-to-one on the interval $[a,b]$.  $\sin x + \cos x$ is not one-to-one on $[0,\pi/2]$.  
A: At $\sin x + \cos x = {1 \over 2} \sin (2x)$ and $\sin (2x) $ over the interval $[0, {\pi \over 2}]$ looks like this,

The limits of $t$ are the values of $y$ axis, so you should split up the limits as $[0, {\pi \over 4}]$ and $[{\pi \over 4}, {\pi \over 2}]$. I think it would be nice to use Weierstrass substitution.
