Chain Rule Calculator

Differentiate a composite function \(f(x)\) using the chain rule. Enter your function and press Calculate.

Use x as the variable. Allowed: + − * / ^, exp, ln/log, sin, cos, tan, sqrt, etc. Trig uses radians.

Equation Preview

Your preview will appear here…

Helping notes

\( \text{Chain rule: If } F(x)=f(g(x)) \text{ then } F'(x)=f'(g(x))\,g'(x). \)

\( \text{Common patterns: } \sin(u),\, \cos(u),\, \exp(u),\, \ln(u),\, u^n \text{ with } u=u(x). \)

\( \text{Tip: Rewrite with } \exp,\,\ln,\,\sqrt{\vphantom{A}} \text{ or powers to expose the inner function } u(x). \)

Results

Derivative (raw)
Derivative (simplified)
Chain Rule Decomposition

What is a Chain Rule Calculator?

A Chain Rule Calculator is a calculus tool that computes derivatives of composite functions—expressions built by substituting one function into another. It automates the chain rule, the fundamental rule connecting outer and inner derivatives. Whether your function has a single layer \(f(g(x))\) or many nested layers \(f(g(h(\cdots(x))))\), the calculator finds each inner derivative and multiplies them in the correct order. It also supports combinations with product and quotient rules, implicit differentiation (when a variable depends on another through an equation), and multivariable compositions where variables themselves depend on a parameter. Results are shown step-by-step in readable LaTeX and include optional numeric evaluation at specified points.

About the Chain Rule Calculator

The calculator parses your input, builds a composition tree, and applies differentiation rules in a disciplined sequence: outer derivative first, then multiply by the derivative of each inner function. For expressions like \((3x^2+1)^5 \sin(x^3)\), it simultaneously applies product and chain rules. For rational forms, it blends quotient and chain rules. In multivariable cases, it uses gradient–Jacobian formulations to propagate derivatives through dependent variables, and it handles vector-valued outputs as well. When implicit relationships \(F(x,y)=0\) are provided, it returns \(\dfrac{dy}{dx}\) via partial derivatives. The tool reports algebraic simplifications, domain notes (e.g., logs requiring positive arguments), and, when helpful, factored forms to make structure clear.

How to Use this Chain Rule Calculator

  1. Enter your function (e.g., (3x^2+1)^5, sin(x^3), or a system like F(x,y)=0 for implicit differentiation).
  2. Select mode: Symbolic derivative or Value at x=a to evaluate the derivative numerically.
  3. (Optional) For multivariable paths, define dependencies such as \(x(t), y(t)\) to compute \(\dfrac{d}{dt}f(x(t),y(t))\).
  4. Review the step-by-step differentiation tree and the simplified final derivative.
  5. Copy the LaTeX result or the simplified expression for use in notes and assignments.

Core Formulas (LaTeX)

Single-variable chain rule: \[ \frac{d}{dx}f(g(x)) = f'\!\big(g(x)\big)\cdot g'(x). \]

Nested composition: \[ \frac{d}{dx}f\!\big(g(h(x))\big)=f'\!\big(g(h(x))\big)\cdot g'\!\big(h(x)\big)\cdot h'(x). \]

Multivariable (scalar \(f(x,y)\) with \(x=x(t), y=y(t)\)): \[ \frac{d}{dt}f(x(t),y(t)) = f_x\,\frac{dx}{dt} + f_y\,\frac{dy}{dt}. \]

Vector form (gradient–Jacobian): \[ \frac{d}{dt}\,f(\mathbf{u}(t)) = \nabla f(\mathbf{u}(t))^\top \mathbf{u}'(t). \]

Implicit differentiation (from \(F(x,y)=0\)): \[ \frac{dy}{dx} = -\,\frac{F_x}{F_y}\quad (\text{when }F_y\neq0). \]

Related rules: \[ (uv)'=u'v+uv',\qquad \left(\frac{u}{v}\right)'=\frac{u'v-uv'}{v^2}. \]

Examples (Illustrative)

Example 1 — Power inside a power

\(y=(3x^2+1)^5\). Let \(f(u)=u^5,\ g(x)=3x^2+1\). Then \(y'=5(3x^2+1)^4\cdot(6x)=30x(3x^2+1)^4.\)

Example 2 — Trig of a power

\(y=\sin(x^3)\). \(y'=\cos(x^3)\cdot 3x^2.\)

Example 3 — Product + chain

\(y=(x^2+1)^3\ln(5x-2)\). Use product rule with chain on each factor: \[ y' = 3(x^2+1)^2(2x)\ln(5x-2) + (x^2+1)^3\cdot \frac{5}{5x-2}. \]

Example 4 — Multivariable composition

\(f(x,y)=e^{xy}\), with \(x=t^2,\ y=\sin t\). \[ \frac{d}{dt}f = e^{xy}\left(y\cdot\frac{dx}{dt} + x\cdot\frac{dy}{dt}\right) = e^{t^2\sin t}\left(\sin t\cdot 2t + t^2\cos t\right). \]

Example 5 — Implicit differentiation

\(F(x,y)=x^2+y^2-1=0\Rightarrow \dfrac{dy}{dx}=-\dfrac{2x}{2y}=-\dfrac{x}{y}.\)

FAQs

When should I use the chain rule?

Whenever a function is composed with another (e.g., \(f(g(x))\)); it’s essential for powers of inner functions and trig of polynomials.

How is the chain rule different from the product rule?

Chain handles composition; product handles multiplication. Many problems require both rules together.

What are common mistakes with the chain rule?

Forgetting to multiply by the inner derivative or mixing the order of nested derivatives.

Does the chain rule extend to several variables?

Yes—use \(f_x, f_y,\dots\) with variable dependencies; equivalently \(\nabla f\) dotted with the derivative of the input vector.

Can I use the chain rule for inverse functions?

Yes. If \(y=g(x)\) is invertible, then \((g^{-1})'(y)=1/g'(x)\) with \(y=g(x)\).

How do I apply chain rule in implicit differentiation?

Differentiate both sides of \(F(x,y)=0\), treat \(y\) as \(y(x)\), collect \(dy/dx\), and solve.

More Math & Algebra Calculators