3D Graphing Calculator
Plot z = f(x, y) as a surface and turn it with your finger. Then see the same function as a contour map, slice it anywhere you like, and get every maximum, minimum and saddle point found and classified — which is the part every other 3D grapher leaves to you.
Four views of the same function
A surface is hard to read from one picture. The 3D view shows you its shape, and hides whatever is behind the nearest ridge. The contour map shows the whole domain at once and says nothing about which way is up. A cross-section is the only one of the three you can measure a gradient off. So all four tabs work from the same expression and the same domain, and switching between them never means retyping anything.
That is the actual skill a multivariable course is teaching: recognising that the dip you can see on the surface, the closed loops shrinking to a point on the contour map, and the minimum of the cross-section through it are three descriptions of one feature.
Critical points, found and classified
This is the part that does not exist elsewhere. Every 3D grapher will draw z = x³ + y³ − 3xy for you. None of them will tell you that it has a saddle at the origin and a local minimum at (1, 1), which is the question the surface was drawn to answer.
Three steps, each done the careful way.
- The partial derivatives are symbolic. fx, fy, fxx, fyy and fxy are differentiated exactly, by the same engine as the derivative calculator, and all five are shown. Numerical differencing would put an error into the calculation before the search even started, and the second partials — the ones that decide the answer — are where that error compounds worst.
- Newton's method on ∇f = 0. A critical point is where both partial derivatives vanish, so finding them is solving a system of two equations in two unknowns, started from a grid of seed points across the domain. Newton on the gradient finds all three kinds, because maxima, minima and saddles are all roots of the same system. A method that climbed or descended would only ever find one kind, and saddles are usually the interesting ones.
- The second derivative test. With D = fxx·fyy − fxy²: D > 0 and fxx > 0 is a local minimum, D > 0 and fxx < 0 a local maximum, D < 0 a saddle. The reasoning is printed for each point rather than just the verdict.
When the test cannot decide, it says so
D = 0 is the case that matters, and it is not an edge case to be swept up. z = x⁴ + y⁴ has a minimum at the origin so obvious you can see it, and D = 0 there, so the second derivative test cannot tell you. The monkey saddle z = x³ − 3xy² has a critical point at the origin that the test cannot name either.
Both are reported as inconclusive. A tool that printed “minimum” for the first and “saddle” for the second would be right twice by luck and would be teaching the test wrongly — because the thing the test is for is knowing what it does and does not establish. Deciding those cases needs higher derivatives, or a look along particular directions through the point.
How the hidden surfaces work
There is no WebGL here, and no depth buffer. The surface is cut into a grid of quadrilaterals, each one is projected to the screen, and they are painted back to front, so whatever is nearer covers what is behind it. That is the painter's algorithm, and the usual objection to it — that three shapes can overlap in a cycle with no valid order — cannot arise for the graph of a function, because the quads sit over a grid in the plane and cannot pass through one another.
The payoff is that the surface is built from the same drawing primitives as every other chart on this site, which means the SVG exporter works on it unchanged. You can download a 3D surface as a true vector file — every face a polygon in it, sharp at any size, printable, and editable in Illustrator or Inkscape. A WebGL grapher can only ever hand you a screenshot.
It also means the plot is drawn with ordinary 2D canvas calls, so it works on hardware and in browsers where WebGL is disabled, blocked or missing — which on school machines is more often than you would think.
What the lighting is doing
Each face is shaded by the angle between its own normal and a light that follows the camera. That is what makes a curved surface readable: without it, a dome and a bowl are the same silhouette. Both sides of the surface are lit, because you can rotate under it, and an unlit face reads as a hole rather than as the underside of something. The colour on top of the shading runs with height, blue through teal to amber, so the same information is in the picture twice — which is what lets you read it in a greyscale print.
Holes, poles and clipping
Two things go wrong with real functions, and both are handled by saying what happened rather than by drawing something plausible.
Where the function is undefined, the surface has a hole. z = 1/(xy) has no value anywhere on either axis, and the faces touching those lines are left out rather than bridged. A sheet stretched across a discontinuity is a picture of something that does not exist, and it covers up exactly the feature you were looking for. The count of undefined sample points is reported under the plot.
Where the function has a pole, the range is clipped. z = 1/(x² + y²) runs to infinity at the origin. Scaled to fit that, the entire rest of the surface is flat against the floor and the picture is one spike and a plain. So the default range is the middle of the sampled heights, with anything beyond it flattened against the boundary and counted. The pole then reads as a mesa, and the numbers on the z-axis still mean what they say.
Reading a contour map
The level curves tab draws f(x, y) = c for a series of heights c, looking straight down. It is the same marching-squares contourer that draws implicit curves like x² + y² = 4 on the main graphing calculator, because a level curve of a surface and an implicit curve in the plane are the same object.
- Lines close together mean a steep slope, because the height is changing quickly over a short distance. Widely spaced lines mean nearly flat ground.
- Closed loops shrinking towards a point mark a peak or a pit. Which one it is comes from the values, not the shape.
- Lines that cross mark a saddle: the only place a contour can meet itself is where the surface is level in one direction and sloping in another.
- The gradient ∇f is always perpendicular to the contour through a point, and points towards the higher one. That is the one fact that makes the whole picture useful.
Cross-sections and partial derivatives
Hold y still at some value b and let x run: you get an ordinary two-dimensional curve, z = f(x, b), which is where a vertical plane cuts the surface. Its gradient is exactly the partial derivative ∂z/∂x. That is all a partial derivative is — the ordinary derivative of a cross-section — and it is much easier to see on the slice than to accept from the notation.
The two charts in that tab are the slice at a fixed x and the slice at a fixed y, drawn as plain 2D graphs. Move the slice through a critical point and watch what happens: at a minimum both curves have a minimum there, and at a saddle one has a minimum and the other a maximum. That is the second derivative test, visible rather than computed.
Writing the function
Type it as you would say it. x^2 - y^2, sin(x)cos(y),
e^(-(x^2 + y^2)), sqrt(9 - x^2 - y^2). A leading
z = is accepted and ignored. Multiplication can be implied, so
3xy means 3·x·y. The variables must be x and y;
anything else is reported rather than silently treated as a constant.
The same conventions as everywhere else on the site apply:
-x^2 is −(x²), log is base 10,
ln is natural, and sin^-1 is arcsine rather than
a reciprocal.
What it does not do
- Parametric surfaces, where x, y and z are each functions of two parameters. That covers tori, Möbius strips and most of the interesting shapes, and it needs a different input and a different mesh.
- Implicit surfaces like x² + y² + z² = 1. A sphere has two heights above most points of the plane, and this plots functions, which have one. The top half, z = √(1 − x² − y²), plots fine.
- Several surfaces at once, and the intersection curve between them.
- Vector fields, gradient arrows or flow lines over the domain.
- Constrained optimisation — Lagrange multipliers, maxima on a boundary curve. The critical points found here are the interior ones, where the gradient vanishes. A maximum on the edge of the domain is not a critical point and is not reported as one.
- Double integrals or volumes under the surface.
- Critical points of a function whose partial derivatives cannot be differentiated symbolically. The surface still draws; the panel says why it has nothing to add.
Questions
Why is the vertical scale different from the horizontal one?
Because z is almost never in the same units as x and y. A surface might be temperature over a map, or profit over price and volume, or z = sin(√(x² + y²)) over a domain of ±16 — and in none of those is one step in x comparable to one step in z. Held to a single scale, that last one is drawn as a flat disc, because its whole range is 2. The box is therefore about as tall as it is wide, and the real heights are on the z-axis. The x and y scales are equal to each other, because those two do share units.
What does "the test is inconclusive" mean on a critical point?
It means D = fₓₓ·fᵧᵧ − fₓᵧ² is zero there, so the second derivative test cannot classify the point. It is a real answer, not a failure. z = x⁴ + y⁴ has an obvious minimum at the origin and D = 0 there, and the monkey saddle z = x³ − 3xy² has a critical point the test cannot name either. Deciding those needs higher derivatives or a look along particular directions. A tool that printed "minimum" for the first would be right by luck and teaching the test wrongly.
Why does the surface have holes in it?
Because the function has no value there. z = 1/(xy) is undefined along both axes, and the quads touching those lines are left out rather than stretched across the gap. A sheet drawn over a discontinuity is a picture of something that does not exist, and it hides exactly the feature you were probably looking for. The note under the plot says how many sample points came back undefined.
The plot says some heights were clipped. What was clipped?
Heights outside the range shown on the z-axis, drawn flattened against it. By default that range is the middle of the sampled heights rather than all of them, because a single pole — z = 1/(x² + y²) near the origin — otherwise owns the whole scale and presses everything else flat against the floor. A clipped pole reads as a mesa, which is honest, and the count of clipped samples is reported under the plot.
Can I download the 3D plot?
Yes, as SVG or PNG, both made in your browser. The SVG is a true vector file: every face of the surface is a polygon in it, so it stays sharp at any size, prints cleanly, and can be opened in Illustrator or Inkscape or dropped into LaTeX. This is unusual — 3D graphers generally render with WebGL, which can only give you a screenshot — and it falls out of the surface being built from the same drawing primitives as every other chart on this site.
Does it do parametric surfaces, or implicit ones like a sphere?
No. It plots z = f(x, y), where each point of the plane has exactly one height. A sphere has two, so x² + y² + z² = 1 cannot be drawn this way; you can plot the top half as z = √(1 − x² − y²). Parametric surfaces, where x, y and z are all functions of two parameters, are a different kind of object and are not supported.
Related
-
Derivative calculator
The same differentiation engine in one variable, with every rule shown as it is applied.
-
Graphing calculator
Curves in the plane, with roots, turning points and intersections found to full precision.
-
Vector calculator
Dot and cross products, exactly — the algebra underneath the gradient and the normal.