11

$$3\int_{0}^{2\pi} \sin(t) \cos(t) \,{\rm d}t$$

My calculus is a bit rusty and I can not find where I get it wrong. Setting $u= \sin(t)$, I get ${\rm d} u=\cos(t) \,{\rm d} t$ and, thus,

$$3\int_{u=0}^{u=0}u \,{\rm d}u=0$$

newhere
  • 3,115

4 Answers4

9

The substitution is correct. If $f$ is a function with an antiderivative $F$, one has by the fundamental theorem of calculus \begin{equation} \int_a^b f(u(t))u'(t)dt = \int_a^b(F(u(t)))' dt = F(u(b)) - F(u(a)) = \int_{u(a)}^{u(b)}f(x) d x \end{equation} A sufficient hypothesis is that $u'$ is continuous in $[a,b]$ and that $f$ is continuous on an interval that contains $u([a,b])$.

In your case $u(t) = \sin(t)$ and $f(t)=t$.

I'm amazed that so many people are puzzled by this simple application of the fundamental theorem of calculus.

Let us take the case of the integral \begin{equation} I = \int_0^\pi \sin(x) d x \end{equation} and let $u(x) = - \cos(x)$ as suggested in the comments, with $f(x)= 1$. The above substitution formula gives \begin{equation} I = \int_{-\cos(0)}^{-\cos(\pi)} dx = \int_{-1}^1 d x = 2 \end{equation} which is the correct result.

There is no contradiction with this counterexample because in the counterexample, the invalid substitution is $u(x) = \sin(x)$. It would imply $f(u) = \pm\frac{u}{\sqrt{1-u^2}}$ and the original integral must be split at $\pi/2$ to choose between $+$ and $-$. It does not invalidate the above formula with the continuity condition on $f$.

Gribouillis
  • 14,188
  • Exactly yes. A lot of people seem to think that being one-to-one is a requirement for substitution (including myself a little while back!) - but it actually isn't! These counterexamples people come up with are because it doesn't conform to the form of substitution, not because of injectivity directly – Riemann'sPointyNose Aug 25 '20 at 13:28
  • How do you justify your claim with $I=\displaystyle\int_0^{2\pi}\cos^2t,dt, u=\sin t$ ? –  Aug 25 '20 at 13:53
  • Right, but that has nothing to do with injectivty directly. That's because it doesn't actually conform to the form of substitution. Look at the article and try and write the original integral in the required form. In this case - the substitution in the original post is correct. To say it isn't is just wrong - otherwise, tell me the condition that the substitution doesn't satisfy in order to use substitution – Riemann'sPointyNose Aug 25 '20 at 13:55
  • @Riemann'sPointyNose: in case of doubt, I am addressing Gribouillis. –  Aug 25 '20 at 13:57
  • 2
    @YvesDaoust The point is that you need to express $\cos(t)$ in terms of $\sin(t)$ and that depends on the interval. You would have $f(u) = \pm \sqrt{1-u^2}$ and you need to cut the integral at $\pi/2$ and $3\pi/2$ to choose between + and -. – Gribouillis Aug 25 '20 at 14:16
  • @Gribouillis I appreciate (+1) your answer. However, pedagogically at a first year Calculus level, it seems that invertibility puts you on the safe side because at first sight $f$ is not available to check for continuity. For instance, in the counterexample, the temptation to choose the positive root would be too strong for students. – Miguel Aug 25 '20 at 14:54
  • 1
    Invertibility is required in indefinite integration, where you are required to go back to the original variable – Vincenzo Tibullo Aug 25 '20 at 15:00
  • @Miguel if you tell a student subs need to be injective - it does indeed make it harder for them to make mistakes. However, it can also make them think it's a strict requirement, which isn't true – Riemann'sPointyNose Aug 25 '20 at 15:07
  • 1
    @Miguel The main thing to stress in the non-invertible case is the difference between $u([a, b])$ and $[u(a), u(b)]$. Also note that the continuity conditions could most certainly be relaxed. – Gribouillis Aug 25 '20 at 15:12
  • @enzotib hmm... I'm not sure how you mean. For example if you do ${\int \sin(x)\cos(x)dx}$ with ${u=\sin(x)}$, you get ${\int udu=\frac{1}{2}u^2 + C = \frac{1}{2}\sin^2(x) + C}$, invertibility was not required here at all. If you mean when doing ${x=f(u)}$ type substitutions instead - of course you will, you have assumed in doing this type of substitution that you have an invertible substitution in the first place. But original $u$ sub doesn't require it, even in indefinite integration – Riemann'sPointyNose Aug 25 '20 at 15:15
  • 1
    @Riemann'sPointyNose, of course you're right, I was implicitly thinking of the second case you shown – Vincenzo Tibullo Aug 25 '20 at 15:20
  • @enzotib no problem! Yeah I did think so. It's a really common misconception - I think following from what Miguel said - maybe most people are taught to use injective subs (to avoid making other mistakes) and as a result seem to think it's mandatory? – Riemann'sPointyNose Aug 25 '20 at 15:22
  • 2
    @Riemann'sPointyNose This reminds me of the conditions for integrability. Continuity is not necessary, but in practice it is much easier to break the interval into parts where the function is continuous, than to introduce the Lebesgue integral and argue that the set of discontinuouities has measure zero---of course I am exaggerating a bit :) – Miguel Aug 25 '20 at 15:40
  • @Miguel Yes this is a rather nice analogy actually! It's like "it's usually easier if this is the case, however it does not need to be so" – Riemann'sPointyNose Aug 25 '20 at 15:44
