2

My student asked me: While solving $\int_{-1}^1{x^4}dx$, why can't we substitute as $t=x^2$ $$x^2 =t, 2xdx = dt, x=\pm \sqrt t, \int_{-1}^{1}(x^2 \cdot x \cdot x) dx = \int_1^1{\pm t \sqrt{t}dt} =0 \ne \frac{1}{5}$$ I think the problem comes from $x = \pm \sqrt t$, but I can't properly explain why this happens. How can I prove that this substitution is wrong?

John. P
  • 583
  • 7
    $x^2=t$ is NOT injective in $[-1,1]$. – Tito Eliatron Nov 12 '20 at 11:59
  • 2
    But if you say $\int_{-1}^1{x^4}dx =2 \int_{0}^1{x^4}dx$ since the integrand is even then $x^2 = t$ is injective in [0, 1] and the substitution will work. – Paul Nov 12 '20 at 12:10
  • It is certainly true that $0\ne\frac15$, but I think what you meant to say is $0\ne\frac25$. – TonyK Nov 12 '20 at 12:19
  • 2
    @TitoEliatron In $\int_{\phi (a)}^{\phi (b)}{g(x)}dx = \int_{a}^{b} {g(\phi (x))\phi '(x)dx}$, $\phi (x)$ do not need to be injective. – John. P Nov 12 '20 at 12:23
  • Think about $\int_{2\pi}^{12\pi}{\sin^3 x \cos x dx}$. – John. P Nov 12 '20 at 12:24
  • You're right that $\phi$ need not be injective for that formula to be true. But in your example, $\phi(t)$ was one of $\sqrt{t}$ or $-\sqrt{t}$. Whichever you choose, you don't get the limits you want ($-1$ and $1$) on the $x^4$ integral. – Matthew Towers Nov 12 '20 at 12:32
  • @MatthewTowers How can I know before doing the actual substitution? My question is that is there a formula or theorem that can provide that the result be wrong. – John. P Nov 12 '20 at 12:36
  • 1
    I'm not sure what you mean. You can't even start to compute $\int_{-1}^1$ of something using that formula unless you have numbers $a$ and $b$ and a function $\phi$ with $\phi(a)=-1$ and $\phi(b)=1$. – Matthew Towers Nov 12 '20 at 12:42
  • Oh that's the problem! I had a confusion about the existence of $\phi.$ – John. P Nov 12 '20 at 12:50
  • @MatthewTowers: No, I think you have it backwards: the right-hand side of that equation is the quantity that you want to evaluate, so here $a=-1$ and $b=1$. You don't need $\varphi(a)=-1$ and $\varphi(b)=1$. (The formula is usually written the other way round.) – TonyK Nov 12 '20 at 13:48
  • @TitoEliatron: infectivity is not a necessary condition for change of variables in Riemann integration. See Apostol, Analysis pp. 164. – Mittens Apr 07 '21 at 18:03

4 Answers4

3

You write in a comment that the formula $$\int_{\varphi (a)}^{\varphi (b)}{g(x)}dx = \int_{a}^{b} {g(\varphi (x))\varphi '(x)dx}$$ doesn't require $\varphi$ to be injective. This is true. But if you try and use this formula to evaluate your integral with $\varphi(x)=x^2$, you need to choose $g$ so that $$g(\varphi(x))=\frac12 x^3$$ on $[a,b]=[-1,1]$. But this would require that $g(\varphi(-1))=-\frac12$ and $g(\varphi(1))=\frac12$, which is impossible, because $\varphi(-1)=\varphi(1)$.

So $\varphi$ has to be invertible on $[a,b]$. Otherwise no suitable $g$ can exist.

Taken together with the requirement that $\varphi$ be continuously differentiable on $[a,b]$, this implies that $\varphi$ is $monotonic$ on $[a,b]$. And this is where your substitution breaks down. As others have explained, you can get round this by integrating separately over $[-1,0]$ and $[0,1]$, because $\varphi$ is monotonic on each of these intervals.

This monotonicity requirement seems to be ignored by the various web pages which state the appropriate theorem. True, it is a logical consequence of the theorem, but not, I would say, an obvious consequence.

TonyK
  • 64,559
  • But below here I have shown that a bad substitution in $ (a,c)$ can still be made to work by splitting the domain in two as $(a,b)$ and $ (b,c)$Such that in both domains the substitutions are bijections. bijection. – Z Ahmed Nov 13 '20 at 04:25
  • @ZAhmed: Read my answer again please. All of it! – TonyK Nov 13 '20 at 10:08
  • You are right but very strict as you don't show that the asked integral can be done by even the bad substitution: $u=x^2$ by splitting the integral. – Z Ahmed Nov 13 '20 at 10:21
  • @ZAhmed: "...you can get round this by integrating separately over $[-1,0]$ and $[0,1]$". – TonyK Nov 13 '20 at 10:54
  • Yes, this is what I did in my answer to earn two negative votes! Cheers. – Z Ahmed Nov 13 '20 at 11:01
  • @TonyK: I agree with seven lines (including equations) of your answer. The rest, concerning monotonicity, is not quite correct. I added an explanation below, but if you prefer, here is a good source: Apostol, Analysis 2nd edition, pp. 164-165. – Mittens Apr 07 '21 at 17:48
  • I explained here that the issue raised by the OP arises not because integration-by-substitution requires non-injectivity per se, but because $x^2$ is substitutable into the integrand $x^4$ on $[-1,1]$ only piecewise. – ryang Feb 10 '23 at 13:01
2

Although I agree with the first line of the explanation of @TonyK, I disagree with his conclusion that in the formula $u=g(x)$ for change of variables for Riemann integration, $g$ is monotone as a logical conclusion of hypothesis. Here I follow Apostol, Math. Analysis, 2nd ed. pp 164-165.

The simplest change of variable result for Riemann integration is

Theorem: Assume $g$ and its derivative $g'$ continuous on $[a,b]$, and let $f$ be a continuous function on $g([a,b])$. Define $$F(x):=\int^x_{g(a)} f(s)\,ds,\qquad x\in g([a,b]) $$ Then, for any $t\in [c,d]$, the integral $\int^t_a f(g(s))g'(s)\,ds$ exists and has value $F(g(t))$. In particular $$ \int^{g(b)}_{g(a)}f(s)\,ds =\int^b_a f(g(s))g'(s)\,ds $$

Remarks: No monotonicity assumptions on $g$ needed.

Proof: I provide a proof to make the point of the remark. All integrals in the statement of the Theorem exists because the integrands are continuous. Define $G$ on $[a,b]$ by $$ G(t)=\int^t_a f(g(s))g'(s)\,ds$$ The fundamental theorem of Calculus implies that $G'(t)=f(g(t))g'(t)$, and also $F'(x)=f(x)$. Then By the Chain rule $$ (F\circ g(t))'=F'(g(t))g'(t)=f(g(t))g(t)= G'(t)$$ Hence $h(t)=F(g(t))-G(t)$ is constant on $[a,b]$. Since $G(a)=0=F(g(a))$, it follows that $G(t)=F(g(t))$. In particular, $G(b)=F(g(b))$.


There is an even more general change of variables result for Riemann integral (H. Kesteman, Mathematical Gazette, 45(1961), pp 17-23):

Theorem: Assume $h$ in Riemann integrable in $[a,b]$, and let $c\in [a,b]$. Define $$ g(x)=\int^x_c h(t)\,dt,\qquad x\in[a,b]$$ If $f$ is Riemann integrable on $g([a,b])$, then the integral $\int^b_cf(g(t))h(t)\,dt$ exists and $$ \int^{g(b)}_{g(c)}f(s)\,ds = \int^b_c f(g(s))h(s)\,ds $$


Back to the problem in the OP.

The original question asks why the change of variables $t=x^2$ in $I=\int^1_{-1}x^4\,dx$ seems to produce a different result from what the value of the integral $I$ should be ($I=2/5$).

Now, with $t=t(x)=x^2$ one gets $$\int^1_{-1}x^4\,dx=\frac12\int^{1}_{-1}x^3 2x\,dx=\frac12\int^1_{-1}f(t(x))\,t'(x)\,dx $$ form some $f$.

  1. The problem here is what the correct $f(t)$ should be.
  2. $f(t)=t^{3/2}$ is not quite right for this involves taking a spare root and so a choice of a branch ( + or -) need be chosen. Also, the fact that the original integrand is nonnegative implies that the choice of branch has to be done so that $f(t(x))t'(x)$ remains non negative.
  3. So $f(t)=t^{3/2}$ does not work here.

A possible solution is to define $$f(t)=-\big||t^3|^{1/2}\big|\mathbb{1}_{[-1,0]}(t)+ \big||t^3|^{1/2}\big|\mathbb{1}_{[0,1]}(t)$$ This choice will then break the integral $\int^1_{-1} f(t(x))t'(x)\,dx$ in two pieces $\int^0_{-1}+\int^1_0$. This was, in a way, done by @ZAhmed. So, on $[-1,0]$ \begin{align} \int^0_{-1}x^4\,dx=\frac12\int^{0}_{-1}x^3 2x\,dx=\frac12\int^0_{-1}f(t(x))t'(x)\,dx= \frac12\int^0_1 f(t)\,dt=\frac{1}{2}\int^1_0t^{3/2}\,dt=\frac15 \end{align} nand similarly for $\int^1_0x^4\,dx$.

Mittens
  • 39,145
-1

$$I=\int_{-1}^{1} x^4 dx=2\int_{0}^{1} x^4=2\int_{0}^{1} u^2 \frac{du}{2\sqrt{u}}=\int_{0}^{1} u^{3/2} du=\frac{2}{5}$$

Other method: $$I=\int_{-1}^{0} x^4 dx+ \int_{0}^{1} x^4 dx$$ $x^2=u \implies x=\mp \sqrt{u}$, for the first part $x=-\sqrt{u}$ and for the second one let $x=+\sqrt{u}$, then $$I=\int_{1}^{0} u^2 \left(-\frac{du}{2\sqrt{u}}\right)+\int_{0}^{1} u^2 \left(\frac{du}{2\sqrt{u}}\right)=\frac{2}{5}.$$

Note that the substitution needs to be increasing or decreasing in the domain of integration. Here $=x^2$ has a minimum so break the integral in two domains $(-1,0)$ and $(0,1)$, because there is a minimum at $x=0$. For the first domain use $x=-\sqrt{u}$ and for the other use $x=\sqrt{u}$ as done in above.

Z Ahmed
  • 43,235
-4

Since for $r>0$, $\dfrac{\partial x^r}{\partial x}=r\times x^{r-1}$ and if $r-1+r=4$ then $r=\dfrac{5}{2}$.

Thus,

\begin{align}\int_{-1}^1 x^4\,dx&\overset{x\rightarrow x^4 \text{is even function}}=2\int_0^1 x^4 dx\\ &\overset{y=x^{\frac{5}{2}}}=2\times \frac{2}{5}\int_0^1 ydy\\ &=\frac{4}{5}\int_0^1 y dy\\ &=\frac{4}{5}\left[\frac{y^2}{2}\right]_0^1\\ &=\frac{4}{5}\times \frac{1}{2}\\ &=\boxed{\frac{2}{5}} \end{align}

FDP
  • 13,647
  • I wonder why my answer got downvotes. The method allows to get a polynomial of lower degree to integrate. – FDP Nov 12 '20 at 13:09
  • 1
    I didn't downvote, but this post simply doesn't answer the question: why does the proposed substitution give the wrong answer? – TonyK Nov 12 '20 at 13:13
  • The title is $\int_{-1}^1{x^4}dx$ by substitution. – FDP Nov 12 '20 at 13:17
  • 1
    Yes, but what is the question? (Now I have downvoted.) – TonyK Nov 12 '20 at 13:30
  • Why don't you downvote also the question,? Who the heck would try to integrate the function $f((x)=x^4$ by a change of variable? – FDP Nov 12 '20 at 14:48
  • 2
    Now I have upvoted the question :-) I think it's a good one. It's asking why a particular method doesn't work, not how to evaluate a particular integral. – TonyK Nov 12 '20 at 14:54