10
$\begingroup$

I was trying to evaluate a complicated integral by substitution and along the way I got stuck in nonsensical answer. Surprisingly enough the point I wanted to discuss can be demonstrated using the following primitive integral:

$\displaystyle\int_0^\pi \sin\theta d\theta=-\cos\theta|_0^\pi=-\cos\pi+\cos 0=1+1=2$

Now Imagine we are trying to do the same integral in another way, by substitution.

If we take $\sin\theta\equiv y$ then the limits of the integral will change accordingly from $0$ to $\pi$ to from $0$ to $0$, which will kill the integral instantly and give us $0$!

So either there is a flaw in my solution that I cannot find, or that there are conditions under which one can (or cannot) use integration by substitution that I am not aware of (at least I have never seen it in college level calculus).

  • 0
    If you take $y=\sin\,\theta$, how do you express $\mathrm d\theta$ in terms of $\mathrm dy$?2012-01-03
  • 4
    The flaw is in not using [change of variables](http://en.wikipedia.org/wiki/Substitution_rule) correctly.2012-01-03
  • 2
    This is a classic2012-01-03
  • 1
    The sine function starts as zero at the lower integration limit, grows to one at the middle, and then decreases back to zero at the upper limit. The image is thus a unit interval, not an empty one.2012-01-03
  • 0
    @J.M. $dy=\cos\theta d\theta$ where $\cos\theta=\sqrt{1-y^2}$2012-01-03
  • 0
    @cardinal Please point out where it was used incorrectly as this is exactly my question.2012-01-03
  • 1
    @Revo: see my answer below. Your error lies in the fact that it's not true that $\cos \theta = \sqrt{1-y^2}$ for all the values of $\theta$ which you're integrating over.2012-01-03

1 Answers 1

18

Integration by substitution tells us that $$\int_a^b f(g(\theta))g'(\theta)\, d\theta = \int_{g(a)}^{g(b)} f(y)\, dy$$ where $g:[a,b] \to g([a,b])$ is continuously differentiable and $f:g([a,b]) \to \mathbb{R}$ is continuous.

Now, between $0$ and $\frac{\pi}{2}$, if we set $y=g(\theta)=\sin \theta$ then $g'(\theta)=\cos \theta = \sqrt{1-y^2}$. But between $\frac{\pi}{2}$ and $\pi$ it is in fact the case that $\cos \theta = -\sqrt{1-y^2}$. So in the above expression we must have $$ f(y) = \begin{cases} \frac{y}{\sqrt{1-y^2}} & \text{if } 0 \le \theta \le \frac{\pi}{2} \\ -\frac{y}{\sqrt{1-y^2}} & \text{if } \frac{\pi}{2} \le \theta \le \pi \end{cases}$$

And so the integral actually transforms, by integration by substitution, to

$$\int_0^1 \frac{y}{\sqrt{1-y^2}}\, dy + \int_1^0 \frac{-y}{\sqrt{1-y^2}}\, dy$$

which can readily be seen to evaluate to $2$.

  • 0
    Excellent explanation, thank you so much. I am wondering why such subtleties are not taught in calculus courses? Do you know any book that cover similar subtleties?2012-01-03
  • 3
    @Revo: No problem. I don't know of any books that cover this sort of thing, I'm afraid - it's just the kind of thing you learn to spot after a while. It's really down to being very cautious when dealing with things like square roots to make sure the root you're taking is the root you're meant to take -- this kind of thing is often glossed over at school level, but I think most undergraduate-level courses try to teach good habits in this respect.2012-01-03