Type a formula in x and the grapher draws y = f(x) at once. You can plot up to five functions together, each with its own colour and its own line style (solid, dashed, dotted, dash-dot, long dash), so the lines stay distinguishable in a black-and-white printout or for anyone who does not see colour well. Beside the graph it lists, for the part of the x axis you are looking at:
- the roots of each function (where it crosses or touches y = 0),
- the y-intercept f(0),
- the turning points (local maximum and minimum),
- the intersections of every pair of functions.
The default example plots x^2 - 2 and x. The list shows roots x = −1.41421 and 1.41421 (that is ±√2), the y-intercept and minimum at (0, −2), and the two intersections (−1, −1) and (2, 2), which are the solutions of x² − 2 = x.
The formula is read by the tool's own parser and turned into a small calculation tree; your text is never run as program code.
The rules are the same as in the scientific calculator, so a formula means the same thing on both pages:
- Powers before multiplication, and powers group from the right:
2^3^2 is 2⁹ = 512. - A leading minus applies after the power:
-x^2 is −(x²), a downward parabola. Write (-x)^2 for the other one. - Implied multiplication is ordinary multiplication:
2x, 3(x+1), x sin(x) and 2pi all multiply, left to right with × and ÷. So 1/2x is (1/2)·x, a straight line; write 1/(2x) for the hyperbola. - Functions need brackets (
sin(x), not sin x) and angles are in radians: sin(x) crosses zero at 0, ±π ≈ ±3.14159, ±2π ≈ ±6.28319. x^(1/3) is undefined for negative x, as in every programming language that follows IEEE 754; use cbrt(x) for the real cube root.
Where a function is undefined, such as sqrt(x) for x < 0 or ln(x) at 0, the graph simply has a gap.
Asymptotes, jumps and how points are found
The curve is sampled once per pixel column. Between two neighbouring samples the grapher checks whether the function really climbs steeply or jumps: it halves the interval repeatedly, and a continuous curve's change shrinks while a jump's does not. That is why tan(x) is drawn as separate branches with no false vertical line at x = ±π/2, and why floor(x) looks like stairs.
Roots are found where the sign changes between samples, then refined by bisection to about twelve significant digits. A sign change across a pole (tan at π/2) or a step is rejected because the function does not get close to zero there. A root where the curve only touches the axis, like x = 1 of (x-1)^2, has no sign change; it is found as a point where |f| has a minimum that reaches zero. Turning points are refined by searching for the place where the slope changes sign, so the minimum of x² − 2 is reported at exactly (0, −2) and the turning points of x^3 - 3x at (−1, 2) and (1, −2).
The results are numerical and limited to what you can see: zoom out to look for more roots, and remember that two roots closer together than a pixel-sized step may be reported as one. Results are shown to six significant digits. To solve the same equations exactly, with the steps written out, use the equation solver; for a reading guide to roots, intercepts and asymptotes, see how to read a function's graph.