Calculus · Integrals with a Parameter
Some of the most famous integrals in mathematics, like \( \int_0^\infty e^{-x^2}dx \) and \( \int_0^\infty \frac{\sin x}{x}dx \), have no elementary antiderivative. Yet their values are known exactly. The secret is to treat them as members of a family and apply calculus to the parameter. This post shows how, and when it is allowed.
For proper integrals \( \int_a^b f(x, m)\,dx \), continuity of \(f\) and \(f_m'\) on a closed rectangle was enough to differentiate and integrate with respect to \(m\) under the integral sign. For improper integrals we saw that convergence alone does not even guarantee continuity; the extra ingredient was uniform convergence. This post finishes the story: the same ingredient makes differentiation and integration legal.
The common theme, in one sentence: an improper integral is a limit, and swapping two limiting operations requires uniformity.
The substitution rule works for improper integrals just as for proper ones, provided the substitution \( x = \varphi(t) \) is continuously differentiable and strictly monotone, mapping the \(t\)-interval onto the \(x\)-interval (the endpoints may be infinite). Then both integrals converge or diverge together, and
\[ \int_a^{\infty} f(x)\,dx = \int_{\alpha}^{\beta} f\big(\varphi(t)\big)\,\varphi'(t)\,dt, \qquad \varphi(\alpha) = a,\ \ \varphi(\beta^-) = \infty. \]With a parameter, the most useful substitution is scaling, \( x = t/m \). It often shows how the integral depends on \(m\) without computing anything.
Note the asymmetry: the original integral only has to converge, but the differentiated integral must converge uniformly. That is the one you have to check.
Why it works: write \( I(m) = \lim_{b\to\infty} I_b(m) \) with \( I_b(m) = \int_a^b f\,dx \). For each finite \(b\), the proper Leibniz rule gives \( I_b'(m) = \int_a^b f_m'\,dx \). Uniform convergence of \( \int_a^\infty f_m' \) means these derivatives converge uniformly as \(b \to \infty\), and a standard theorem of analysis says: if functions converge and their derivatives converge uniformly, the limit is differentiable and its derivative is the limit of the derivatives.
How to check condition 2 in practice: find a majorant for \(f_m'\) (Weierstrass test). As in the last post, if the trouble is at an endpoint of the parameter interval, prove uniformity on \([m_0, \infty)\) for every \(m_0 > 0\); that is enough to get the formula at every \(m > 0\), since each such \(m\) lies inside some \((m_0, \infty)\).
Justification: each differentiated integrand \( x^ke^{-mx} \) is bounded on \([m_0, \infty)\) by the integrable majorant \( x^ke^{-m_0x} \), so each step is uniform. With \(m = 1\) this gives \( \int_0^\infty x^ne^{-x}\,dx = n! \), i.e. \( \Gamma(n + 1) = n! \).
The differentiated integrand is \( -xe^{-x^2}\sin(mx) \), with the majorant \( xe^{-x^2} \) (integrable, independent of \(m\)). So Leibniz applies on all of \(\mathbb{R}\):
\[ I'(m) = -\int_0^\infty xe^{-x^2}\sin(mx)\,dx. \] Integrate by parts with \( u = \sin(mx) \), \( dv = xe^{-x^2}dx \), \( v = -\frac12e^{-x^2} \): \[ I'(m) = \Big[\tfrac12e^{-x^2}\sin(mx)\Big]_0^\infty - \frac m2\int_0^\infty e^{-x^2}\cos(mx)\,dx = -\frac m2\,I(m). \] This is a separable ODE: \( \frac{I'}{I} = -\frac m2 \), so \( I(m) = I(0)\,e^{-m^2/4} \). With \( I(0) = \frac{\sqrt\pi}{2} \), \[ \int_0^\infty e^{-x^2}\cos(mx)\,dx = \frac{\sqrt\pi}{2}\,e^{-m^2/4}. \] (A Gaussian transforms into a Gaussian, a fact at the heart of Fourier analysis and probability.)Step 1: differentiate. \( \frac{\partial}{\partial m}\Big(e^{-mx}\frac{\sin x}{x}\Big) = -e^{-mx}\sin x \), with majorant \( e^{-m_0x} \) on \([m_0, \infty)\). So
\[ F'(m) = -\int_0^\infty e^{-mx}\sin x\,dx = -\frac{1}{1 + m^2}. \](The \(\frac1x\) disappeared: that's the whole point of the parameter.)
Step 2: integrate back. \( F(m) = C - \arctan m \).
Step 3: find the constant. Since \( \left|\frac{\sin x}{x}\right| \le 1 \), \( |F(m)| \le \int_0^\infty e^{-mx}dx = \frac1m \to 0 \) as \(m \to \infty\). So \( 0 = C - \frac\pi2 \), and \( F(m) = \frac\pi2 - \arctan m \).
Step 4: let \(m \to 0^+\). The integral defining \(F\) converges uniformly on \([0, \infty)\) (this follows from Abel's test, since \(e^{-mx}\) is monotone in \(x\) and bounded by 1, and \( \int_0^\infty \frac{\sin x}{x}dx \) converges), so \(F\) is continuous at \(0\):
\[ \int_0^\infty \frac{\sin x}{x}\,dx = \lim_{m\to 0^+} F(m) = \frac\pi2. \]The most common use is the trick from the previous post on proper integrals: recognise part of the integrand as an integral with respect to a parameter, then swap the order.
Observe that \( \dfrac{e^{-ax} - e^{-bx}}{x} = \displaystyle\int_a^b e^{-mx}\,dm \). The integral \( \int_0^\infty e^{-mx}dx \) converges uniformly on \([a, b]\) (majorant \(e^{-ax}\)), so
\[ \int_0^\infty dx\int_a^b e^{-mx}\,dm = \int_a^b dm\int_0^\infty e^{-mx}\,dx = \int_a^b \frac{dm}{m} = \ln\frac ba. \]Theorem 2 needs a finite parameter interval. For non-negative integrands there is a much more generous rule:
The intuition: with no negative values, nothing can cancel, so adding up "by rows" or "by columns" must give the same total. Problems like the warning examples in earlier posts come from positive and negative parts cancelling differently in different orders.
| Operation | Formula | Sufficient conditions |
|---|---|---|
| Substitution | \( \int_a^\infty f(x)\,dx = \int_\alpha^\beta f(\varphi(t))\varphi'(t)\,dt \) | \(\varphi\) strictly monotone, \(C^1\) |
| Differentiation | \( \frac{d}{dm}\int_a^\infty f\,dx = \int_a^\infty f_m'\,dx \) | \(f, f_m'\) continuous; \(\int f\) converges; \(\int f_m'\) converges uniformly |
| Integration, finite interval | \( \int_{m_1}^{m_2}\!dm\int_a^\infty f\,dx = \int_a^\infty\!dx\int_{m_1}^{m_2} f\,dm \) | \(f\) continuous; \(\int f\,dx\) converges uniformly on \([m_1, m_2]\) |
| Integration, infinite interval | same formula | \(f \ge 0\) and one side finite |
The general strategy for a hard integral:
Try these before opening the solution. More solved problems are in Definite Integrals and Double Integrals.
Example 3 with \(n = 2\): differentiate \( \int_0^\infty e^{-mx}dx = \frac1m \) twice. Majorant on \([m_0, \infty)\): \(x^2e^{-m_0x}\).
Call it \(F(m)\). Then \( F'(m) = \int_0^\infty e^{-x}\sin(mx)\,dx = \frac{m}{1 + m^2} \) (majorant \(e^{-x}\), so uniform on \(\mathbb R\)). Integrating, \( F(m) = \frac12\ln(1 + m^2) + C \), and \(F(0) = 0\) gives \(C = 0\): \[ F(m) = \tfrac12\ln(1 + m^2). \]
As in Example 5: \( F'(m) = -\int_0^\infty e^{-mx}\sin(bx)\,dx = -\frac{b}{m^2 + b^2} \), so \( F(m) = C - \arctan\frac mb \). Since \(F(m) \to 0\) as \(m \to \infty\), \(C = \frac\pi2\), and \( \frac\pi2 - \arctan\frac mb = \arctan\frac bm \).
Write the integrand as \( \int_a^b e^{-mx^2}\,dm \) and swap (uniform on \([a, b]\), majorant \(e^{-ax^2}\)): \[ \int_a^b dm\int_0^\infty e^{-mx^2}dx = \int_a^b \frac12\sqrt{\frac\pi m}\,dm = \sqrt\pi\big(\sqrt b - \sqrt a\big). \]
Since \( \frac{\partial}{\partial m}\arctan(mx) = \frac{x}{1 + m^2x^2} \), the integrand equals \( \int_b^a \frac{dm}{1 + m^2x^2} \), which is positive. By Theorem 3 (or Theorem 2, as \([b, a]\) is finite): \[ \int_b^a dm\int_0^\infty \frac{dx}{1 + m^2x^2} = \int_b^a \frac{\pi}{2m}\,dm = \frac\pi2\ln\frac ab. \]
Differentiate \( \int_0^\infty e^{-mx^2}dx = \frac{\sqrt\pi}{2}m^{-1/2} \) with respect to \(m\) (majorant \(x^2e^{-m_0x^2}\) on \([m_0,\infty)\)): \[ -\int_0^\infty x^2e^{-mx^2}dx = -\frac{\sqrt\pi}{4}m^{-3/2} \;\Longrightarrow\; \int_0^\infty x^2e^{-mx^2}dx = \frac{\sqrt\pi}{4m^{3/2}}. \]
The integrals in this post are not curiosities: the Gaussian integral underlies the normal distribution, the Dirichlet integral appears in signal processing, and Example 4 is a first glimpse of the Fourier transform. What made them computable was one idea, turning a number into a function and doing calculus on it, together with one safety check: uniform convergence before any swap.
Next in the series: the Euler integrals, the Gamma and Beta functions, and the relation \( \mathrm B(p, q) = \frac{\Gamma(p)\Gamma(q)}{\Gamma(p + q)} \).