← Back to Calculus

Derivatives in Several Variables

When a quantity depends on several inputs, like temperature depending on position and time, partial derivatives measure how it changes as you vary one input while holding the others fixed.

Functions of several variables

A function \(z = f(x, y)\) takes two inputs and gives one output, like the height of land at position \((x, y)\) or the cost of a product depending on labour and materials. Its graph is a surface in 3D. Level curves, where \(f(x, y) = k\), are like the contour lines on a hiking map: walking along one keeps your height constant.

Limits and continuity in two variables

In two dimensions, a point can be approached from infinitely many directions, not just left and right. A limit exists only if every path gives the same value. \(\frac{xy}{x^2 + y^2}\) approaches \(0\) along the axes but \(\frac{1}{2}\) along the line \(y = x\), so its limit at the origin does not exist. Polynomials and most familiar formulas are still continuous where defined.

Partial derivatives

The partial derivative with respect to \(x\), written \(f_x\) or \(\frac{\partial f}{\partial x}\), measures the rate of change in the \(x\)-direction with \(y\) held constant. Compute it by treating \(y\) as a constant and differentiating as usual. \(f_y\) does the same in the \(y\)-direction. Geometrically, \(f_x\) is the slope of the surface when you slice it with a plane of constant \(y\).

f_x = \lim_{h\to 0}\frac{f(x+h, y) - f(x, y)}{h}

Worked example

Let \(f(x, y) = x^3y^2 + 4xy - 5y\). Treating \(y\) as a constant: \(f_x = 3x^2y^2 + 4y\). Treating \(x\) as a constant: \(f_y = 2x^3y + 4x - 5\). At the point \((1, 2)\): \(f_x = 12 + 8 = 20\) and \(f_y = 4 + 4 - 5 = 3\). So the surface rises steeply in the \(x\)-direction there and gently in the \(y\)-direction.

f_x = 3x^2y^2 + 4y,\quad f_y = 2x^3y + 4x - 5

Interpreting partial derivatives

If \(P(L, K)\) is a factory's output with labour \(L\) and capital \(K\), then \(P_L\) is the marginal product of labour: the extra output from one more worker with machinery fixed. If \(T(x, t)\) is temperature along a rod, \(T_t\) is how fast a given spot is heating up, and \(T_x\) is how temperature varies along the rod at one instant.

Higher-order partial derivatives

Differentiate again to get second partials: \(f_{xx}\), \(f_{yy}\), and the mixed partials \(f_{xy}\) and \(f_{yx}\). Clairaut's theorem says that for functions with continuous second partials, the mixed partials are equal: \(f_{xy} = f_{yx}\). For our example, \(f_{xy} = 6x^2y + 4\) whichever order you use. Partial differential equations, such as the heat and wave equations, are built from these.

f_{xy} = f_{yx}

Tangent planes and linear approximation

Near a point \((a, b)\), a smooth surface looks like its tangent plane: \(z = f(a, b) + f_x(a, b)(x - a) + f_y(a, b)(y - b)\). This gives the linear approximation, the two-variable version of the tangent line. It is how engineers estimate how small changes in several inputs affect an output.

z = f(a,b) + f_x(a,b)(x-a) + f_y(a,b)(y-b)

The multivariable chain rule

If \(z = f(x, y)\) and both \(x\) and \(y\) depend on \(t\), then \(\frac{dz}{dt} = f_x\frac{dx}{dt} + f_y\frac{dy}{dt}\). Each path from \(t\) to \(z\) contributes a product of rates. If a hiker moves across terrain, her rate of climbing is the slope in each direction times her speed in that direction, added together.

\frac{dz}{dt} = \frac{\partial z}{\partial x}\frac{dx}{dt} + \frac{\partial z}{\partial y}\frac{dy}{dt}

Critical points and optimization

Local maxima and minima of \(f(x, y)\) occur where both partials are zero (or undefined). Classify them with \(D = f_{xx}f_{yy} - (f_{xy})^2\): if \(D > 0\) and \(f_{xx} > 0\), a local minimum; if \(D > 0\) and \(f_{xx} < 0\), a local maximum; if \(D < 0\), a saddle point, like the middle of a horse's saddle. For \(f = x^2 + y^2\), \(D = 4 > 0\) and \(f_{xx} = 2\), so the origin is a minimum.

D = f_{xx}f_{yy} - f_{xy}^2

Common mistakes

Differentiating the other variable instead of treating it as a constant. Forgetting that terms with only the other variable have partial derivative \(0\). Checking only two paths and concluding that a limit exists. Mixing up the conditions in the second derivative test.

Try it yourself

Find \(f_x\) and \(f_y\) for \(f(x, y) = e^{xy}\). Answer: \(f_x = ye^{xy}\) and \(f_y = xe^{xy}\), using the chain rule with the other variable held constant. Then classify the critical point of \(f = x^2 - y^2\). Answer: \(D = (2)(-2) - 0 = -4 < 0\), a saddle point at the origin.

Key takeaways

Partial derivatives measure change in one variable with the others fixed: differentiate normally, treating the others as constants. Mixed partials are usually equal. Tangent planes give linear approximations. The chain rule adds a term for each path. Critical points are classified with \(D = f_{xx}f_{yy} - f_{xy}^2\).

Flashcard

z = f(x, y)

Function of two variables

Its graph is a surface.

Check your understanding

For f(x, y) = 4x^2y + y^3, what is the partial derivative with respect to x?

Take the unit quiz

← Previous lesson Next lesson →