MathsCalculus

Partial Derivative
calculator.

Find each partial derivative, the gradient and the Hessian of f at your point.

How it's worked out

A partial derivative tells you how f changes when one input moves and the others stay put. To find one, you treat every other variable as a fixed number and use the ordinary rules. For x2yx^2 y, the y is just a coefficient when you differentiate by x, so you get 2xy2xy.

∂f∂x(a,b)\displaystyle \frac{\partial f}{\partial x}(a, b)=limh→0⁡f(a+h,b)−f(a,b)h\displaystyle {}= \lim_{h \to 0} \frac{f(a + h, b) - f(a, b)}{h}

You will also see this written as fxf_x. Differentiating again gives the second partials: fxxf_{xx}, fyyf_{yy} and the mixed partial fxyf_{xy}, which differentiates by x and then by y. Those numbers form a square table called the Hessian.

The gradient packs the first partials into one arrow. It points the way f rises fastest, its length is that fastest rate, and it is at right angles to the level curve through your point. To get the rate along any other heading, take the dot product of the gradient with a unit arrow pointing that way.

∇f\displaystyle \nabla f=(fx,fy)\displaystyle {}= \left(f_x, f_y\right)
Duf\displaystyle D_u f=fxcos⁡θ+fysin⁡θ\displaystyle {}= f_x \cos\theta + f_y \sin\theta

Where the gradient is zero, you have a critical point. The second derivative test then sorts it using one number, D. For three variables, the tool checks the signs of the Hessian's leading minors in place of D.

D\displaystyle D=fxxfyy−(fxy)2\displaystyle {}= f_{xx} f_{yy} - \left(f_{xy}\right)^2

The formulas come from the sum, product, quotient, power and chain rules with light tidying, so they can look different from a textbook's form and still be equal. The values at your point use exact derivative rules on numbers, not formulas typed back in. As a check, the tool also estimates each partial from nearby values of f.

Worked examples

Ali works a textbook exercise by holding one variable fixed

Ali needs both first partials of x3+x2y3−2y2x^3 + x^2 y^3 - 2y^2 at the point (2, 1). He holds y fixed for the first one and x fixed for the second.

fx\displaystyle f_x=3x2+2xy3\displaystyle {}= 3x^{2} + 2x\,y^{3}
fy\displaystyle f_y=3x2y2−4y\displaystyle {}= 3x^{2}\,y^{2} - 4y

At (2, 1) these give 16 and 8. So a small step h in x changes f by about 16 × h, and the same step in y changes it by about half that. The gradient has length 17.8885.

Open this example in the tool

Jo plans the steepest way down a hill

A hill's height in meters is 1000−x2−2y21000 - x^2 - 2y^2, with x and y in kilometers east and north of its top. Jo stands at (3, 2), where the height is 983 m. The gradient there is (−6, −8), in meters of height per kilometer.

Its heading is 233.1 degrees from east, and height rises fastest that way, at 10 m per km. The steepest way down is the opposite heading, 53.1 degrees. Walking due east, height changes by −6 m per km, and walking northeast by −9.9 m per km.

Open this example in the tool

Wei sorts the critical points of a surface

Wei has x4+y4−4xy+1x^4 + y^4 - 4xy + 1 and tests four points. The last row is there as a warning.

The test at four points
PointGradientDResult
(0, 0)(0, 0)−16Saddle point
(1, 1)(0, 0)128Local minimum
(−1, −1)(0, 0)128Local minimum
(0.5, 0.5)(−1.5, −1.5)−7Not critical

At (0.5, 0.5), D is −7, which looks like a verdict. But the gradient is not zero there, so D says nothing about that point. The test only sorts points where the slope is 0 in every direction.

Open this example in the tool

Reading your result

Each partial is a rate. Its unit is the unit of f per unit of that variable. A partial of 0 means f is flat in that one direction, not that the point is critical. Only a whole gradient of zero gives you a critical point.

The Hessian is symmetric. By Clairaut's theorem, fxyf_{xy} and fyxf_{yx} match when they are continuous near the point. For exye^{xy} at (1, 1), both are 5.4366, which is 2e. That is why only one mixed partial is listed for each pair.

Three variables work the same way. For xyz+z2xyz + z^2 at (1, 2, 3), the gradient is (6, 3, 8). f rises fastest in that direction, at 10.4403 per unit of distance. The map then shows a slice of f at your z value, because a flat picture can only hold two inputs.

D = 0 means look closer. x4+y4x^4 + y^4 and x4−y4x^4 - y^4 both give D = 0 at the origin, and the test reports "Inconclusive (D = 0)" for each. The first has a minimum there and the second has a saddle, so you need another method. Try following f along a few lines through the point.

Common mistakes

  • Treating the other variable as a function. When you differentiate by x, y is a constant, so y3y^3 on its own has a partial of 0 and needs no chain rule.
  • Using D at a point that is not critical. D has a value everywhere, but it only classifies a point where the gradient is zero. Check the gradient first.
  • Taking a large D to mean a steep surface. D measures how the surface curves, not how steep it is. A critical point has no slope at all, and it can have a huge D.
  • Expecting a partial at a corner. |x||x| has no partial at x = 0, and neither does x\sqrt{x}, because the limit that defines it does not exist. The tool says so and gives no number.
  • Mixing up the arrow and the climb. The gradient lies flat in the xy-plane and points the way uphill. It is not a line on the surface itself, and its heading does not tell you the height.

Questions people ask

Almost always in practice, but not by rule. They match when both are continuous near the point, which is the condition in Clairaut's theorem. A function built to be rough at one point can give different values, usually at the origin.

Sources