# Integration by substitution notation question

Often with integration by substitution I see (and use) the notation $x \to \frac{\pi}{2} - x$, for the simple reason that I don't have to rename the variable that I am integrating with respect to, but recently this notation has gotten me confused, in the sense that I'm not sure I properly understand it.

For example, with the integral $$\int^{2\pi}_{0} \frac{x\sin x}{3+\sin^2 x} \ dx$$

I proceeded as follows.

First I will note, that previously I have shown that $\int^{\pi}_{0} \frac{x \sin x}{3+\sin^2 x} \ dx =\frac{\pi}{2}\int^{\pi}_{0} \frac{\sin x}{3+\sin^2 x} \ dx = \frac{\pi}{4}\ln 3$

Returning to the integral $$\int^{2\pi}_{0} \frac{x\sin x}{3+\sin^2 x} \ dx = \int^{\pi}_{0} \frac{x\sin x}{3+\sin^2 x} \ dx + \int^{2\pi}_{\pi} \frac{x\sin x}{3+\sin^2 x} \ dx$$

Now in the second integral substitute $x \to x - \pi$ then we have

$$\int^{2\pi}_{\pi} \frac{x\sin x}{3+\sin^2 x} \ dx = \int^{\pi}_{0} \frac{(x - \pi)(-\sin x)}{3+\sin^2 x} \ dx= -\int^{\pi}_{0} \frac{x\sin x}{3+\sin^2 x}\ dx + \int^{\pi}_{0} \frac{\pi \sin x}{3+\sin^2 x}\ dx$$

This means that

$$\int^{2\pi}_{0} \frac{x\sin x}{3+\sin^2 x} \ dx = \int^{\pi}_{0} \frac{\pi \sin x}{3+\sin^2 x}\ dx = \frac{\pi}{2} \ln 3$$ by the initial result.

This is incorrect; the answer should be $- \frac{\pi}{2} \ln 3$, but I don't see my error. I think an error may have arisen with my substitution, so I'd appreciate it if someone could point out where the error is and why it is wrong.

Also, I wasn't sure how to entitle this question, but I hope that the title I've chosen is appropriate.

When you make the substitution $x \to x - \pi$ then you rather have
$$\int^{2\pi}_{\pi} \frac{x\sin x}{3+\sin^2 x} \ dx = \int^{\pi}_{0} \frac{\color{red}{(x+ \pi)}(-\sin x)}{3+\sin^2 x} \ dx= -\int^{\pi}_{0} \frac{x\sin x}{3+\sin^2 x}\ dx \color{red}{- }\int^{\pi}_{0} \frac{\pi \sin x}{3+\sin^2 x}\ dx$$ which gives the correct answer.
• I was trying to figure out where the mistake was. The sub $u=x-\pi$ was made so that means $u+\pi=x$. Great work @Olivier. – randomgirl Apr 5 '15 at 0:53
$$\int^{2\pi}_{\pi} \frac{x\sin x}{3+\sin^2 x} \ dx = \int^{3\pi}_{2 \pi} \frac{(x - \pi)(-\sin x)}{3+\sin^2 x} \ dx=\int^{\pi}_{0} \frac{(x + \pi)(-\sin x)}{3+\sin^2 x} \ dx$$
To change the bounds of integration from $\int_\pi^{2\pi}$ to $\int_0^\pi$, substitute $x \rightarrow x + \pi$. This gives you the correct bounds of integration (because $0 + \pi = \pi$ and $\pi + \pi = 2\pi$), and also gives you the correct sign in the result.