Tutorials › Calculus I › Deriving the Chain Rule for Variable Limits

The Fundamental Theorem of Calculus · Tutorial 1091 of 1495

Deriving the Chain Rule for Variable Limits

Learn why a moving upper endpoint contributes the integrand’s value there multiplied by the endpoint’s rate of change.

Intermediate 8 min read

What You'll Learn

  • State the hypotheses for differentiating an integral with a variable upper endpoint.
  • Derive the formula using the Fundamental Theorem of Calculus and the Chain Rule.
  • Interpret the endpoint derivative as a necessary chain factor.
  • Apply the formula to trigonometric and exponential endpoints.
  • Detect and correct the error of omitting the endpoint’s derivative.

Why a Moving Endpoint Changes the Derivative

A definite integral can describe accumulated quantity. If the integrand \(f(t)\) is a rate and the upper endpoint is fixed, changing the input to an accumulation function changes the endpoint at which we measure that accumulation.

When the upper endpoint itself depends on the input \(x\), there are two linked changes: the integral responds to the value of the integrand at the endpoint, and the endpoint moves as \(x\) changes. The derivative must account for both.

The resulting rule combines the first part of the Fundamental Theorem of Calculus with the Chain Rule. Its key feature is a factor that is easy to overlook: the derivative of the moving endpoint.

Set Up the Variable-Upper-Limit Integral

Fix a number \(a\), and define an accumulation function with a fixed starting point by

$$ H(u)=\int_a^u f(t)\,dt. $$

Now let \(g\) be a differentiable function and consider

$$ F(x)=\int_a^{g(x)} f(t)\,dt. $$

The variable of integration \(t\) is a placeholder: it indicates the input at which the integrand is evaluated throughout the interval of integration. The upper endpoint is \(g(x)\), so this expression is exactly \(H(g(x))\).

Theorem: Suppose \(f\) is continuous on an interval containing \(a\) and all values \(g(x)\) for \(x\) in a neighborhood of \(x_0\). Suppose also that \(g\) is differentiable at \(x_0\). Then \(F(x)=\int_a^{g(x)} f(t)\,dt\) is differentiable at \(x_0\), and $$ F'(x_0)=f(g(x_0))\,g'(x_0). $$ Where these conditions hold at every point of an interval, the formula is $$ \frac{d}{dx}\int_a^{g(x)} f(t)\,dt=f(g(x))\,g'(x). $$

