Skip to main content

The chain rule: both the outer and inner derivatives

2026-10-22 huynhvietkhanh Comments: 0

Differentiate a composite function through every layer, retain domain conditions, and justify the chain rule without dividing by an inner increment.

High schoolFunctions, Graphs & Tangents / Sequences, Limits & Derivatives

Content updated: October 22, 2026

When one function is nested inside another, differentiation must pass through both layers. Retain both the factor from the outer layer and the derivative of the inner layer; omitting either changes the result.

Objectives: identify the function layers; apply the rule with all hypotheses and domain conditions; handle several layers without losing factors.

Prerequisites: derivatives at a point, basic derivative formulas, and limits of products.

On this page: Definition · Method · Examples · Practice · Further learning

1. Statement at a point

Let $y(x)=g(u(x))$. Suppose $u$ is differentiable at $x_0$, $g$ is differentiable at $u_0=u(x_0)$, and the composite is defined in a neighborhood of $x_0$. Then the composite is differentiable at $x_0$, and

$$y'(x_0)=g'(u_0)u'(x_0).$$

On a domain where the hypotheses hold at every point, write $y'(x)=g'(u(x))u'(x)$. Evaluate the outer derivative at the inner function's value. The two symbols $g,u$ distinguish differentiation with respect to the outer argument from differentiation with respect to $x$.

The rule states a sufficient condition. If the outer function is not differentiable at the relevant value, do not apply the formula automatically; the composite may still be differentiable and should be examined directly.

2. Why the formula holds and how to apply it

Differentiability of $g$ at $u_0$ allows us to write $g(u_0+h)-g(u_0)=g'(u_0)h+h\varepsilon(h)$, where $\varepsilon(h)\to0$ as $h\to0$, and we may set $\varepsilon(0)=0$. With $\Delta u=u(x_0+t)-u_0$, divide the composite's increment by $t\ne0$:

$$\frac{g(u(x_0+t))-g(u_0)}t=\bigl(g'(u_0)+\varepsilon(\Delta u)\bigr)\frac{\Delta u}t.$$

Since $u$ is differentiable, it is continuous at $x_0$, so $\Delta u\to0$; also $\Delta u/t\to u'(x_0)$. Taking limits proves the formula. The argument does not divide by $\Delta u$, so it remains valid when the inner function sometimes has the same value or has derivative 0.

In a calculation, specify $u(x)$ and $g(t)$; calculate $u'(x)$ and $g'(t)$ separately; substitute $t=u(x)$ and multiply. For three layers, apply the rule twice and check every domain. For example, if $u>0$ and $u$ is differentiable, $(\sqrt u)'=u'/(2\sqrt u)$; the case $u=0$ requires a separate examination.

$$(u^n)'=nu^{n-1}u'\ (n\ge1),\quad (\sin u)'=(\cos u)u',\quad(\cos u)'=-(\sin u)u'.$$
$$(1/u)'=-u'/u^2\ (u\ne0),\qquad(\tan u)'=u'/\cos^2u\ (\cos u\ne0).$$

In the power formula above, $n$ is a positive integer; the trigonometric formulas use radians. Retain the inner function's conditions in addition to the conditions stated for the outer function.

3. Worked examples

Example 1. Sine of a polynomial

Let $y=\sin(x^2+1)$. Set $u=x^2+1$ and $g(t)=\sin t$. Both are differentiable on $\mathbb R$, with $u'=2x$ and $g'(t)=\cos t$. Therefore $y'=2x\cos(x^2+1)$. Writing only the cosine of the argument would omit the inner derivative $2x$.

Example 2. A power of a polynomial

Let $y=(x^3-2)^{10}$. Set $u=x^3-2$ and $g(t)=t^{10}$. Then $u'=3x^2$ and $g'(t)=10t^9$. Hence

$$y'=10(x^3-2)^9\cdot3x^2=30x^2(x^3-2)^9.$$

The equality holds on $\mathbb R$, including where $x^3-2=0$, since the exponent is a positive integer. The factor 10 comes from the outer function and $3x^2$ from the inner function; both are present.

Example 3. A square root with an always-positive argument

For $y=\sqrt{x^2+1}$, the inner function is always greater than $0$. The rule implies $y'=2x/[2\sqrt{x^2+1}]=x/\sqrt{x^2+1}$ on $\mathbb R$. At $0$, the derivative is 0; there is no reason to exclude that input, since the square-root argument is 1, rather than $0$.

4. Practice

  1. Differentiate $\sin(3x)$.
  2. Differentiate $\sqrt{2x-1}$ and state the domain where the formula applies.
  3. Differentiate $\cos^2(5x)$.
Hints and answers
  1. $y'=3\cos(3x)$ on $\mathbb R$.
  2. The function is defined for $x\ge1/2$; the finite derivative formula from the chain rule applies for $x>1/2$ and gives $y'=1/\sqrt{2x-1}$. At the domain endpoint, do not substitute into the formula with denominator 0.
  3. The three layers are the square, cosine, and $5x$. The derivative on $\mathbb R$ is
    $$\begin{aligned}y'&=2\cos(5x)(-\sin(5x))\cdot5,\\&=-10\cos(5x)\sin(5x).\end{aligned}$$

5. Common mistakes

Retain the factor from the outer derivative, especially the factor 10 in the tenth-power rule. Do not omit the derivative of the argument. Do not replace the composite's domain by the domain of a simplified formula without checking. In the proof, do not divide by the inner increment, which may be 0 at nearby points.

6. Further learning

Derivatives (English lesson) · Derivatives of basic functions (English lesson) · Derivatives of exponential and logarithmic functions (English lesson) · The tangent line at a point (English lesson).

Original exercise material on Scribd.

Leave a Reply

Your email address will not be published. Required fields are marked *