In the following example, I am attempting to find the area of a semicircle using calculus, which is obviously $\frac{\pi{r}^2}{2}$. Effectively, I am trying to find $$\int_{-r}^r\sqrt{r^2-x^2}dx$$ Here goes: Let $x=r\sin\theta$: $$\frac{dx}{d\theta}=r\cos\theta\implies dx=r\cos\theta d\theta$$ When: $$x=r, ~~~~\text{Then}~~~~\sin\theta=1\implies\theta=\frac{\pi}{2}$$ $$x=-r, ~~~~\text{Then}~~~~\sin\theta=-1\implies\theta=-\frac{\pi}{2}$$ $$\therefore\int_{-r}^r\sqrt{r^2-x^2}dx=\int_{-\frac{\pi}{2}}^{\frac{\pi}{2}}r\cos\theta\sqrt{r^2-r^2\sin^2\theta} ~~d\theta$$ $$=\int_{-\frac{\pi}{2}}^{\frac{\pi}{2}}r^2\cos^2\theta~~d\theta=\frac{r^2}{2}\int_{-\frac{\pi}{2}}^{\frac{\pi}{2}}(1+\cos2\theta)~~d\theta=\frac{r^2}{2}\left[\theta+0.5\sin2\theta\right]_{-\frac{\pi}{2}}^{\frac{\pi}{2}}=\frac{r^2}{2}((\frac{\pi}{2}+0)-(-\frac{\pi}{2}-0))=\frac{\pi r^2}{2}$$ as required.
BUT Back to the stage when I was working out the limits of the new integral with respect to $\theta$. Let's say I wrote something like this:
When: $$x=r, ~~~~\text{Then}~~~~\sin\theta=1\implies\theta=\frac{5\pi}{2}$$ $$x=-r, ~~~~\text{Then}~~~~\sin\theta=-1\implies\theta=-\frac{5\pi}{2}$$ Then , I would get an eventual answer of $$\frac{5\pi r^2}{2}$$ Where have I gone wrong? It seems to me that my logic is faultless, but the definite integral is simply ambiguous when using trig substitutions. This would apply to any integral involving trig substitutions; in short, can't all definite integrals computed using trig substitutions generate an incorrect answer?
If so, isn't the maths of definite integrals faulty? Thanks for your help.
When, in order to compute a primitive $\int f(x)\,\mathrm dx$, we do a substitution of the type $x=g(y)$ (together with $f(x)=g'(x)\,\mathrm dy$, of course), the substitution function $g$ must be a bijection. If you take $x=r\sin\theta$, with $\theta\in\left[-\frac\pi2,\frac\pi2\right]$, you do have a bijection, and so all works as it should. Or if $\theta\in\left[\frac32\pi,\frac52\pi\right]$. But if you take the interval $\left[-\frac52\pi,\frac52\pi\right]$, you don't have a bijection anymore.