# Integrating by substitution

I'm embarrassed to ask this question, but what's the flaw in the following evaluation?

$\displaystyle\int_{0}^{\pi} \sin (\sin x) \ dx = \int_{0}^{0} \frac{\sin u}{\sqrt{1-u^{2}}} \ du = 0$.

-
Yes, that is it. – Pedro Tamaroff Apr 4 '13 at 18:06
The substitution you use is not one-one. – i707107 Apr 4 '13 at 18:11

## 2 Answers

Your $u$-substitutions should be injective on their interval of evaluation. Otherwise, you risk running into this sort of issue.

Now, if you want to use $u=\sin x$, then $$\frac{du}{dx}=\cos x=\begin{cases}|\cos x|=\sqrt{1-u^2} & 0\le x\le \frac\pi2\\-|\cos x|=-\sqrt{1-u^2} & \frac\pi2\le x\le\pi,\end{cases}$$ so \begin{align}\int_0^\pi\sin(\sin x)\,dx &= \int_0^{\pi/2}\sin(\sin x)\,dx+\int_{\pi/2}^\pi\sin(\sin x)\\ &= \int_0^{\pi/2}\sin(\sin x)\,dx-\int_\pi^{\pi/2}\sin(\sin x)\,dx\\ &= \int_0^1\frac{\sin u}{\sqrt{1-u^2}}\,du-\int_0^1\frac{\sin u}{-\sqrt{1-u^2}}\,du\\ &= 2\int_0^1\frac{\sin u}{\sqrt{1-u^2}}\,du.\end{align} Alternately, you could note that $\sin(\pi-x)=\sin x$, so \begin{align}\int_0^\pi\sin(\sin x)\,dx &= \int_0^{\pi/2}\sin(\sin x)\,dx+\int_{\pi/2}^\pi\sin(\sin x)\\ &= \int_0^{\pi/2}\sin(\sin x)\,dx-\int_\pi^{\pi/2}\sin(\sin x)\,dx\\ &= \int_0^{\pi/2}\sin(\sin x)\,dx-\int_\pi^{\pi/2}\sin(\sin(\pi-x))\,dx\\ &= \int_0^{\pi/2}\sin(\sin x)\,dx-\int_0^{\pi/2}\sin(\sin x)\frac{d(\pi-x)}{dx}\,dx\\ &= 2\int_0^{\pi/2}\sin(\sin x)\,dx,\end{align} at which point you can use your $u$-substitution without fear, since the sine function is injective on $[0,\pi/2]$.

I'm afraid that integral isn't going to have a nice elementary evaluation. W|A gives a solution in terms of the Struve function.

-
Thanks. I'm not interested in actually evaluating the integral. But are you saying it's possible that you could make a substitution that is not 1-1 on the interval on integration and not run into a problem? – Random Variable Apr 4 '13 at 18:29
You can, but if you do, then you have to break it up into component intervals where it is one-to-one. This can be prohibitively tedious, depending on how messy your substitution function is. – Cameron Buie Apr 4 '13 at 18:31

Your problem is not that $\sin x$ is not one-to-one on $0\le x\le \pi$, but that you took $\cos x$ as $\sqrt{1-\sin^2x}$ on $0\le x\le \pi$, and this is wrong because on $\pi/2\le x\le \pi$, $$\cos x=-\sqrt{1-\sin^2x}.$$

-
For future visitors: From various other questions here, I seem to gather that $u$-substitutions do not have to be one-to-one. However, if they are, you can usually take inverse functions for granted with reckless abandon. If they aren't, your integrand may become more complicated (and piecewise). – Radon Rosborough Apr 8 '15 at 2:33