Graphing Calculator: Plot Functions and Find Roots, Intersections, Maxima and Minima
By FindMySum · Last reviewed
A graphing calculator draws the curve y = f(x) for a formula you type and lets you read its important points off the graph: where it crosses the x-axis, where it peaks and dips, and where two curves meet. This one plots up to four functions at once, finds those points numerically, gives a table of values and the value of every function at an x of your choice, and keeps the whole graph, window included, in a link you can share.
What a graph of a function shows
A function assigns one output y to each input x. Its graph is the set of points (x, f(x)), so reading the graph is reading the function. The features a maths course asks about are:
- Roots, zeros or x-intercepts: the x values where f(x) = 0, where the curve meets the horizontal axis.
- The y-intercept: f(0), where the curve meets the vertical axis.
- Local maxima and minima (turning points): points higher or lower than everything close to them.
- Intersections: points where two curves have the same y for the same x, which solve the equation f₁(x) = f₂(x).
- Asymptotes and gaps: places where the function is undefined or runs off to infinity.
How the calculator finds each point
The formula is read with the same rules as a scientific calculator: ^ for powers, implied multiplication (2x means 2 × x), log for the base-10 logarithm and ln for the natural one, and trig functions in radians. It is then evaluated as a plain floating-point function; nothing is run as code.
Drawing. The curve is evaluated at 401 points across the window. Points where the function is not a real number (the square root of a negative, the log of zero) are left out, and a jump from a very large value to a very large value of the other sign between neighbouring points is treated as an asymptote, so the line is broken instead of joined.
Roots. The window is scanned at 2,001 points. Wherever f(x) changes sign between neighbours, the interval must contain a root (for a continuous function, by the intermediate value theorem), and Brent's method narrows it down. Brent's method, published by Richard Brent in 1973, combines safe bisection with faster secant and inverse-quadratic steps and reaches full double precision in a handful of steps. A sign change can also happen across a pole, as with 1/x at 0; there f is not close to zero, so the point is rejected. A root where the curve touches the axis without crossing, like x² at 0, has no sign change; it is found as a minimum or maximum whose value is zero.
Maxima and minima. A grid point higher than both neighbours brackets a local maximum (lower for a minimum). Brent's minimisation, a golden-section search with parabolic steps, refines it, and a final root search on the slope adds digits. End points of the window are not counted, because the curve may keep rising beyond them.
Intersections. For each pair of functions the calculator finds the roots of the difference f₁(x) − f₂(x) and reports each crossing with its y value.
Worked example
The calculator opens with f₁(x) = x³ − 3x and f₂(x) = 2 sin x on the window from x = −3 to 3.
- Roots of f₁. Factor: x³ − 3x = x(x² − 3), so the roots are 0 and ±√3. The calculator lists −1.732050808, 0 and 1.732050808.
- Turning points. The derivative 3x² − 3 is zero at x = ±1. f₁(−1) = −1 + 3 = 2 and f₁(1) = 1 − 3 = −2, so there is a local maximum at (−1, 2) and a local minimum at (1, −2), which the calculator finds numerically.
- Value at a point. At x = 1, f₁(1) = −2 and f₂(1) = 2 sin 1 ≈ 1.682941970.
- Intersections. x³ − 3x = 2 sin x has no algebraic solution apart from x = 0, which is the point where numeric methods earn their keep. The calculator finds three crossings in the window: x = 0 and x ≈ ±1.981305042, where both curves are at y ≈ ±1.833835851.
The table of values below the graph gives each function at 11 evenly spaced x values across the window, a quick check on the shape of the curve and handy for sketching it by hand.
Choosing a good window
Most surprises on a graphing calculator come from the window. A few habits help:
- Start wide, then zoom in. A window of −10 to 10 shows the overall shape; zoom in on each feature to read it accurately. The zoom buttons halve or double the window about its centre.
- Fix the y axis when one value dominates. The automatic fit uses the whole range of values, but trims isolated spikes near asymptotes. If a steep curve squeezes the others flat, set the y range yourself.
- Mind the units of angles. Trig here is in radians, so sin x repeats every 2π ≈ 6.28. A window of −3 to 3 shows about one period.
- Look outside the window for the full story. Roots and extrema are only searched for inside the window. A cubic always has at least one real root, but it might sit off to the side.
Limits of a numeric graph
Numeric root finding gives answers to about 10 significant figures, not exact forms: √2 appears as 1.414213562. That is enough for homework checks, engineering and science, but if you need the exact form, solve algebraically (the equation solver shows the working for linear, quadratic and cubic equations). A curve that touches the axis between two grid points without crossing, or oscillates faster than the grid (sin(1/x) near 0), can hide a root; zooming in reveals it. Functions are evaluated only where they are real numbers, so complex roots of polynomials do not appear.
Using a graph to solve equations
Any equation in one unknown can be solved on a graph. To solve x³ = 2x + 1, either enter both sides as separate functions and read the intersections, or move everything to one side and read the roots of x³ − 2x − 1. The two approaches give the same x values (−1, and (1 ± √5)/2 ≈ 1.618 and −0.618). The graph also shows how many solutions there are, which algebra alone does not always make obvious, and whether a solution is a clean crossing or a near-miss where the curves only just touch.
More questions
What is the difference between a root, a zero and an x-intercept?
They describe the same x values from different angles. A root or zero of f is a solution of f(x) = 0; an x-intercept is the point (x, 0) where the graph meets the horizontal axis. A polynomial of degree n has at most n real roots, so a cubic crosses the x-axis at most three times.
How do I know if I have found every root?
Only the window is searched, so a root outside it is not listed. Zoom out to see the overall shape first: polynomials eventually head to plus or minus infinity, and periodic functions such as sin x repeat. Then zoom in on each crossing. For polynomials, the degree tells you the maximum number of real roots to look for.
Why does my answer read 0.9999999999 instead of 1?
The calculator works in double-precision floating point, about 16 significant digits, and numeric methods stop when the answer is as close as that precision allows. It shows 10 significant figures and rounds values within a billionth of the window width of zero to 0, so most such cases read exactly, but a turning point found by minimisation can still show a small last-digit error.
Can I graph a vertical line like x = 2 or a circle?
Not directly: this calculator graphs functions y = f(x), which give one y for each x. A vertical line is not a function of x, and a circle x² + y² = r² needs two functions: enter sqrt(4 - x^2) and -sqrt(4 - x^2) to draw a circle of radius 2.
What window should I use for trigonometric functions?
Trig functions here take radians, so one full period of sin x or cos x is 2π, about 6.28. A window from −7 to 7 shows two periods each side of the y-axis. For tan x, fix the y axis to something like −10 to 10 so the curve between the asymptotes is readable.
Sources
This article explains how the calculator works and is general information, not financial, tax, legal or medical advice. Rules change; check the sources above or a qualified professional before you act.