# When does integration via u-substitution break down, equal limits of integration?

Edited: changed $$\displaystyle\int_{a}^{b}f(g(t))g'(t) \, dt = \int_{g(a)}^{g(b)}f(x) \, dx$$ TO $$\displaystyle\int_{a}^{b}f(t) \, dt = \int_{f(a)}^{f(b)}u \, \frac{du}{f'(f^{-1}(u))}$$

I am wondering about this idea in general, but for concreteness let's say I am attempting to numerically integrate the following:

$$\int_{-\pi}^{\pi} K\left(\sqrt{1-\frac{1}{4}\left(\sqrt{3}\varepsilon+\cos(x)\right)^2}\right)dx=\int_{-\pi}^{\pi} K\left(\alpha\right)dx$$ Where $$K$$ is the elliptic integral of the first kind, $$-\sqrt{3}<\varepsilon<\sqrt{3}$$ is a parameter and for compactness I've defined $$\alpha\equiv \sqrt{1-\frac{1}{4}\left(\sqrt{3}\varepsilon+\cos(x)\right)^2}$$.

Let's say I want to make a change in variables before trying to crunch this numerically, for whatever reason. Let's also say I have settled on the substitution $$u^3=\alpha-1$$.

My question is how do I determine the bounds on the new integral? I know (thought I knew?) that in general I just solve $$u^3=\alpha-1$$ for $$x=\pi$$ and $$x=-\pi$$ to get my new bounds. In this case however, that results in both bounds being the same. No problem, I notice the integrand is symmetric in $$x$$ so I can do twice the integral from $$0$$ to $$\pi$$, which gives me different $$u$$-bounds. My question then is when are we allowed to apply: $$\int_{a}^{b}f(t) \, dt = \int_{f(a)}^{f(b)}u \, \frac{du}{f'(f^{-1}(u))}\quad \text{ with } \ u=f(t) \to dt=\frac{du}{f'(f^{-1}(u))}$$ if it doesn't work when $$u(a)=u(b)$$? Furthermore, even going from $$0$$ to $$\pi$$ I run into the same problem when $$\varepsilon=0$$. I could again exploit symmetry to break up the integral, or scrap this idea entirely and try a different substitution, but I am looking for a more general method here or some insight into where this failure comes from. For example, if I let $$|\varepsilon|\ll1$$ my bounds in $$u$$ are different, but just barely. I would expect this to fail as well even though the bounds are different. It seems like there must be some need to take into account the shape of $$g(t)$$, perhaps $$g'(t)\geq0$$ or $$g'(t)\leq0$$ for $$a or something like that? Any insight is appreciated, thanks in advance!

• This is a good question. I thought I could answer it by just consulting the formal change of variables theorem but I came up empty. I hope it gets some more attention. Sep 25, 2018 at 0:13

The change of variables result

$$\tag{*}\int_{a}^{b}f(g(t))g'(t) \, dt = \int_{g(a)}^{g(b)}f(x) \, dx$$

is sometimes proved in texts with the hypotheses that $$f$$ is continuous on $$g([a,b])$$ and $$g$$ has a continuous derivative $$g'$$ on $$[a,b]$$ which is never zero. In this case, $$g$$ is strictly increasing or decreasing and the issue that $$g(a) = g(b)$$ never arises.

However, the condition that $$g'(x) \neq 0$$ can be discarded and (*) is still valid. This holds even if $$g(a) = g(b)$$ where the integral must be zero.

For a proof, note that $$t \mapsto f(g(t))g'(t)$$ is continuous and we can define

$$F(x) = \int_{g(a)}^x f(t) \, dt,\\G(x) = \int_a^x f(g(t))g'(t) \, dt$$

Thus, $$F'(x) = f(x)$$, $$G'(x) = f(g(x)) g'(x)$$ and by the chain rule

$$\frac{d}{dx}F(g(x)) = f(g(x))g'(x) = G'(x)$$

It follows that $$F(g(x)) - G(x)$$ is a constant. Since $$F(g(a)) = G(a) = 0$$ the constant is zero and for all $$x \in [a,b]$$ we have

$$G(x) = \int_a^x f(g(t))g'(t) \, dt = \int_{g(a)}^{g(x)} f(t) \, dt = F(g(x))$$

This is true, in particular for $$x = b$$ where we recover (*) even if $$g(a) = g(b)$$.

Also there are even weaker conditions on $$f$$ and $$g$$ where this result is true.

Revised question

The question is how does "u-substitution" as a variant of the change-of-variables theorem break down when applied to $$\int_a^b f(t) \, dt$$ using the formal approach: $$u = f(t), \,\, du = f'(t) \, dt$$.

In defining $$u = f(t)$$ and proceeding with the substitution we require that $$f$$ is injective (the inverse function $$f^{-1}$$ exists with range containing [a,b]).

We then can apply the usual formula for the derivative of the inverse function to $$t = f^{-1}(u)$$ and obtain

$$dt = \frac{d}{du}[f^{-1}(u)] \, du = \frac{1}{f'(f^{-1}(u))} \, du,$$

and

$$\int_a^b f(t) \, dt = \int_{f^{-1}(a)}^{f^{-1}(b)} \frac{u}{f'(f^{-1}(u))} \, du$$

This is is what I believe you intended to write. It is only valid if the derivative in the denominator on the RHS is never zero and

$$f([f^{-1}(a), f^{-1}(b)]) = [a,b].$$

• You made a mistake so this is not a counterexample. In this case $g'(t) = -2 \cos t \sin t$. .
– RRL
Sep 25, 2018 at 14:56
• In fact $\int_0^{\pi }\cos^2 t [-2 \cos (t) \sin (t)] \, dt= \int_1^1 dt = 0$.
– RRL
Sep 25, 2018 at 14:59
• I think made a mistake in my question! Let's say I want to do a $u$-substitution, not necessarily $f(g(t))g'(t)dt$, like: $$\int_0^{\pi} \sin(x) \,\mathrm{d}x=2$$ If I now say $u=\sin(x)\to \mathrm{d}u=\cos(x)\mathrm{d}x=\sqrt{1-u^2}\mathrm{d}x$ and $x=0\to u=0$, $x=\pi\to u=0$ so that $$\int_0^{\pi} \sin(x) \,\mathrm{d}x=2 \to \int_0^{0}\frac{u \, \mathrm{d}u}{\sqrt{1-u^2}}=0$$ This is the $u$-substitution failure I was referring to, sorry my original question doesn't reflect that. I am new to stack exchange, should I post this as a new question? Thanks again! Sep 25, 2018 at 15:09
• I see you are correct when the integrand is of the form $f(g(t))g'(t) \, \mathrm{d}t$, which follows very simply from the fundamental theorem of calculus as you showed. Sep 25, 2018 at 15:17
• I have edited my question to reflect this, sorry for the confusion and thanks again for your help! Sep 25, 2018 at 15:34