Calculus · Integrals with a Parameter
What happens when the function you integrate contains an extra variable? The integral stops being a single number and becomes a function of that variable. This post shows when such functions are continuous, how to differentiate them, and how this idea lets you compute integrals that look impossible.
Compare these two integrals:
\[ \int_0^1 x^2\,dx = \frac13 \qquad \text{and} \qquad \int_0^1 x^m\,dx = \frac{1}{m+1}. \]The first is a number. The second depends on \(m\): for each value of \(m\) you get a different number. In other words, it defines a function of \(m\). The variable \(x\) is "used up" by the integration (it is a dummy variable), while \(m\) survives. We call \(m\) a parameter.
The natural questions are the ones we ask about any function: Is \(I(m)\) continuous? Can we differentiate it? Can we integrate it? The answer to all three is "yes, provided \(f\) is nice enough", and each answer is a rule about swapping two operations: a limit, a derivative or an integral with respect to \(m\), on one side, and the integral with respect to \(x\) on the other.
Continuity of \(I\) at \(m_0\) means \( \lim_{m\to m_0} I(m) = I(m_0) \). Written out, the theorem says you may move the limit inside the integral:
\[ \lim_{m\to m_0} \int_a^b f(x, m)\,dx = \int_a^b \lim_{m\to m_0} f(x, m)\,dx = \int_a^b f(x, m_0)\,dx. \]Why it works: a continuous function on a closed, bounded rectangle is uniformly continuous. So when \(m\) is close to \(m_0\), \( |f(x, m) - f(x, m_0)| < \varepsilon \) for all \(x\) simultaneously, and then
\[ |I(m) - I(m_0)| \le \int_a^b |f(x, m) - f(x, m_0)|\,dx < \varepsilon(b - a). \]The integrand is continuous on \([0,1]\times[-1,1]\), so we may set \(m = 0\) inside:
\[ \lim_{m\to 0} \int_0^1 \sqrt{x^2 + m^2}\,dx = \int_0^1 \sqrt{x^2}\,dx = \int_0^1 x\,dx = \frac12. \]In words: to differentiate the integral, differentiate the integrand with respect to the parameter, treating \(x\) as a constant. This is the famous technique Richard Feynman liked to call "differentiating under the integral sign".
Why it works: the difference quotient of \(I\) is
\[ \frac{I(m + h) - I(m)}{h} = \int_a^b \frac{f(x, m + h) - f(x, m)}{h}\,dx = \int_a^b f_m'(x, m + \theta h)\,dx \quad (0 < \theta < 1), \]by the mean value theorem. Since \(f_m'\) is continuous, Theorem 1 lets us take the limit \(h \to 0\) inside the integral.
There is no elementary antiderivative in \(x\). But differentiating in \(m\) removes the troublesome \(\ln x\):
\[ I'(m) = \int_0^1 \frac{x^m\ln x}{\ln x}\,dx = \int_0^1 x^m\,dx = \frac{1}{m+1}. \] Hence \( I(m) = \ln(m+1) + C \). Since \(I(0) = \int_0^1 0\,dx = 0\), we get \(C = 0\): \[ \int_0^1 \frac{x^m - 1}{\ln x}\,dx = \ln(m+1). \]Often the limits of integration depend on the parameter too. Then \(m\) appears in three places, and each one contributes to the derivative.
How to remember it: think of the integral as a function \( F(\varphi, \psi, m) \) of three variables and use the chain rule:
The Fundamental Theorem of Calculus is the simplest special case: with \(f\) independent of \(m\), \(\varphi = a\) and \(\psi(m) = m\),
\[ \frac{d}{dm}\int_a^{m} f(x)\,dx = f(m). \]By the general rule: \( \psi(m) = m \), \( \varphi = 0 \), and \( \frac{\partial}{\partial m}\frac{\sin(mx)}{x} = \cos(mx) \):
\[ F'(m) = \frac{\sin(m^2)}{m}\cdot 1 + \int_0^m \cos(mx)\,dx = \frac{\sin(m^2)}{m} + \frac{\sin(m^2)}{m} = \frac{2\sin(m^2)}{m}. \]Check by substitution: with \(t = mx\), \( F(m) = \int_0^{m^2} \frac{\sin t}{t}\,dt \), so by the FTC and chain rule \( F'(m) = \frac{\sin(m^2)}{m^2}\cdot 2m = \frac{2\sin(m^2)}{m} \). Same answer.
Both sides compute the same thing: the double integral of \(f\) over the rectangle \(R\), summed "row by row" or "column by column". In the language of this post: the function \(I(m)\) is continuous (Theorem 1), so it can be integrated, and its integral can be computed by integrating \(f\) in \(m\) first.
The key observation: \( \dfrac{x^b - x^a}{\ln x} = \displaystyle\int_a^b x^m\,dm \) (integrate \(x^m = e^{m\ln x}\) in \(m\)). Therefore
\[ \int_0^1 \frac{x^b - x^a}{\ln x}\,dx = \int_0^1 dx\int_a^b x^m\,dm = \int_a^b dm\int_0^1 x^m\,dx = \int_a^b \frac{dm}{m+1} = \ln\frac{b+1}{a+1}. \] This agrees with Example 3 (\(a = 0\), \(b = m\)): two different swaps, same answer.Here is a slightly bigger example that shows the full strategy: start from an integral you can do, differentiate it with respect to a parameter, and read off a new result.
The general recipe:
| Operation on \(I(m)\) | Rule | Condition (on the rectangle \(R\)) |
|---|---|---|
| Limit | \( \lim_{m\to m_0} \int_a^b f\,dx = \int_a^b f(x, m_0)\,dx \) | \(f\) continuous |
| Derivative | \( \frac{d}{dm}\int_a^b f\,dx = \int_a^b f_m'\,dx \) | \(f\) and \(f_m'\) continuous |
| Derivative, variable limits | \( f(\psi, m)\psi' - f(\varphi, m)\varphi' + \int_\varphi^\psi f_m'\,dx \) | as above, \(\varphi, \psi\) differentiable |
| Integral in \(m\) | \( \int_{m_1}^{m_2} dm\int_a^b f\,dx = \int_a^b dx\int_{m_1}^{m_2} f\,dm \) | \(f\) continuous |
Try these before opening the solution. More solved problems are in Definite Integrals and Double Integrals.
The integrand is continuous, so put \(m = 0\): \( \int_{-1}^{1} |x|\,dx = 1 \).
Differentiate \( \int_0^1 x^m\,dx = \frac{1}{m+1} \) twice with respect to \(m\) (Example 2 with \(n = 2\)).
Example 6 with \(a = 1\), \(b = 3\): \( \ln\frac{4}{2} = \ln 2 \).
Using \( \sqrt{1 - \cos^2m} = \sin m \) and \( \sqrt{1 - \sin^2m} = \cos m \): \[ F'(m) = -\sin m\,e^{m\sin m} - \cos m\,e^{m\cos m} + \int_{\sin m}^{\cos m} \sqrt{1 - x^2}\,e^{m\sqrt{1 - x^2}}\,dx. \]
\( y' = (x - x)g(x) + \int_0^x g(t)\,dt = \int_0^x g(t)\,dt \), and then \( y'' = g(x) \) by the FTC.
Differentiate: \( I'(m) = \int_0^{\pi/2} \frac{2m\sin^2x}{\cos^2x + m^2\sin^2x}\,dx \). With \(t = \operatorname{tg}x\) and partial fractions (for \(m \ne 1\)), \[ I'(m) = \frac{2m}{m^2 - 1}\int_0^\infty\left(\frac{1}{1 + t^2} - \frac{1}{1 + m^2t^2}\right)dt = \frac{2m}{m^2 - 1}\left(\frac{\pi}{2} - \frac{\pi}{2m}\right) = \frac{\pi}{m + 1}. \] So \( I(m) = \pi\ln(m + 1) + C \). Since \( I(1) = \int_0^{\pi/2} \ln 1\,dx = 0 \), \( C = -\pi\ln 2 \), and \[ I(m) = \pi\ln\frac{1 + m}{2}. \]
All three theorems in this post say the same thing in different forms: when the integrand is continuous on a closed rectangle, you may swap the integral with a limit, a derivative or another integral. That freedom turns into a powerful technique. When an integral resists every substitution, try embedding it in a family \(I(m)\), and let calculus in \(m\) do the work.
Next in the series: functions defined by improper integrals, uniform convergence, and the Gamma and Beta functions.