← Back to Calculus

Chain rule and implicit forms

Most real formulas are functions inside functions. The chain rule differentiates them, and implicit differentiation handles curves that are not even solved for y.

Functions inside functions

A composite function applies one function to the output of another: in \(\sin(3x^2)\), the inside function is \(3x^2\) and the outside function is \(\sin\). Recognising the layers is the first step. Ask yourself 'what is the last operation I would do if I computed this on a calculator?' That last operation is the outside function.

The chain rule

Differentiate the outside function, keeping the inside unchanged, then multiply by the derivative of the inside. In Leibniz notation with \(y = f(u)\) and \(u = g(x)\), the rule reads \(\frac{dy}{dx} = \frac{dy}{du}\cdot\frac{du}{dx}\), as if the \(du\) cancels. Rates multiply: if \(y\) changes 3 times as fast as \(u\), and \(u\) changes 2 times as fast as \(x\), then \(y\) changes 6 times as fast as \(x\).

\frac{d}{dx} f(g(x)) = f'(g(x))\, g'(x)

Worked example: a power of a polynomial

Differentiate \(y = (2x^3 + 1)^5\). Outside: \(u^5\), derivative \(5u^4\). Inside: \(u = 2x^3 + 1\), derivative \(6x^2\). Multiply: \(y' = 5(2x^3 + 1)^4 \cdot 6x^2 = 30x^2(2x^3 + 1)^4\). Expanding \((2x^3+1)^5\) first would work, but it would take far longer.

\frac{d}{dx}(2x^3+1)^5 = 30x^2(2x^3+1)^4

Worked example: exponentials and logs

The chain rule gives two patterns you will use constantly: \(\frac{d}{dx}e^{g(x)} = e^{g(x)} g'(x)\) and \(\frac{d}{dx}\ln g(x) = \frac{g'(x)}{g(x)}\). For instance, \(\frac{d}{dx}e^{-x^2} = -2x e^{-x^2}\), and \(\frac{d}{dx}\ln(x^2 + 4) = \frac{2x}{x^2 + 4}\).

Worked example: trig compositions

\(\frac{d}{dx}\sin(5x) = 5\cos(5x)\). \(\frac{d}{dx}\cos^3 x\): write it as \((\cos x)^3\), so the derivative is \(3\cos^2 x \cdot (-\sin x) = -3\cos^2 x \sin x\). Writing powers of trig functions with explicit parentheses helps you see the layers.

Several layers

For three or more layers, multiply a derivative for each layer, working from the outside in. For \(y = \sqrt{\sin(x^2)}\): the square root gives \(\frac{1}{2\sqrt{\sin(x^2)}}\), the sine gives \(\cos(x^2)\), and the inside gives \(2x\). So \(y' = \frac{x\cos(x^2)}{\sqrt{\sin(x^2)}}\). Never stop after the outermost layer.

Combining the chain rule with other rules

Real problems mix rules. For \(y = x^2 \sin(4x)\), use the product rule, and inside it the chain rule: \(y' = 2x\sin(4x) + x^2 \cdot 4\cos(4x)\). Decide the overall structure first (is it a product, a quotient, or a composition?), then handle each piece.

Implicit differentiation

Some curves are given by equations like \(x^2 + y^2 = 25\) that are not solved for \(y\). Treat \(y\) as a function of \(x\) and differentiate both sides, applying the chain rule to every term with \(y\): the derivative of \(y^2\) is \(2y\frac{dy}{dx}\). Then solve the resulting equation for \(\frac{dy}{dx}\).

Worked example: a circle

Differentiate \(x^2 + y^2 = 25\): \(2x + 2y\frac{dy}{dx} = 0\), so \(\frac{dy}{dx} = -\frac{x}{y}\). At \((3, 4)\), the slope is \(-\frac{3}{4}\). This matches geometry: the radius to \((3,4)\) has slope \(\frac{4}{3}\), and the tangent to a circle is perpendicular to the radius.

\frac{dy}{dx} = -\frac{x}{y}

Worked example: a product with y

For \(x^3 + xy + y^3 = 7\): differentiating gives \(3x^2 + (y + x\frac{dy}{dx}) + 3y^2\frac{dy}{dx} = 0\), using the product rule on \(xy\). Collect the \(\frac{dy}{dx}\) terms: \(\frac{dy}{dx}(x + 3y^2) = -3x^2 - y\), so \(\frac{dy}{dx} = \frac{-3x^2 - y}{x + 3y^2}\).

Derivatives of inverse functions

Implicit differentiation gives the derivatives of inverse functions. If \(y = \arcsin x\), then \(\sin y = x\). Differentiating: \(\cos y \frac{dy}{dx} = 1\), so \(\frac{dy}{dx} = \frac{1}{\cos y} = \frac{1}{\sqrt{1 - x^2}}\). Similarly \(\frac{d}{dx}\arctan x = \frac{1}{1 + x^2}\). Logarithmic differentiation, taking \(\ln\) of both sides first, handles expressions like \(x^x\).

\frac{d}{dx}\arctan x = \frac{1}{1+x^2}

Common mistakes

Forgetting the inside derivative, for example writing \(\frac{d}{dx}\sin(3x) = \cos(3x)\). Changing the inside function when differentiating the outside. Forgetting \(\frac{dy}{dx}\) on \(y\) terms in implicit differentiation. Treating \(xy\) as if only one factor varies, rather than using the product rule.

Try it yourself

Differentiate \(y = e^{\sin x}\). Answer: \(y' = e^{\sin x}\cos x\). Then find \(\frac{dy}{dx}\) for \(y^2 = x^3\). Answer: \(2y\frac{dy}{dx} = 3x^2\), so \(\frac{dy}{dx} = \frac{3x^2}{2y}\).

Key takeaways

Chain rule: derivative of the outside (inside unchanged) times derivative of the inside, repeated for every layer. Key patterns: \(e^{g}g'\), \(\frac{g'}{g}\), \(n g^{n-1} g'\). Implicit differentiation treats \(y\) as a function of \(x\) and attaches \(\frac{dy}{dx}\) to every \(y\) term. It also gives derivatives of inverse functions.

Flashcard

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

Chain rule

Outside derivative (inside unchanged) times inside derivative.

Check your understanding

Differentiate y = (x^2 + 1)^4.

Take the unit quiz

← Previous lesson Next lesson →