6

I thought I'd create a separate answer to just try and explain the confusion people have a bit more. @Gribouillis has given you a really good answer, so please give him the solution check-mark.


It's not true that the substitution needs to be injective. You can see for yourself on the Wikipedia article the conditions required for $u$ substitution, and injectivity is not one of those requirements: https://en.wikipedia.org/wiki/Integration_by_substitution. In this case - your solution for this integral is completely valid (it is indeed $0$) and there is nothing wrong with your method.

There are some cases where if you blindly apply substitution, you can get the incorrect result. For example, consider

$${\int_{0}^{\pi}\sin(x)dx}$$

Let's substitute ${u=\sin(x)}$. Then the bounds become ${\int_{0}^{0} ...du=0}$. Does that mean the original integral is $0$? NO!. We have incorrectly applied the theorem of Integration by Substitution. All substitution says is that

$${\int_{a}^{b}f(\phi(x))\phi'(x)dx=\int_{\phi(a)}^{\phi(b)}f(u)du}$$

${\int_{0}^{\pi}\sin(x)dx}$ does not match this form. You can make it happen - so let's try it. We can write

$${\int_{0}^{\pi}\sin(x)\frac{\cos(x)}{\cos(x)}dx}$$

Now here's the problem - we need to write the bottom ${\cos(x)}$ in terms of ${\sin(x)}$ - we know ${\cos(x)=\pm\sqrt{1-\sin^2(x)}}$ - that's the problem - the ${\pm}$. If ${x \in \left[0,\frac{\pi}{2}\right)}$, we have ${\cos(x)=\sqrt{1-\sin^2(x)}}$, and if ${x \in \left(\frac{\pi}{2},\pi\right]}$ then ${\cos(x)=-\sqrt{1-\sin^2(x)}}$. So you will have to split up the integral into two halves, like so:

$${\int_{0}^{\pi}\sin(x)dx=\int_{0}^{\frac{\pi}{2}}\frac{\sin(x)}{\sqrt{1-\sin^2(x)}}\cos(x)dx+\int_{\frac{\pi}{2}}^{\pi}\frac{\sin(x)}{-\sqrt{1-\sin^2(x)}}\cos(x)dx}$$

And now we can apply substitution to the two individual integrals to get

$${=\int_{0}^{1}\frac{u}{\sqrt{1-u^2}}du-\int_{1}^{0}\frac{u}{\sqrt{1-u^2}}du=2\int_{0}^{1}\frac{u}{\sqrt{1-u^2}}du}$$

So as you can see - there are certain subtleties with using substitution - but injectivity is not a direct condition required for it. Your solution to the integral is absolutely fine.

  • 2
    I have to think about how to teach this. The emphasis on the form $\int_{a}^{b}f(\phi(x))\phi'(x)dx$ is not useful in practice. If you identify $f$ then you do not need substitution to begin with and the integral is immediate. – Miguel Aug 25 '20 at 15:33
  • @Miguel this is true, I completely agree - which is why usually it's helpful to combine these type of substitutions with tricks, like I did with ${\int_{0}^{\pi}\sin(x)dx=\int_{0}^{\pi}\frac{\sin(x)}{\cos(x)}\cos(x)dx=2\int_{0}^{1}\frac{u}{\sqrt{1-u^2}}du}$ (although I think we'll both agree this is a super silly example haha). But yeah, ultimately the statement for Integration by Substitution is actually rather a simple one - and in practice usually people don't worry too much about the rigorous little bits. But when something goes wrong - usually you have to go back to it, unfortunately – Riemann'sPointyNose Aug 25 '20 at 15:40
  • 1
    @Riemann'sPointyNose Some people have decided to close the question because they want to promote a completely different question that satisfy their ideology. I find this so shameful that I'm considering to withdraw very soon my membership from math.stackexchange. Thank you for your support in this question. There is definitely something wrong in the decision system on these sites. – Gribouillis Aug 25 '20 at 19:23
  • @Gribouillis we definitely need to get this reopened. The question does not get answered in the linked post, and the substitution works just fine – Riemann'sPointyNose Aug 25 '20 at 19:41
  • 3
    @Gribouillis I have silently followed this question and also your answer from -1 to +3, as people realise you're correct. Please don't lose faith in the site. I think you can flag the question for moderator attention to explain why it should not be closed. If that still doesn't work, I'd love to see this debated on Meta. – Benjamin Wang Aug 25 '20 at 19:50
  • @BenjaminWang I have also flagged it for moderator attention. The answers in the linked post all also (mostly) claim that the substitution must be injective - which is just not true! – Riemann'sPointyNose Aug 25 '20 at 19:54
  • I wonder if there is a nontrivial example where this kind of non-injective substitution is actually the simplest way forwards? (Obviously has to be definite integration) – Benjamin Wang Aug 25 '20 at 19:56
