Quadratic Surface Gradient & Directional Derivative Calculator
Enter a quadratic surface, a point and a displacement. See the partial derivatives, steepest ascent and the exact quadratic correction to a tangent-plane prediction. Inspect both charts and the stationary set.
Explore a quadratic surface
Find the direction of steepest ascent and compare the tangent plane with the surface.
Quadratic equation and move
Use the surface z = Ax² + Bxy + Cy² + Dx + Ey + F. Supply a point (x, y) and a move (Δx, Δy). Use zero for any absent term.
The chosen direction initially descends.
Gradient at the chosen point
- Partial derivatives (∂z/∂x, ∂z/∂y)
- (1, 5)
- Directional derivative per unit of move
- -1.34164079
Starting value 3 · Steepest slope 5.09901951
Level curves and tangent error
Window extends ±2.6 from the chosen point on each axis. The dashed arrow shows steepest ascent with a fixed arrow length.
- Entered move
- Steepest ascent
- Lower contours
- Higher contours
- Same height
Hessian and stationary set
Rows (2, 1) and (1, 4). Determinant 7.
Unique minimum at (1.14285714, -0.285714286).
Export gradient and profile CSV
Save the input coefficients, partial derivatives, stationary set and the eleven profile steps with exact fractions.
View CSV text
How to use this calculator
- Match the equation to the six coefficients A through F. Enter zero for a missing term.
- Enter the point where you want the slope and the x and y components of the chosen displacement.
- Read the partial derivatives and normalized directional derivative, then inspect the two arrows on the level curves.
- Select Surface vs tangent and move the slider to compare heights anywhere along the entered displacement. Review the stationary set and download the profile CSV.
The Formula
The mathematical logic powering this calculation is:
For f(x,y) = Ax² + Bxy + Cy² + Dx + Ey + F, the gradient is (2Ax + By + D, Bx + 2Cy + E). It gives the two partial derivatives at the entered point P. If the move vector v = (Δx,Δy) has positive length, the directional derivative in that direction is ∇f(P)·v / ‖v‖. Thus the slope has units of height change per unit displacement. A zero vector has no direction. A zero gradient has zero slope in every direction.
For fraction t of the entered move, the tangent plane estimates a height of f(P) + t ∇f(P)·v. The signed error, actual height minus tangent estimate, is exactly t²(AΔx² + BΔxΔy + CΔy²). The profile shows both height changes relative to f(P). The slider reports both absolute heights and their signed difference. Contours approximate the level sets around P on a sampled mesh. Both axes use the same offset scale.
The Hessian matrix has diagonal entries 2A and 2C, off-diagonal B, and determinant 4AC − B². Its stationary set solves H·(x,y) = −(D,E). A nonzero determinant gives one point. A negative determinant gives a saddle. A positive determinant gives a minimum if 2A is positive and a maximum otherwise. A singular nonzero Hessian gives a line of minima or maxima when the equations are consistent. If the equations conflict, there is no stationary point. A zero Hessian gives either a flat constant or a plane with nonzero slope.
Enter signed ordinary decimals through ±1,000,000 with up to six decimal places. Exact fractions are used for algebra, stationary coordinates and profile heights. Square roots, the normalized slope, displayed decimals and contours use numerical approximations. The worksheet covers quadratic and lower-degree real polynomials in x and y.Worked Example
If you input:
- Surface: x² + xy + 2y² − 2x + 1
- Point: (1, 1)
- Move: (2, −1)
Result:
The gradient is (1, 5) and the directional derivative is −3/√5. The tangent estimate at the end is 0 and the surface height is 4. The unique minimum is at (8/7, −2/7).
Frequently Asked Questions
How do I find the gradient from a quadratic equation?
Differentiate with respect to x while holding y fixed, then differentiate with respect to y while holding x fixed. Substitute your point into both results to obtain the gradient vector.
Why divide by the length of the move?
The directional derivative measures height change per unit distance at the start. The tangent prediction for the full displacement uses the dot product with the full vector.
Can the surface rise even when the directional derivative is negative?
Yes. A negative derivative means the surface falls for a sufficiently short move. A large enough positive quadratic correction can reverse that decline by the end of a longer move.
What if the Hessian determinant is zero?
For a quadratic, solve the remaining linear gradient equations. The stationary set may be a line, the whole plane for a constant function, or empty. A consistent nonzero Hessian with zero determinant has a flat direction along its stationary line.
What does a stationary saddle mean?
The gradient vanishes, so every initial directional slope is zero. Second-order curvature can raise the surface in some directions and lower it in others.
Similar Calculators
Derivative Graph & Finite Difference Calculator
Graph a polynomial derivative and compare forward, backward and centered steps. Separate exact truncation, sample rounding and subtraction error.
Vector Calculator
Explore 2D and 3D vectors: dot and cross products, angles, addition, projections and area, with interactive geometry, exact arithmetic and CSV.
Quadratic Formula Calculator
Solve any quadratic equation ax² + bx + c = 0 and find its real or complex roots instantly.
Force Field Work Calculator & Path Comparison
Calculate work along two planar paths in a force field. Compare exact segment work, circulation and the signed loop area.
