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.
Check it yourself: every example here can be loaded into the 3D Graphing Calculator.
Open the 3D Graphing CalculatorWhat 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.
- Paraboloid z = x² + y² — opens the 3D Graphing Calculator
How a 3D grapher draws the surface
- Split the x-range and y-range into a grid (for example 30 × 30 squares).
- Compute z = f(x, y) at every grid corner.
- Join each square’s four corners into a small patch.
- 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
- Type the formula, e.g.
x^2 + y^2. - Set x-min, x-max, y-min, y-max. Start symmetric around 0 unless the function has restrictions.
- Drag to rotate. Look from several angles; a single view can hide features.
- Turn on a cross-section to read exact values.
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.
- Both squares positive → bowl with a lowest point.
- Opposite signs → saddle: up one way, down the other.
- 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 |
- Saddle z = x² − y² — opens the 3D Graphing 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.
- Wave z = sin(x)cos(y) — opens the 3D Graphing 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 nowSources and further reading
- OpenStax, Calculus Volume 3 — 4.1 Functions of Several Variables
- OpenStax, Calculus Volume 3 — 2.6 Quadric Surfaces
Worked examples and figures were produced and checked with the Graphing Calculator Lab engine. See the editorial policy.