Math
Gradient Calculator
Type a polynomial such as 3x^2y - 2xy + y^3 + 5 and a point. mathcheck differentiates it with respect to x and then y, shows the gradient as a vector field, evaluates it at the point, and reports the magnitude (how fast f climbs), the direction of steepest ascent as an angle and a unit vector, and the opposite direction for steepest descent.
A zero gradient is flagged as a critical point.
A polynomial in x and y using ^ for powers, for example x^2y - 4y^2 + 7x. Products like 2xy are fine; no sin, e, or division.
Try an example
Result
∇f at the point
—
- ∇f as a vector field
- —
- ∂f/∂x
- —
- ∂f/∂y
- —
- |∇f| (rate of steepest ascent)
- —
- Direction of steepest ascent
- —
- Unit vector
- —
More details (2 more)
- f at the point
- —
- Steepest descent direction
- —
Student quick launch
Grade planning, algebra checks, and formulas students reach for most.
Study path
Use this calculator with
Follow these when you want the formula behind the answer, a short lesson, or nearby tools in the same topic.
What the gradient is
For a function of two variables, the gradient packs both partial derivatives into one A quantity with both a size and a direction, often drawn as an arrow., ∇f = ⟨∂f/∂x, ∂f/∂y⟩. At any point it points in the direction in which f increases fastest, and its length is that fastest rate of increase. It is perpendicular to the level curve f = constant through the point, which is why contour lines and gradient arrows on a map always cross at right angles.
f = 3x^2y - 2xy + y^3 + 5 at (1, 2)
∂f/∂x = 6xy - 2y and ∂f/∂y = 3x^2 - 2x + 3y^2. At (1, 2): ∇f = ⟨12 - 4, 3 - 2 + 12⟩ = ⟨8, 13⟩, with |∇f| = √233 ≈ 15.26. The surface climbs fastest toward ⟨8, 13⟩.
| Direction of travel | Rate of change of f |
|---|---|
| along ∇f | +|∇f| (steepest ascent) |
| against ∇f | -|∇f| (steepest descent) |
| perpendicular to ∇f | 0 (along the level curve) |
| any unit vector u | ∇f · u = |∇f| cos θ |
How to use this calculator
- Type f(x, y) as a polynomial. Use ^ for powers and write products like 3x^2y without a multiplication sign.
- Enter the point (x, y) where you want the gradient.
- Read ∇f at the point, then the two partial derivatives as formulas, the magnitude, and the direction of steepest ascent.
- Use the steepest-descent vector (the negative gradient) for minimization problems.
- Open Show the work to see each partial derivative and the substitution.
How to read the answer
The gradient vector's direction tells you which way to walk to climb fastest and its The length or size of a vector, ignoring which way it points. tells you how steep that climb is, in units of f per unit distance. The angle is measured counterclockwise from the positive x-axis. The unit vector is the same direction with length 1, ready for use in a directional derivative. A zero gradient marks a critical point and has no direction.
Common mistakes and edge cases
- Differentiating with respect to x but forgetting that y-only terms drop out (and vice versa).
- Treating the gradient as a number; it is a vector with two components.
- Reporting the direction of steepest ascent without evaluating at the point; the direction changes from place to place.
- Mixing up ∇f with the How steep a line is: how much y changes for each step right in x. of a level curve, which is perpendicular to it.
- Entering non-polynomial pieces such as sin(x) or 1/x, which this page does not parse.
Worked examples
Mixed polynomial
3x^2y - 2xy + y^3 + 5 at (1, 2)
∇f at the point
⟨8, 13⟩
Paraboloid
x^2 + y^2 at (3, 4)
∇f at the point
⟨6, 8⟩
Critical point at the origin
x^2 - y^2 (a saddle) at (0, 0)
∇f at the point
⟨0, 0⟩
Linear function
2x - 5y + 1 has a constant gradient
∇f at the point
⟨2, -5⟩
Decimal coefficients
0.5x^2y at (2, 1.5)
∇f at the point
⟨3, 2⟩
Constant function
∇f at the point
⟨0, 0⟩
Unsupported expression
∇f at the point
—
Frequently asked questions
What is the gradient of a function?+
The vector of its partial derivatives, ∇f = ⟨∂f/∂x, ∂f/∂y⟩. It points toward the fastest increase of f, and its length is that maximum rate.
How do I compute a partial derivative?+
Differentiate with respect to one variable while treating the other as a constant. For 3x^2y the x-partial is 6xy and the y-partial is 3x^2.
What does the magnitude of the gradient mean?+
It is the steepest slope of the surface z = f(x, y) at that point: the directional derivative in the gradient's own direction. Every other direction gives a smaller rate of change.
Why is the gradient perpendicular to level curves?+
Moving along a level curve leaves f unchanged, so the directional derivative there is 0, which means ∇f · u = 0 for the tangent direction u. Hence ∇f is normal to the curve.
What happens when the gradient is zero?+
The point is a critical point: a local maximum, local minimum, or saddle. The second-derivative test distinguishes them; the gradient alone cannot.
Can I use this for three variables?+
This page handles f(x, y). For f(x, y, z) the gradient simply gains a third component ∂f/∂z, computed the same way.
About this calculator
- Written by
- mathcheck editorial team
- Last reviewed
- September 4, 2026
Method
- Uses the values entered by the user and stable formulas documented on the page.
Related calculators
Vector Magnitude and Direction Calculator
Find the magnitude (length) and direction angle of a 2D or 3D vector from its components or from two points. Exact radical magnitude, unit vector, direction cosines, and an arrow diagram.
Unit Vector Calculator
Normalize a 2D or 3D vector to a unit vector with exact rationalized radical components and decimals, plus the magnitude, direction angle, and the opposite unit vector.
Average Rate of Change Calculator
Find the average rate of change of a function between two x-values from a polynomial or from two points, with the exact fraction, the secant line equation, and every step.
Slope Calculator
Find slope from two points, solve a missing coordinate from a known slope, or turn an angle or percentage grade into a slope. Includes equations, intercepts, perpendicular slope, graph, and step-by-step work.
Dot Product Calculator
Compute the dot product of two 2D or 3D vectors with the angle between them, both magnitudes, the scalar projection, and an orthogonality check, with every multiplication shown.
Vector Projection Calculator
Project vector a onto vector b in 2D or 3D. Get the vector projection, the scalar projection (component of a along b), the rejection (perpendicular part), and the angle between them, with steps.
Last updated: September 4, 2026