# Showing $\int_{0}^{\pi }{x\cdot \sin \left( x \right)dx}=\; \frac{\pi }{2}\int_{0}^{\pi }{\sin \left( x \right)dx}$

I'm working on integration by substitution and can't seem to get a hang on the following detail:

How would one use the substitution $\displaystyle u = \pi - x$ to show the following equality:

$\int_{0}^{\pi }{x\cdot \sin \left( x \right)dx}=\; \frac{\pi }{2}\int_{0}^{\pi }{\sin \left( x \right)dx}$

My approach so far with substitution has been to find a part of the integrand to substitute for "$\displaystyle u$" and then differentiate it to get a substitution of $\displaystyle du$ for the integral $\displaystyle dx$ (and then integrate in terms of $u$); however, in using the above substitution, I cannot see how to approach this to isolate "$\displaystyle x$" from "$\displaystyle \sin(x)$" in terms of $\displaystyle u$ and $\displaystyle du$...maybe I'm missing something obvious, but can't see it.

Thanks a bunch if anyone has any insight.

• do you know how to make $u$ substitution? $u = \pi - x$ and to convert $\int_0^\pi x \sin x \, dx$ to a $u$ integral.
– abel
Commented Feb 8, 2015 at 12:53
• A generalisation on this - math.stackexchange.com/questions/1092868/…
– user150203
Commented Dec 31, 2018 at 8:02

$$I=\int_0^{\pi}x\sin x{\rm d}x\stackrel{x\to\pi-x}=\int_{\pi-0}^{\pi-\pi}(\pi-x)\sin(\pi-x){\rm d}(\pi-x)=-\int_{\pi}^{0}(\pi-x)\sin x{\rm d}x=\int_0^{\pi}(\pi-x)\sin x{\rm d}x$$ Using: $$\sin(\pi-x)=\sin x;\quad \int_a^b=-\int_b^a$$ Adding both first and last form: $$I+I=2I=\int_0^{\pi}x\sin x{\rm d}x+\int_0^{\pi}(\pi-x)\sin x{\rm d}x=\pi\int_0^{\pi}\sin x{\rm d}x\\\implies I=\frac\pi2\int_0^{\pi}\sin x{\rm d}x$$
• I'm not following the use of $u = \pi - x$ here. I see you just replaced the $x$ before $sin(x)$ with the substitution, but why wouldn't you do so with the "$x$" in the sine function as well? In addition, by merely replacing x with the substitution as you did, I'm not seeing where the logic applies where this results in 2I... Commented Feb 7, 2015 at 19:16
• @Topher $\sin(\pi-x)=\sin x$ Commented Feb 7, 2015 at 19:17
• $d(\pi-x)=-dx$ ! Commented Feb 7, 2015 at 19:20
• Sorry! :-) I've confused $x$ and $u$.Upvote! Commented Feb 7, 2015 at 19:37
Substituting $$x:=\pi-u,\quad dx=-du \qquad(\pi\geq u\geq0)$$ gives $$\int_0^\pi x\sin x\>dx=-\int_\pi^0(\pi -u)\sin u\>du=\pi\int_0^\pi \sin u\>du-\int_0^\pi u\sin u\>du\ ,$$ which implies $$2\int_0^\pi x\sin x\>dx=\pi\int_0^\pi \sin u\>du\ .$$