Chain Rule Calculator
Differentiate composite functions using the chain rule.
Choose outer and inner function types, enter parameters, and evaluate d/dx[f(g(x))] at any point x.
The chain rule handles derivatives of composite functions: functions of the form f(g(x)), where one function is nested inside another. If you want d/dx[sin(3x + 2)], you cannot differentiate the sine and stop there. You also need to account for the inner function 3x + 2.
The formula: d/dx[f(g(x))] = f’(g(x)) · g’(x). Read it as “derivative of the outer function evaluated at the inner function, times the derivative of the inner function.” Most calculus students forget that second factor. That trailing g’(x) is the whole point.
This calculator fixes the inner function as g(x) = ax + b. The derivative of ax + b is always just a, which keeps results clean and easy to verify by hand.
For each outer function type, the chain rule gives:
- Power f(u) = u^n: result is n(ax+b)^(n-1) · a
- Sine f(u) = sin(u): result is cos(ax+b) · a
- Cosine f(u) = cos(u): result is -sin(ax+b) · a
- Exponential f(u) = e^u: result is e^(ax+b) · a
- Natural log f(u) = ln(u): result is a/(ax+b)
The classic exam mistake: d/dx[sin(5x)] looks like cos(5x). The correct answer is 5cos(5x). That factor of 5 comes from differentiating the inner function 5x.
More than one layer. For deeper compositions like h(x) = sin(e^(x²)), apply the chain rule once per layer, working from the outside in: differentiate sin first, leaving its argument alone (cos(e^(x²))), then multiply by the derivative of e^(x²) (which itself needs another chain step: e^(x²) · 2x). Each layer contributes one factor to the product. Three layers, three factors.
Implicit differentiation is the chain rule in disguise. When you differentiate y³ with respect to x in an implicit equation, you treat y as a function of x and write d/dx[y³] = 3y² · dy/dx. The dy/dx factor isn’t optional — it’s the chain rule applied to the inner function y(x). Forget it and the whole problem collapses.
The chain rule is the most frequently applied differentiation rule in applied math and physics. Any time a function sits inside another function — raised to a power, inside a trig function, or as an exponent — you almost certainly need it. It is also exactly what backpropagation does in a neural network: gradients are pushed back through layers of nested functions, one chain-rule step per layer. Work through a few examples with different outer types until “multiply by g’(x)” becomes automatic.
Note: ln(u) requires ax + b > 0 at the chosen x. If the result shows “undefined,” adjust the coefficient or constant so the inner function stays positive.
How we build and check this calculator
This calculator runs entirely in your browser, so the numbers you enter stay on your device. The math behind it is written by hand and tested against worked examples and standard references before the page goes live.
SuperGlobalCalculator is independently built and maintained. See how we build and verify our calculators.