Find the maximum rate of change of f(x, y) or f(x, y, z) at a point: the gradient, its magnitude and direction, plus any directional derivative.

Gives the gradient at the point, its length (the fastest rate of increase) and the direction of fastest increase.

Use x, y, z, numbers, + − * / ^ and sin, cos, tan, sqrt, exp, ln, log, abs. Example: x^2*y + 3z

Leave blank for a function of x and y only.

Optional settings

Calculator Functions

The calculator finds the gradient of a function of two or three variables at a point, its length (the maximum rate of change) and the direction of fastest increase. It can also give the rate of change in any direction you choose. Select a function to open it in the calculator.

FunctionUse it whenYou enter
Maximum rate of changeYou need the steepest rate of increase and its directionThe function and the point
Directional derivativeYou need the rate of change along a given directionThe function, the point and a direction vector

Write the function with x, y and z, numbers, + − * / and ^ for powers, and sin, cos, tan, sqrt, exp, ln (natural log), log (base 10) and abs. A number next to a variable multiplies it, so 3xy means 3·x·y. Leave Point z blank for a function of x and y only.

Maximum Rate of Change Formulas

|∇f| = √(fx² + fy² + fz²) [1]
∇fGradient: the vector of partial derivatives ⟨fx, fy, fz⟩ at the point [2]
fxPartial derivatives fx, fy, fz: the rate of change of f along x, y and z
|∇f|The maximum rate of change: the length of the gradient, in units of f per unit distance

The gradient points in the direction of fastest increase, given as the unit vector ∇f ÷ |∇f|. The fastest decrease is −|∇f|, in the opposite direction, and the rate of change is zero in any direction at right angles to the gradient [1]. For a function of x and y, fz is left out.

Directional derivative

Duf = ∇f · u
u = v ÷ |v| [1]

v is the direction you enter and u is that direction scaled to length 1, so (1, 1) and (2, 2) give the same answer. The result is largest, equal to |∇f|, when u points along the gradient.

How the partial derivatives are found

fx ≈ [f(x+h) − f(x−h)] ÷ 2h [3]

This is the central-difference formula, with the other variables held fixed. It is used for each variable in turn with h = 0.001 (scaled up for coordinates larger than 1). The calculator repeats it with half the step and combines the two results, which removes most of the remaining error for smooth functions.

Worked example

For w = (x² + y²) ÷ 3 at (1, 2), the gradient is ⟨2x/3, 2y/3⟩ = ⟨2/3, 4/3⟩ [2]. Its length is √(4/9 + 16/9) = √20 ÷ 3 ≈ 1.4907, so w rises at most about 1.49 per unit distance, in the direction ⟨1, 2⟩ ÷ √5.

Limits of This Estimate

  • The partial derivatives are numerical. For smooth functions they agree with the exact values to at least six significant figures. At a corner or sharp point, such as abs(x) at x = 0, the function has no derivative and the result does not mean anything.
  • sin, cos and tan use radians. Convert degrees first, for example sin(x*pi/180).
  • The function must have a real value at the point and nearby; ln and sqrt of zero or negative numbers do not.

Sources

  1. MIT OpenCourseWare, 18.02 Multivariable Calculus (Fall 2007), Lecture 12: Gradient: the directional derivative as the gradient dotted with a unit vector, and the gradient as the direction of fastest increase with its length as that rate
  2. MIT OpenCourseWare, 18.02SC Multivariable Calculus (Fall 2010), Gradient: Definition and Properties: the gradient of a function of two and three variables, and the worked example
  3. NIST Digital Library of Mathematical Functions, §3.4 Differentiation: the three-point formula behind the central difference