Continuity of \(f\) ensures that the first part of the Fundamental Theorem of Calculus applies to \(H\): \(H'(u)=f(u)\). Differentiability of \(g\) makes the Chain Rule applicable to \(H(g(x))\). These are the conditions that justify the formula; it is not enough simply to substitute the moving endpoint into the integrand.

Derivation from the Fundamental Theorem and Chain Rule

We can derive the rule by writing the variable-endpoint integral as a composition. By definition of \(H\),

$$ F(x)=H(g(x)). $$

Because \(f\) is continuous, the first part of the Fundamental Theorem of Calculus gives \(H'(u)=f(u)\). Since \(g\) is differentiable, the Chain Rule for a composition gives

$$ F'(x) =H'(g(x))\,g'(x) =f(g(x))\,g'(x). $$

This establishes the formula. The expression \(f(g(x))\) is the integrand evaluated at the current endpoint; \(g'(x)\) measures how quickly that endpoint changes. Both belong in the derivative.

Why the chain factor appears: The accumulation function first changes with its endpoint at rate \(f(u)\). But in \(F(x)=H(g(x))\), that endpoint is \(g(x)\), not \(x\) itself. The Chain Rule multiplies the rate of accumulation by the rate \(g'(x)\) at which the endpoint moves.

Worked Examples

Worked Example: A Sine Upper Endpoint

Differentiate

$$ F(x)=\int_0^{\sin x}(t^2+2t)\,dt. $$

Here \(f(t)=t^2+2t\), which is continuous for every real \(t\), and \(g(x)=\sin x\), which is differentiable for every real \(x\). The theorem therefore applies for every \(x\). Evaluate the integrand at the upper endpoint and multiply by the derivative of that endpoint:

$$ F'(x) =\big((\sin x)^2+2\sin x\big)\cos x. $$

To check, an antiderivative of \(t^2+2t\) is \(\frac{t^3}{3}+t^2\). Thus

$$ F(x)=\frac{\sin^3 x}{3}+\sin^2 x. $$

Differentiating this expression gives

$$ F'(x) =\sin^2 x\cos x+2\sin x\cos x =\big((\sin x)^2+2\sin x\big)\cos x, $$

which agrees with the variable-limit formula.

Worked Example: An Exponential Upper Endpoint

Differentiate

$$ G(x)=\int_1^{e^x}\frac{1}{t}\,dt. $$

The integrand \(f(t)=1/t\) is continuous for \(t>0\), and the endpoint \(g(x)=e^x\) is positive for every real \(x\). Thus the integrand is continuous on an interval containing the fixed endpoint \(1\) and the moving endpoint \(e^x\); the hypotheses hold. Applying the formula gives

$$ G'(x)=\frac{1}{e^x}\,e^x=1. $$

For a check, evaluating the integral gives \(G(x)=\ln(e^x)-\ln(1)=x\). Differentiating this expression gives \(G'(x)=1\), as required.

Worked Example: A Decreasing Upper Endpoint

For \(-\frac{\pi}{2}<x<\frac{\pi}{2}\), differentiate

$$ K(x)=\int_0^{\cos x}(2t+1)\,dt. $$

The integrand is continuous, and \(g(x)=\cos x\) is differentiable. The theorem gives

$$ K'(x)=(2\cos x+1)(-\sin x). $$

The negative factor comes from \(g'(x)=-\sin x\). To check, evaluate the integral using the antiderivative \(t^2+t\):

$$ K(x)=\cos^2 x+\cos x. $$

Its derivative is

$$ K'(x)=-2\cos x\sin x-\sin x =-(2\cos x+1)\sin x, $$

which is the same result. The interval specified here ensures \(\cos x>0\); the formula itself requires continuity of the integrand along the relevant interval, not that the upper endpoint be increasing.

The Difference-Quotient View

The composition proof is concise, but the difference quotient makes the role of the endpoint rate especially visible. Fix \(x_0\), and write \(u_0=g(x_0)\). For a small nonzero \(h\), the change in the integral is

$$ F(x_0+h)-F(x_0) =\int_{u_0}^{g(x_0+h)} f(t)\,dt. $$

Set \(\Delta u=g(x_0+h)-u_0\). When \(\Delta u\ne 0\), divide the change in the integral by the change in \(x\) and factor the quotient:

$$ \frac{F(x_0+h)-F(x_0)}{h} = \left( \frac{1}{\Delta u} \int_{u_0}^{u_0+\Delta u} f(t)\,dt \right) \left( \frac{\Delta u}{h} \right). $$

As \(h\) approaches zero, differentiability of \(g\) implies \(\Delta u\) approaches zero and \(\Delta u/h\) approaches \(g'(x_0)\). Continuity of \(f\) at \(u_0\) implies that the average value in parentheses approaches \(f(u_0)\): over a sufficiently short interval near \(u_0\), the values of \(f(t)\) are as close as desired to \(f(u_0)\). Therefore the product approaches \(f(u_0)g'(x_0)\), which is \(f(g(x_0))g'(x_0)\).

If \(\Delta u=0\) for some values of \(h\), the integral change is zero for those values, and the displayed factorization is unavailable for that particular \(h\). The composition proof above already establishes the derivative under the stated hypotheses, including such cases. The difference-quotient explanation describes the limiting mechanism when the endpoint changes.

A Common Mistake: Forgetting the Endpoint Derivative

A frequent error is to substitute the endpoint into the integrand but omit the Chain Rule factor. For example, an incorrect calculation for the first example might be

$$ \frac{d}{dx}\int_0^{\sin x}(t^2+2t)\,dt \overset{\text{wrong}}{=}(\sin x)^2+2\sin x. $$

This treats \(\sin x\) as if it were the variable endpoint itself changing at rate \(1\). But its rate of change is \(\cos x\). The corrected calculation is

$$ \frac{d}{dx}\int_0^{\sin x}(t^2+2t)\,dt =\big((\sin x)^2+2\sin x\big)\cos x. $$

A reliable check is to differentiate the endpoint separately before applying the formula. In general, for upper endpoint \(g(x)\), write down both \(f(g(x))\) and \(g'(x)\), then multiply them.

When the Rule Is Useful

The formula is useful whenever an accumulated quantity is measured up to a boundary that changes with the input. In an application, \(f(g(x))\) describes the rate at the current boundary, while \(g'(x)\) describes how quickly that boundary is moving. Their product is the instantaneous rate of change of the accumulated quantity with respect to \(x\).

It also distinguishes two different kinds of dependence. The integrand may vary across the integration variable \(t\), while the input \(x\) affects the integral through the upper endpoint. Keeping these roles separate helps prevent errors: first evaluate \(f\) at \(g(x)\), then multiply by the derivative of \(g\).

Check Your Understanding

For each question, identify the integrand and the moving endpoint before applying the rule.

  1. State the continuity and differentiability conditions used in the variable-upper-limit formula.
  2. Differentiate \(\int_0^{\cos x} (t+3)\,dt\).
  3. For \(P(x)=\int_2^{x^2+1} f(t)\,dt\), with \(f\) continuous, write \(P'(x)\) in terms of \(f\) and \(x\).
  4. In the formula, what does the factor \(g'(x)\) represent?
  5. Explain why \(\frac{d}{dx}\int_a^{g(x)}f(t)\,dt=f(g(x))\) is generally missing a necessary factor.

Test yourself: Calculus I final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon