Multivariable Chain Rule Calculator

Find dz/dt for z = f(x, y) along a path (x(t), y(t)) with every partial and product shown.

Multivariable Chain Rule Calculator

Computes dz/dt for z = f(x, y) with x = x(t) and y = y(t).

What Is the Multivariable Chain Rule?

When a quantity z = f(x, y) depends on two variables that themselves move with time, x = x(t) and y = y(t), the multivariable chain rule gives the total rate of change of z along the path:

dz/dt = (∂f/∂x)·(dx/dt) + (∂f/∂y)·(dy/dt)

Each route by which t influences z contributes a term: t moves x, and x moves z, contributing fx·x′(t); t moves y, and y moves z, contributing fy·y′(t). The rule is the workhorse behind related rates in several variables, the derivation of directional derivatives, and, in its many-variable form, the backpropagation algorithm that trains neural networks. This calculator computes every ingredient symbolically, both partial derivatives, both path derivatives, substitutes the path to express dz/dt as a function of t alone, evaluates everything at your chosen t, and confirms the answer with a numeric derivative of the composite z(t).

How to Use the Multivariable Chain Rule Calculator

Enter the outer function f(x, y), the two path components x(t) and y(t), and the parameter value. The step list mirrors the hand computation a course expects: partials of f, derivatives of the path, the assembled sum, the substitution x → x(t), y → y(t), and the final numeric evaluation with every factor displayed. The graph draws z(t) = f(x(t), y(t)) as a curve over t with its tangent line at t₀; the tangent's slope is exactly the dz/dt just computed, closing the loop between the formula and the geometry.

Worked Example

Let f(x, y) = x²y along the unit circle x = cos t, y = sin t. The pieces are fx = 2xy, fy = x², x′ = −sin t, y′ = cos t, so

dz/dt = 2xy(−sin t) + x²(cos t) = −2 cos t sin²t + cos³t

after substituting the path. At t = 0.5 this evaluates to about 0.254. The composite z(t) = cos²t sin t could of course be differentiated directly with single-variable rules, and the answers match; the chain rule's advantage is structural, it separates how the surface tilts (the partials) from how the point moves (the velocities), and it keeps working when f is known only through data or when x and y depend on several parameters at once.

The Gradient Form and Directional Derivatives

The chain rule compresses beautifully into vector language: dz/dt = ∇f · r′(t), the dot product of the gradient with the path's velocity vector. Reading it this way explains two phenomena at once. First, motion along a level curve of f gives dz/dt = 0, so the gradient must be perpendicular to level curves, the fact underlying every contour-map argument. Second, for a unit-speed straight path the formula becomes the directional derivative Duf = ∇f · u: the chain rule is where that definition comes from. When x and y depend on two parameters instead of one, z = f(x(s, t), y(s, t)), the same template yields ∂z/∂s and ∂z/∂t separately, one tree of contributions per independent variable, and drawing the dependency tree is the reliable way to write these rules without missing a branch.

Common Mistakes to Avoid

  • Dropping one of the terms. Every path from t to z contributes. Forgetting the fyy′ term when y(t) looks simple is the classic exam error; the rule needs the complete sum.
  • Multiplying instead of adding the contributions. The two routes combine additively. fxx′ · fyy′ has the wrong units and the wrong value.
  • Evaluating partials at t instead of at the point (x(t), y(t)). fx is a function of x and y; it must be fed the path's current position. Substituting t directly into fx as if it were x is a category error the substitution step here makes visible.
  • Confusing dz/dt with ∂z/∂t. The straight d means the total derivative along the path, all routes included. Partial notation is reserved for holding the other variables fixed, which is not what happens on a moving path.
  • Ignoring domain issues along the path. ln(xy) requires xy > 0; a path can wander out of f's domain, and dz/dt only exists where the composite is defined.

Real-World Applications

Multivariable related rates are the direct application: temperature experienced by a drone, T(x, y) sampled along its flight path, changes at rate ∇T · v, the formula flight planners and storm-chasers alike use. In thermodynamics, any quantity depending on pressure and volume changes along a process curve exactly this way, and the chain rule converts between rates measured in different variable sets. Economics tracks how profit depending on price and demand shifts as both drift with time. The deepest modern application is machine learning: a loss function depends on millions of weights through layers of composed functions, and backpropagation is nothing but the multivariable chain rule organized efficiently over the dependency graph, one fxx′-style product per edge, summed over paths. The tangent-line picture on this page is the one-dimensional shadow of the gradient-descent step every training loop takes. Related tools: the single-variable chain rule calculator and the tangent plane calculator for the surface-side picture.

Frequently Asked Questions

Why does the multivariable chain rule add the two products?

Because for small Δt, the change in z splits linearly: Δz ≈ fxΔx + fyΔy, the tangent-plane approximation. Dividing by Δt and letting it shrink turns each increment into a derivative, and the sum survives: independent routes of influence contribute independently at first order.

When can I just substitute and differentiate normally instead?

Whenever f, x(t), y(t) are explicit formulas, substitution gives a one-variable function you can differentiate with ordinary rules, and the answers must agree. The chain rule wins when f is implicit, tabulated, or expensive, or when you want the structural decomposition into partials times velocities.

What is the vector form of this rule?

dz/dt = ∇f(r(t)) · r′(t): gradient dotted with velocity. It packages the rule for any number of variables at once and exposes the geometry, the rate is largest when the path runs parallel to the gradient and zero when it runs along a level curve.

How does this generalize to x and y depending on two parameters?

Treat each parameter separately: ∂z/∂s = fx·∂x/∂s + fy·∂y/∂s, and the same with t. Each independent variable gets its own chain rule over the same dependency tree, which is why drawing the tree first prevents missing terms.

Why must the partials be evaluated at (x(t), y(t))?

The surface's tilt varies from point to point, and the moving point samples the tilt where it currently is. fx and fy are local slopes; feeding them the path's position at time t is what makes the product fxx′ the honest contribution of the x-route at that instant.

What does dz/dt = 0 along a path mean geometrically?

The path is momentarily running along a level curve of f: velocity perpendicular to the gradient. If dz/dt = 0 for all t, the entire path lies in one level set, which is how conserved quantities are recognized, energy constant along trajectories is exactly this statement.

How is the chain rule related to backpropagation in neural networks?

A network is a deep composition, and the loss depends on each weight through many intermediate nodes. Backpropagation applies this rule edge by edge, multiplying local derivatives along each path and summing over paths, computed in reverse order so shared subexpressions are reused. It is the multivariable chain rule at industrial scale.

What happens at points where f is not differentiable?

The rule needs f differentiable at the path's current point (and the path differentiable at t). At kinks or cusps, like f = |x| crossed at x = 0, the tangent-plane approximation fails and dz/dt may not exist even though both one-sided rates do. The numeric check in this tool will disagree with itself there.

Does the second derivative d²z/dt² have a similar formula?

Yes, but longer: differentiating dz/dt again produces second partials through the Hessian, d²z/dt² = r′ᵗHr′ + ∇f·r″, curvature of the surface along the direction of motion plus the effect of the path's own acceleration. It underlies the second derivative test in several variables.

Why is my dz/dt different from the numeric check by a tiny amount?

The check uses a central difference with a small step, accurate to about ten significant figures for smooth functions. Discrepancies at that scale are floating-point noise; a disagreement in the leading digits, by contrast, signals a domain problem or nondifferentiable point worth investigating.