Multi-Function Grapher
Enter two functions of x and an interval. The calculator plots them on a single chart and finds every intersection by bracketing sign changes of f(x) − g(x) and refining with bisection.
An equation solved by subtraction
Solving f(x) = g(x) and finding where two curves cross are the same question asked in two languages. The algebraic version can be intractable — there is no formula for where a parabola meets an exponential — while the geometric version is always answerable by looking.
This grapher draws both functions on one set of axes and marks every point where they meet on the interval, reporting the coordinates numerically.
Two curves intersect exactly where their difference is zero, so the whole problem reduces to root-finding on a single function that is never drawn. That reformulation is what makes the method work regardless of what the two functions are: no algebra needs to succeed, only sampling.
The picture then does something the numbers cannot. It shows how many crossings to expect, whether the curves are tangent or cutting through, and what happens between the marked points — which is how you know the list is complete rather than merely non-empty.
How to use this calculator
- Enter the two functions Both in x, using the standard operators and named functions. They are drawn in different colours and labelled, so the order affects only presentation.
- Set the interval Two comma-separated numbers. Intersections outside it are neither found nor drawn, so the window is part of the question.
- Read the marked crossings Each intersection is marked on the plot and reported as a coordinate pair. The values come from refinement, not from the drawing.
- Check the shape between the markers If the curves appear to touch somewhere unmarked, the crossing was a tangency rather than a cut — which the method cannot detect.
How the intersections are located
Both functions are compiled and sampled at the same 400 evenly spaced points across the interval, and a third sequence is formed by subtracting one set of values from the other. That difference is the function actually searched, and it is zero precisely where the two curves meet.
A sign change between neighbouring samples of the difference brackets a crossing, and bisection on the difference then narrows the bracket repeatedly until the root is pinned down far below one sample step. The reported y-coordinate is taken by evaluating the first function there.
The vertical extent of the plot is derived from both sample sets together rather than from either alone, and padded, so neither curve is clipped to make room for the other. Each is drawn as a broken polyline where its own values jump or go undefined, so an asymptote in one curve does not distort the other.
Only sign changes are found. Where the curves touch without crossing — a tangency — the difference reaches zero and comes back with the same sign, producing no bracket and therefore no marker, even though the curves genuinely meet there.
What each input means
- f(x) First function — form field “f(x)”
- Drawn as the primary curve. Its value at each root supplies the reported y-coordinate.
- g(x) Second function — form field “g(x)”
- Drawn as the secondary curve. At an intersection both functions agree, so either could supply the height.
- [xMin, xMax] Interval — form field “x range”
- The window drawn and searched. Crossings outside it are invisible to the calculation entirely.
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 meeting a line
Plot x² against 2x + 3 from −3 to 5. Their difference is a quadratic with two real roots, so there are exactly two crossings.
Inputs f(x) = x^2, g(x) = 2*x + 3, x range = -3, 5
- Function f f(x) = x^2
- Function g g(x) = 2*x + 3
- Range x ∈ [-3, 5]
- Intersections (-1, 1), (3, 9)
Result 2 intersections
The two intersections are at whole-number values, which is unusual and makes this a good first case. The same points come from setting the difference to zero and factoring — the numerical route reaches them without any factoring at all.
Between the crossings the line sits above the parabola and outside them the parabola is higher. That ordering is exactly what solving the corresponding inequality would report, read straight off the picture.
Two waves crossing repeatedly
Plot sine against cosine over one full turn. They cross twice in that span, at points with no tidy decimal form.
Inputs f(x) = sin(x), g(x) = cos(x), x range = 0, 6.28
- Function f f(x) = sin(x)
- Function g g(x) = cos(x)
- Range x ∈ [0, 6.28]
- Intersections (0.785398, 0.707107), (3.92699, -0.707107)
Result 2 intersections
Both crossings occur where the two functions are equal in value, and by symmetry they sit half a turn apart. The reported coordinates are irrational and given as decimals, which is the ordinary situation.
Extending the interval would find more crossings, since both functions repeat forever. The count reported is always the count within the window, never a claim about the whole line.
An exponential overtaking a polynomial
Plot exp(x) against x³ from −1 to 4. The curves cross more than once, and the exponential eventually wins.
Inputs f(x) = exp(x), g(x) = x^3, x range = -1, 4
- Function f f(x) = exp(x)
- Function g g(x) = x^3
- Range x ∈ [-1, 4]
- Intersections (1.85718, 6.40567)
Result 1 intersection
Neither function dominates across the whole interval, which is why there is more than one crossing. Exponential growth ultimately outpaces any polynomial, but the region where it has not yet done so can be surprisingly wide.
This pair has no closed-form solution: the equation cannot be solved by algebra at any level. It is the case that makes numerical intersection-finding necessary rather than merely convenient.
Reading the result
Which curve is on top, and where
Between consecutive crossings the ordering cannot change, so a single glance settles the corresponding inequality on each stretch. Reading the picture that way answers more than the marker list does.
A tangency leaves no marker
Curves that touch and separate again produce no sign change in their difference, so nothing is reported. If the plot shows them meeting where no marker appears, that is the reason rather than an oversight.
The count is a count within the window
Widening the interval can only add crossings. An empty list means the curves do not meet on the range chosen, not that they never meet.
When you would use this
Solving an equation with no algebraic route
Equations mixing a polynomial with an exponential, a logarithm or a trigonometric function generally have no closed-form solution. Plotting each side as a function and reading the crossings is the practical answer.
Comparing two models over a range
Where two formulas describe the same quantity, the crossings mark where they agree and the ordering between them shows which is larger on each stretch.
Assumptions and limitations
What this calculator assumes
- Both functions are real-valued in one variable and can be evaluated across the interval.
- Intersections are found from sign changes in the difference, so only crossings are detected.
- Only the chosen interval is sampled and searched.
- The reported height comes from evaluating the first function at the located root.
Where it stops being the right tool
- Two functions at a time; a third has to be compared pairwise.
- Tangential contact is not reported, since it produces no sign change.
- Sampling is uniform and fixed, so two crossings closer together than one sample step can both be missed.
- Regions where the curves coincide over a whole stretch are not identified as such.
Common mistakes
Concluding the curves never meet from an empty list
Why it happens. The result reads as a statement about the functions, when it is a statement about the window that happened to be chosen.
How to avoid it. Widen the interval and look again. Two curves that diverge inside the window may well have crossed outside it.
Missing a tangential meeting
Why it happens. The plot shows the curves touching, and every other meeting has been marked, so the absence of a marker reads as a claim that they do not meet.
How to avoid it. Look for the difference having a repeated root. Where the curves touch without crossing, no bracketing method will find it.
Reading coordinates off the plot
Why it happens. The markers are visually precise and the axes are labelled, so estimating from the picture feels reliable.
How to avoid it. Use the reported values. They come from bisection on the difference and carry far more precision than the drawing.
Frequently asked questions
How are intersections found?
By subtracting one function from the other and finding the roots of the result. A sign change between neighbouring samples brackets a root, and bisection then refines it to many significant figures — well beyond what the plot could show.
What if there are no intersections?
Both curves are drawn with no markers, and the calculation reports that they do not meet on the interval. That is a statement about the chosen window, so widening it may change the answer.
Can I plot more than two functions?
Not on one chart. Two are drawn at a time, which is also what the intersection method needs, since it works on the difference of exactly two functions. A third can be compared against each of the first two in turn.
Why is a visible meeting sometimes not marked?
Because the curves touch without crossing. The difference reaches zero and returns with the same sign, so no bracket forms and the bisection search never starts there.