Graphing

Function Grapher

Enter a function of x and an interval. The calculator samples the function, plots it as a smooth curve, locates the zeros by bisection and the local extrema from sign changes of the derivative, then overlays every feature on the plot.

Function Grapher

Plot y = f(x) with zeros, extrema and the y-intercept marked.

Try:
Answer2 zeros, 1 extremum on [-5, 5]
-5-4-3-2-1012345-505101520(-2, 0)(2, 0)min (0.025, -3.99937)y-int (0, -4)xf(x)
  1. Functionf(x) = x^2 - 4
  2. Rangex ∈ [-5, 5]
  3. Zerosx = -2, x = 2
  4. y-intercept(0, -4)
  5. Local extremamin at x = 0.025 (y = -3.99937)

A picture with its features labelled

A plot shows shape; a list of coordinates shows precision. Most graphing questions need both — where the curve crosses the axis, where it turns, what it does in between — and reading exact values off a drawing is what a picture is worst at.

This grapher does both at once. It draws y = f(x) over the interval you choose and marks the zeros, the local maxima and minima, and the y-intercept, reporting each of them numerically alongside the plot.

The interesting points are the ones a sketch places approximately: a root near 1.7, a minimum around x = −1. Marking them on the plot and listing them as numbers removes that vagueness without losing the shape.

It also makes the interval a deliberate choice. A feature outside the window is not found, so choosing a range that contains the behaviour you care about is part of using the tool.

How to use this calculator

  1. Enter the function of x Standard arithmetic with ^ for powers, plus sin, cos, tan, exp, ln, log, sqrt and abs. The constants pi and e are recognised by name.
  2. Set the x range as two numbers Written as a pair such as −5, 5. The lower value must be smaller than the upper; anything unparseable falls back to −10 to 10 rather than raising an error.
  3. Read the plot together with the listed features Every marker on the curve corresponds to a line in the results. The numbers carry far more precision than the drawing can show, so they are the ones to quote.
  4. Widen or narrow the range if a feature is missing Only what falls inside the interval is found. A curve that looks incomplete usually needs a wider window, not a different function.

How the curve and its features are found

The function is compiled once and then evaluated at 400 evenly spaced points across the interval. Everything else — the drawn curve, the zeros, the extrema — is derived from that single sample set, which is why the interval affects not just what is shown but how finely the function is examined.

Zeros are located from a sign change between consecutive samples, then bisected up to sixty times within that bracket. Each root is refined far below one sample step, so the reported value is much more precise than the plot resolution suggests. A root the curve touches without crossing produces no sign change and is not found.

Local extrema come from the derivative rather than the function values. The numerical derivative is evaluated at each sample, a sign change brackets a turning point, and bisection locates it. Maximum or minimum follows from the direction of that change — positive to negative for a maximum.

The drawn curve is deliberately broken. Where the function is undefined, or its value jumps by an outlier amount between adjacent samples, the polyline is cut so an asymptote is not drawn as a near-vertical line joining two branches. The vertical extent comes from the fifth and ninety-fifth percentiles of the samples with padding, so one extreme value cannot flatten the rest into an unreadable line.

What each input means

f(x) Function — form field “f(x)”
The expression to plot, in x. It is compiled once and then evaluated repeatedly, so any expression the parser accepts can be graphed.
[xMin, xMax] x range — form field “x range (e.g. -5, 5)”
The interval to plot over, as two comma-separated numbers. It sets both the visible window and the region searched for features.
y Vertical extent
Not entered — derived from the sampled values using the fifth to ninety-fifth percentile band with padding, so outliers do not dominate the scale.

Worked examples

Every number below is produced by the same calculation engine the tool above runs. Nothing here is typed by hand, so the walkthrough cannot drift from what you get when you enter the same values yourself.

A parabola with two roots and a minimum

Plot x² − 4 from −5 to 5. Every kind of marker appears exactly once or twice, which makes the correspondence between plot and list easy to see.

Inputs f(x) = x^2 - 4, x range (e.g. -5, 5) = -5, 5

  1. Function f(x) = x^2 - 4
  2. Range x ∈ [-5, 5]
  3. Zeros x = -2, x = 2
  4. y-intercept (0, -4)
  5. Local extrema min at x = 0.025 (y = -3.99937)

Result 2 zeros, 1 extremum on [-5, 5]

