Parametric and 3D Graphing

How to Graph 3D Functions z = f(x, y)

A function z = f(x, y) takes two inputs and gives one output, so its graph is a surface in 3D space: above each point (x, y) of the domain the surface sits at height z = f(x, y). To graph it, choose an x-range and a y-range, compute z on a grid of points, and join neighbouring points into small patches. Rotate the view and use cross-sections to read the shape.

3D surface of the paraboloid z = x² + y² over −3 ≤ x ≤ 3 and −3 ≤ y ≤ 3, a bowl opening upward from the origin.

Check it yourself: every example here can be loaded into the 3D Graphing Calculator.

Open the 3D Graphing Calculator

What the graph shows

A function of two variables, z = f(x, y), gives a height for every point (x, y). Picture the xy-plane as the floor and the surface as a sheet held above (or below) it: the sheet’s height over each floor point is f(x, y).

  • Domain: the region of the floor you choose, for example −3 ≤ x ≤ 3, −3 ≤ y ≤ 3.
  • Range: the heights the surface reaches.
Try it in the calculator

How a 3D grapher draws the surface

  1. Split the x-range and y-range into a grid (for example 30 × 30 squares).
  2. Compute z = f(x, y) at every grid corner.
  3. Join each square’s four corners into a small patch.
  4. Shade the patches and draw them back-to-front so nearer patches hide farther ones.

The number of grid squares is the resolution; see 3D graph resolution for the trade-off between smoothness and speed.

Step by step in the calculator

  1. Type the formula, e.g. x^2 + y^2.
  2. Set x-min, x-max, y-min, y-max. Start symmetric around 0 unless the function has restrictions.
  3. Drag to rotate. Look from several angles; a single view can hide features.
  4. Turn on a cross-section to read exact values.
Three 3D surfaces: the bowl z = x² + y², the saddle z = x² − y², and the wave z = sin x · cos y.
The formula's signs and functions predict the shape before you graph it.
Text description of this figure

Three 3D surfaces: the bowl z = x² + y², the saddle z = x² − y², and the wave z = sin x · cos y.

  1. Both squares positive → bowl with a lowest point.
  2. Opposite signs → saddle: up one way, down the other.
  3. Trig functions → repeating hills and valleys.

Recognising common shapes

Formula Shape Key feature
z = x² + y² bowl (paraboloid) minimum at the origin
z = −(x² + y²) dome maximum at the origin
z = x² − y² saddle neither max nor min at the origin
z = 2x + 3y tilted plane constant slope in each direction
z = sin x · cos y egg-crate wave repeating peaks and pits
z = √(9 − x² − y²) upper hemisphere defined only where x² + y² ≤ 9
Try it in the calculator

Choosing a good domain

  • Too small and you only see a nearly flat patch.
  • Too large and fast-growing terms (like x⁴ or eˣ) dominate, squashing the interesting part.
  • For trigonometric surfaces, include at least one full period (about −6 to 6).
  • Outside the function’s domain (such as a negative square root) there is no surface — the calculator leaves a gap.
Try it in the calculator

Common mistakes

  • Typing y as the output. In 3D the output is z; x and y are both inputs.
  • Judging shape from one angle. Rotate before deciding.
  • Expecting implicit equations to work. Solve for z first.
  • Huge domains with steep functions, which make the surface look like a spike.

Questions

Why is a 3D graph a surface and not a curve?

There are two inputs. Every point of a flat region in the xy-plane gets its own height, so the heights together form a surface.

Can I graph equations like x² + y² + z² = 9?

Not directly as z = f(x, y), because each (x, y) gives two z-values. Graph the top half z = √(9 − x² − y²) and the bottom half separately.

How do I read exact values from a 3D graph?

Use a cross-section: fixing y or x turns the surface into an ordinary 2D curve you can read precisely.

Graph your own example with the 3D Graphing Calculator — free, in your browser.

Try it now

Sources and further reading

Worked examples and figures were produced and checked with the Graphing Calculator Lab engine. See the editorial policy.

Related guides

More in Parametric and 3D Graphing · All guides