3D graphs of two-variable functions — spin the surface with your mouse

Function z = f(x, y)

Insert into the formula:
Try:
x y z

Drag to rotate, wheel or pinch to zoom. The height of the surface is the value of z; the color shows the height too — from the lower color to the upper one.

Plot range:

Investigate the function

Try:
📚 Theory: how to read a 3D graph

A function of two variables z = f(x, y) assigns one number z to every pair of numbers (x, y). If an ordinary graph y = f(x) is a line above the number line, the graph of a two-variable function is a surface above the plane: at every floor point (x, y) the surface is raised to height z.

Example: z = x² + y² is a “bowl”. At the center (0, 0) the height is zero, and the farther from the center, the higher the surface rises. And z = x² − y² is a “saddle”: along one axis the surface bends up, along the other — down.

Such surfaces describe terrain (height as a function of coordinates), the temperature of a hotplate (heat as a function of position), loudness in a room. Contour lines on a map are slices of such a surface by horizontal planes.

You can write: + − * / ^, parentheses, sin cos tan sqrt abs ln log exp, constants pi and e, variables x and y. Multiplication can be omitted: 2x, but between variables write it explicitly: x*y.

To find the extrema of a function of two variables, take the partial derivatives, set both equal to zero and solve the system: its solutions are the critical points. Then at each point compute the second derivatives and D = f_xx·f_yy − (f_xy)²: if D > 0, there is an extremum (a minimum if f_xx > 0, a maximum if f_xx < 0); if D < 0, there is none (a saddle point); if D = 0, the test is inconclusive. In other countries the same test is written AC − B², rt − s² or det H — the solver uses the notation of the page language.

The tangent plane to the surface z = f(x, y) at (x₀, y₀): z − z₀ = f_x(x₀, y₀)(x − x₀) + f_y(x₀, y₀)(y − y₀). The normal line passes through the same point perpendicular to the plane: (x − x₀)/A = (y − y₀)/B = (z − z₀)/C, where A, B, C are the coefficients of the general equation of the plane Ax + By + Cz + D = 0.

Absolute maximum and minimum on a closed region. Find the critical points inside the region, then study the boundary: on each segment substitute its equation (y = 0, x = 3, y = 6 − x…), get a function of one variable and find where its derivative is zero; add the vertices and compare the values of the function at all these points. A constrained extremum of f(x, y) subject to g(x, y) = 0 is found with Lagrange multipliers: ∇f = λ∇g together with the constraint itself. A circular or elliptical boundary is handled the same way.

Frequently asked questions

Is it free to use?

Yes, this calculator is free and needs no sign-up. Everything is calculated right in your browser, not on a server.