Two zeros are found, at −2 and 2, each from a genuine sign change in the sampled values. The minimum sits between them at the vertex, located from the derivative changing sign rather than from the function values themselves.

The y-intercept is marked separately with an open marker at −4. It is reported only because zero lies inside the chosen interval; shifting the window to 1 to 5 would drop that line entirely.

A rational function with a vertical asymptote

Plot 1/(x − 1) from −3 to 5. The function is undefined at 1, which is where the curve-breaking behaviour becomes visible.

Inputs f(x) = 1/(x - 1), x range (e.g. -5, 5) = -3, 5

  1. Function f(x) = 1/(x - 1)
  2. Range x ∈ [-3, 5]
  3. Zeros No real zeros found in the interval.
  4. y-intercept (0, -1)
  5. Local extrema None detected in the interval.

Result 0 zeros, 0 extremuma on [-3, 5]

The plot shows two separate branches rather than one line rising steeply through the asymptote. The polyline is cut wherever consecutive samples jump by an outlier amount, which is what prevents the spurious vertical segment.

No zeros are reported, correctly: the function never reaches zero. The sign does change across the asymptote, but the break in the samples means that change is not mistaken for a root.

Reading the result

Markers are numeric, the curve is not

The drawn line passes through 401 computed points and is smooth only in appearance. Every quantitative claim should come from the listed values, which are refined by bisection well past the precision the drawing can convey.

A break in the curve is information

Gaps are drawn deliberately, at points where the function is undefined or jumps sharply. They indicate an asymptote or a discontinuity, and joining them up mentally would misrepresent the function.

When you would use this

Checking an algebraic solution against a picture

Roots found by factoring should appear as marked zeros in the same places. A discrepancy means either an algebra error or a root outside the window, and the plot distinguishes the two.

Locating turning points before calculus

Where a maximum or minimum is wanted numerically, the marked extrema give it directly — useful as a check on a hand-computed derivative, or when that derivative is awkward to solve.

Assumptions and limitations

What this calculator assumes

  • The function is real-valued in one variable and can be evaluated at arbitrary points across the interval.
  • Features are searched for only within the chosen range; nothing outside it is reported.
  • Zeros are detected from sign changes between samples, so a root the curve touches without crossing is missed.
  • Extrema are found from the numerical derivative, so a corner or a cusp is not classified as a turning point.

Where it stops being the right tool

  • One function at a time. Plotting two curves together and finding their intersections is the multi-function grapher's job.
  • Explicit y = f(x) only: implicit relations, parametric curves and polar equations need their own tools.
  • Sampling is uniform and fixed, so behaviour finer than one four-hundredth of the interval can be missed entirely.

Common mistakes

Concluding a function has no roots from an empty list

Why it happens. The zeros line reports what was found inside the window, and a range chosen by habit rather than by inspection may simply not contain them.

How to avoid it. Widen the interval and look again. A polynomial's roots all lie within a bound set by its coefficients, so a generous window is cheap insurance.

Reading a coordinate off the drawn curve

Why it happens. The plot looks precise, and estimating from it feels quicker than scrolling to the numbers. The drawing is a 400-point polyline, and its apparent precision is not real.

How to avoid it. Quote the marker values. They come from bisection and are accurate to many more figures than the picture supports.

Expecting a repeated root to be marked

Why it happens. A curve that just touches the axis clearly has a root there, and it is visible in the plot. Detection relies on a sign change, and a touch produces none.

How to avoid it. Factor the expression, or plot the derivative as well: a repeated root is a zero of both the function and its derivative.

Frequently asked questions

What syntax does the function field accept?

Standard arithmetic with ^ for powers, together with sin, cos, tan, exp, ln, log, sqrt and abs. The constants pi and e are built in, and trigonometric functions work in radians.

Are the zeros exact?

They are numerical, not symbolic. A sign change between samples brackets each root and bisection then refines it up to sixty times, which places it far more precisely than the plot could show — but it is a computed approximation rather than an exact value.

How does it handle vertical asymptotes?

By cutting the drawn line. When the value jumps by an outlier amount between adjacent samples, as it does across the asymptote of 1/(x − 1), the polyline is broken so no spurious vertical segment is drawn.

Why does the plot not show a feature I expected?

Most often because it lies outside the chosen range, since only the given interval is sampled. It can also be a root the curve touches without crossing, or a turning point too narrow to fall between two of the 400 sample points.