Total Differential Calculator

Form dz = fx dx + fy dy, estimate the change in f, and compare it with the true change.

Total Differential Calculator

What Is the Total Differential?

The total differential of a function z = f(x, y) packages its sensitivity to small changes in both inputs into one linear expression:

dz = (∂f/∂x) dx + (∂f/∂y) dy = fx dx + fy dy

Given a base point (x₀, y₀) and small displacements dx and dy, the differential dz estimates the resulting change in z using only the partial derivatives at the base point. Geometrically it is the change predicted by the tangent plane: instead of walking on the curved surface, you walk on the flat plane that touches it, and for small steps the two walks nearly agree. This is linear approximation in two variables, the foundation of error propagation in laboratory science and of sensitivity analysis in engineering and economics. The calculator computes both partials symbolically, builds dz, evaluates it for your displacements, and then compares against the exact change Δz = f(x₀+dx, y₀+dy) − f(x₀, y₀) so you can see the quality of the approximation directly.

How to Use the Total Differential Calculator

Enter f(x, y), the base point, and the two increments dx and dy (either sign is allowed). The steps display the symbolic differential with both partials, the numeric values fx(x₀, y₀) and fy(x₀, y₀), the assembled estimate dz, the exact change Δz, and the approximation error |Δz − dz|. The graph slices the surface along the displacement direction, showing the true curve against the straight tangent-line prediction, with markers at the base and displaced points; the gap between curve and line at the second marker is exactly the error being reported.

Worked Example

Take f(x, y) = x²y³ at (2, 1) with dx = 0.1 and dy = −0.05. The partials are fx = 2xy³ and fy = 3x²y², giving fx(2, 1) = 4 and fy(2, 1) = 12. Then

dz = 4(0.1) + 12(−0.05) = 0.4 − 0.6 = −0.2

The exact change is f(2.1, 0.95) − f(2, 1) = 3.7815… − 4 = −0.2185, so the differential is off by about 0.018, roughly 8% of the change, and the error would shrink four-fold if both increments were halved. Notice the practical reading: even though x moved twice as far as y, the y-change dominated the outcome because fy = 12 dwarfs fx = 4. Ranking inputs by their partial derivatives is the essence of sensitivity analysis.

Error Propagation: The Differential's Day Job

Laboratory measurements always carry uncertainty, and the total differential is how uncertainties travel through formulas. If the inputs of z = f(x, y) are uncertain by ±δx and ±δy, the worst-case propagated error is |fx|δx + |fy|δy, since errors might conspire in the same direction. For independent random errors, statisticians instead combine in quadrature, √((fxδx)² + (fyδy)²), but the ingredients are the same two partials this tool computes. The area chip makes it concrete: a 10 × 5 rectangle measured with half-unit errors in each side has dA = 5(0.5) + 10(0.5) = 7.5 square units of possible area error, with the longer side's uncertainty mattering twice as much, exactly what dA = y dx + x dy predicts.

Differentials, Tangent Planes, and Differentiability

The statement Δz ≈ fxdx + fydy is precisely the statement that the tangent plane is a good local model of the surface, and its guaranteed accuracy is what "differentiable" means for functions of several variables: the error must vanish faster than the displacement itself. When the approximation is recast with dx = x − x₀ and dy = y − y₀, it becomes the linearization L(x, y) = f(x₀, y₀) + fx·(x − x₀) + fy·(y − y₀), the two-variable sibling of the linear approximation. The differential is also the object that becomes exact in the limit, which is why thermodynamics writes relations like dU = T dS − P dV between differentials and treats them with full algebraic confidence.

Common Mistakes to Avoid

  • Confusing dz with Δz. dz is the tangent-plane prediction, Δz the true change. They agree only in the limit; reporting dz as exact for large displacements misstates the function.
  • Evaluating partials at the wrong point. Both fx and fy must be computed at the base point (x₀, y₀), not at the displaced point or symbolically left unevaluated.
  • Forgetting signs in error analysis. For worst-case error bounds, take absolute values of the partials; otherwise opposite-sign contributions can cancel on paper while real errors accumulate.
  • Using large increments. The error of the differential grows quadratically with step size. If dx and dy are not small relative to the curvature of f, compute f directly instead of linearizing.
  • Treating dx and dy as always positive. Displacements are signed; a decrease in y is dy < 0, and the sign carries through dz. The default example deliberately mixes signs for this reason.

Real-World Applications

Every quantitative laboratory course uses total differentials to propagate measurement uncertainty through derived quantities: density from mass and volume, resistance from voltage and current, g from pendulum length and period. Engineering tolerance analysis asks how machining errors in individual dimensions stack into error of an assembly. In economics, output Q(K, L) responds to small changes in capital and labor by dQ = QKdK + QLdL, the marginal-product decomposition. Thermodynamics is built on total differentials of state functions, with Maxwell's relations arising from their exactness. For the underlying slopes themselves, see the partial derivative calculator, and for change along a specific direction, the directional derivative calculator.

Frequently Asked Questions

What exactly does the total differential estimate?

The change in f caused by moving from (x₀, y₀) to (x₀+dx, y₀+dy), computed as if the surface were its tangent plane. It is a first-order estimate: exact for linear functions, and accurate to within a term proportional to dx², dx·dy, dy² otherwise.

How is dz different from the derivative?

A derivative is a rate; the differential is a rate times a displacement, an actual (approximate) amount of change. dz depends on three things: the point, through the partials, and the two increments you choose. Change any of them and dz changes.

Why does the approximation error shrink quadratically?

Taylor's theorem in two variables: Δz = fxdx + fydy + ½(fxxdx² + 2fxydxdy + fyydy²) + …. The differential captures the linear terms, so the leading error is the quadratic form in the second partials. Halve both increments and the error drops by four.

Which input matters more to my function?

Compare |fx| and |fy| at your operating point, scaled by the realistic sizes of dx and dy. The products |fxdx| and |fydy| are the contributions; the larger one identifies the input whose measurement or control deserves the most attention.

How do I use this for measurement uncertainty?

Set dx and dy to the instruments' uncertainty magnitudes and add the absolute contributions: δz ≈ |fx|δx + |fy|δy for a guaranteed bound, or combine in quadrature for independent random errors. The partials come straight from this tool's steps.

What is the relationship to the tangent plane?

Identical content, different packaging: the tangent plane at (x₀, y₀) is z = f(x₀, y₀) + fx·(x−x₀) + fy·(y−y₀), and dz is the plane's rise over the run (dx, dy). Differentiability means the plane hugs the surface to first order, which is what licenses the estimate.

Does the idea extend to three or more variables?

Directly: dw = fxdx + fydy + fzdz for w = f(x, y, z), one term per input, and so on in any dimension. Error propagation formulas in physics labs routinely run over four or five measured quantities with exactly this template.

When is an expression M dx + N dy actually a total differential?

When My = Nx on a simply connected region; then some f has fx = M and fy = N. That test is the heart of exact differential equations and of identifying state functions in thermodynamics.

Why did my dz come out negative while Δz is also negative but different?

Both record a decrease; they differ by the curvature correction the linear model ignores. On a concave-down slice the true drop exceeds the predicted one, on concave-up it falls short. The plotted curve versus the dashed line shows which situation you are in at a glance.

Is dz ever exact rather than approximate?

For affine functions f = ax + by + c, yes: the surface is its own tangent plane and Δz = dz for any step size. For everything else exactness holds only in the infinitesimal limit, which is precisely how differentials are used in integrals and in thermodynamic identities.