0

I'd just like to point out that there is a simpler method to finding the definite integral than by substitution. We have the identity $$\sin2x=2\sin x \cos x$$ so dividing by $2$ gives $$\frac{1}{2}\sin2x=\sin x \cos x$$ so this allows us to find the value of your definite integral by integrating $\sin t$, which is much easier (as $\int \sin{t} dt=-\cos t +c.$)

I hope that's useful.

-3

The result is correct, because the function $x \mapsto \sin(x) \cos(x)$ is $\pi$-periodic. However, this was more of a lucky strike here, because the sub is not appropriate.

Another (bad) example would be the integral $\displaystyle\int_0^\pi \sin(x) \mathrm{d}x$. If you set $u = \sin(x)$, then you get $\mathrm{d}x = \dfrac{\mathrm{d}u}{\sqrt{1 - u^2}}$, and after substitution, you end up with $\displaystyle\int_0^0 \dfrac{\mathrm{d}u}{\sqrt{1 - u^2}} = 0$, which is clearly false. So something went wrong somewhere.

The main problem, in both cases, is that the inverse sine function is only defined to give you outputs in the "rightmost" part of the trigonometric circle (in other words, the image of $\sin^{-1}$ is $[-\pi/2, \pi, 2]$).

So, since in your example, your range is $[0, 2\pi]$, it messes up as soon as $x$ goes beyond $\pi/2$.

That's why you need to be careful when making trig subs. To do it properly, you'd have to split your intervals in parts where $\sin$ is injective, so that you can get a well defined inverse.

Azur
  • 2,194
  • 6
  • 18
  • 1
    I'm sorry but this is a different problem. The integral $\int \sin(x) d x$ is not under the form $\int f(u(x)) u'(x) d x$ with $f\in C^0$ and $u\in C^1$. It does not invalidate @newhere 's calculation – Gribouillis Aug 25 '20 at 10:28
  • 1
    The integral is not in the same form indeed, but why would the transformation be valid in one case, and not in the other? In both cases, $\sin^{-1}$ is not well-defined over the range. (I may very well be wrong, but I don't understand why) – Azur Aug 25 '20 at 10:32
  • @Gribouillis I agree with you but I am not sure if nowhere had checked the form. So unless one is sure, it may be better to just integrate, get back to the original form by removing substitution and then apply interval values. – Math Lover Aug 25 '20 at 10:33
  • 1
    @Nala If you want to write it under the same form with $u(x) = \sin(x)$, you need to take $f(x) = \frac{x}{\sqrt{1-x^2}}$ but this function is not continuous on $u([0, \pi]) = [0, 1]$, hence it fails. – Gribouillis Aug 25 '20 at 11:09
  • This is incorrect. The substitution is actually fine. It conforms to the requirements of $u$ substitution: https://en.wikipedia.org/wiki/Integration_by_substitution – Riemann'sPointyNose Aug 25 '20 at 13:25