Skip to content
FastTool

Science & Math

3D Function Grapher

Type a function of x and y to see its surface in 3D. Move a point to read the slope in any direction, and estimate the double integral over a rectangle, signed and absolute. Download the sampled points as CSV.

Start with a question

01 / DEFINE THE SURFACE

From expression to shape.

Use explicit multiplication: 2*x. Functions use radians. Supported syntax

Loading the grapher…

02 / Move the probe & slices

Both slices pass through this point. Move them without recalculating the integral.

Follow any direction

Enter a direction in the x–y plane. It is normalized automatically, so the answer is change per one coordinate unit travelled.

Directional derivative —

Choose a valid surface and probe.

Runs in your browser. Nothing is uploaded.

z = f(x, y)x² − y²
−44sampled z

Drag to rotate. Click the view, then scroll to zoom. Arrow keys rotate. The vertical axis is z; the amber slice runs along x and the blue slice along y.

Contours use the sampled triangle mesh, not exact symbolic level curves.

Blue = negative, teal = zero, gold = positive. Each side scales to its sampled range.

View fits x, y and z independently for readability. Values and exports are never rescaled.

Signed integral ∬ f dA—positive + negative contributions
Absolute volume ∬ |f| dA—both sides counted positively
Mean surface value—signed integral ÷ domain area

Waiting for the numerical estimates.

Inspect integration estimates
Numerical estimates, not exact symbolic answers
MethodSignedAbsolute

THE LOCAL PICTURE

One point. Two slopes.

Preparing the point…

∂f/∂x
—
∂f/∂y
—
|∇f|
—

No tangent calculation yet.

The gradient points toward greatest local increase in the x–y domain. A tangent patch is a local linear approximation, not the surface itself.

Along x y = 0.5
Along y x = 0.5
Read cross sections as a table
Five representative samples from each current slice
Slicexyz

How it works

What the grapher calculates.

Zero does not mean empty.

On [−2, 2] × [−2, 2], the saddle f(x, y) = x² − y² has equal positive and negative contributions. Its signed integral is 0, but its absolute volume is 64/3 ≈ 21.3333.

Signed: ∬ f(x, y) dA
Absolute: ∬ |f(x, y)| dA

The absolute value of an integral is not the integral of the absolute value. Change to the bowl and the cancellation disappears.

A gradient you can inspect.

At (a, b), the engine differentiates the expression tree using the product, quotient and chain rules. It does not estimate the gradient from pixels.

∇f = (∂f/∂x, ∂f/∂y)
T(x,y) = f(a,b) + fₓ(a,b)(x−a) + fᵧ(a,b)(y−b)

For x² − y² at (0.5, 0.5), the gradient is (1, −1) and the tangent is z = x − y. At a detected cusp or singular derivative, we withhold the tangent patch.

A numerical estimate, checked twice.

The tool applies composite Simpson integration along both axes at N and 2N cells, then compares a midpoint estimate. Each comparison is shown, not hidden behind a confidence score.

Mean f = ∬ f dA ÷ rectangle area

Differences are not rigorous error bounds. Even matching grids can miss narrow peaks or rapidly oscillating functions. Increase resolution, change bounds and check against an analytic case. Tiny floating-point cancellation residuals may display as zero; JSON retains the computed values.

A small, predictable language.

Variables: x, y. Constants: pi, e. Operators: + − * / ^ and parentheses. Functions: sin, cos, exp, ln, sqrt, abs.

Powers use literal integers from −8 to 8: x^-2. Write sqrt(x), not x^0.5. All angle functions use radians. -x^2 means -(x^2). Use * explicitly; implicit multiplication and chained powers are unsupported.

No JavaScript, assignment, properties, custom functions or arbitrary code is executed.

Domain checks are conservative.

The entire rectangle is checked with interval arithmetic before sampling. A possible zero denominator or invalid log/square-root argument stops the calculation and locks exports.

Intervals may reject a valid expression such as 1/(x-x+1) because repeated variables lose their dependency. Simplify it to 1.

Bounds: ±1,000; minimum span: 0.001. Expressions: 240 characters / 160 tokens. Intermediate values: ±1,000,000. Maximum mesh: 6,561 points; integration uses up to 25,921 grid points plus 6,400 midpoint evaluations.

Take the data, not a screenshot.

CSV contains the current mesh’s x, y and z samples. JSON records the expression, domain, integration estimates, refinement differences and probe. Units are abstract; no physical scale is inferred.

Runs in your browser. Nothing is uploaded, and your expression isn’t stored after you leave. If your device can’t show 3D, the numbers, slice charts and downloads still work.

Method references: OpenStax: gradients and double integrals over rectangles.

Choose your direction, not just an axis.

For the plane 2*x+3*y+1, the gradient is (2, 3). A direction of (3, 4) has unit vector (0.6, 0.8), so the directional derivative is 2 × 0.6 + 3 × 0.8 = 3.6. Reversing the direction changes the sign; multiplying both components by a positive number does not change the answer.

u = d / |d|
Dᵤf = ∇f · u

The zero vector has no direction. This only invalidates the directional result; the surface, integral and current slice CSV remain available. The dot-product rule assumes differentiability at the probe. A detected unsupported derivative is withheld.

Read height like a contour map.

Contour lines connect equal z values on the sampled triangle mesh. Nine interior levels are drawn, with z = 0 added when the surface crosses zero. A constant sampled surface has no isolated contour curves. Choose Top in the view controls to inspect the pattern.

These are piecewise-linear approximations, not symbolic solutions of f(x,y) = c. Changing resolution can change their shape. Sign colors separate negative blue, zero teal and positive gold; the two sides use their own sampled ranges.

The current-slices CSV contains 81 points along x and 81 along y, with the probe coordinates recorded on every row. It matches the current applied expression and probe.

Why was my expression rejected?

Usually for one of three reasons: a missing * (2x instead of 2*x), a power that isn’t a whole number from −8 to 8 (use sqrt(x) for a square root), or a rectangle that contains a division by zero or a negative square root somewhere. The message under the expression says which. Shrinking the bounds often fixes the last case: ln(x) works on x from 0.1 to 3, not from −2 to 2.

Why is my signed integral zero when the surface clearly has volume?

Parts below z = 0 count as negative and cancel the parts above. For x² − y² on [−2, 2] × [−2, 2] the signed integral is 0, but the absolute volume is 64/3 ≈ 21.333 (the grapher’s estimate at the default resolution is 21.327). Use the absolute value when you want the total volume between the surface and the plane z = 0.

How accurate is the double integral?

For smooth functions it is usually very close. The grapher compares Simpson’s rule at N and 2N cells with a midpoint estimate and shows the differences. If they disagree, raise the resolution or narrow the bounds. For the plane 2x + 3y + 1 on [0, 2] × [0, 2], all three give exactly 24, so the mean height is 6.

Can I graph a sphere or a parametric surface?

Not here. The grapher draws one height for each point, z = f(x, y), over a rectangle. Implicit surfaces such as x² + y² + z² = 1 and parametric surfaces need a different kind of plotter.

Results come from a sampled grid, so the highest and lowest points shown can miss a narrow peak between samples. Found a mistake? Tell us.