Free calculatorLive resultsSteps and sourcesEmbed on your site, free

Piecewise Function Calculator

Piecewise Function Calculator works out Function plotted and Value at the query point from Function, Second function (optional) and Variable. The default figures on this page give function plotted of x^2 for x < 0; 2 * x + 1 for x >= 0; change any entry and the result, the working and the sources update together.

Function plotted
x^2 for x < 0; 2 * x + 1 for x >= 0
Graphing Calculator
Smallest sampled value
0.0625
Largest sampled value
25
y-intercept
1
Samples inside the domain
41
SVG path for the curve
M 0 0 L 16 39.098 L 32 76.19 L 48 111.278 L 64 144.361 L 80 175.439 L 96 204.511 L 112 231.579 L 128 256.642 L 144 279.699 L 160 300.752 L 176 319.799 L 192 336.842 L 208 351.88 L 224 364.912 L 240 375.94 L 256 384.962 L 272 391.98 L 288 396.992 L 304 400 L 320 384.962 L 336 376.942 L 352 368.922 L 368 360.902 L 384 352.882 L 400 344.862 L 416 336.842 L 432 328.822 L 448 320.802 L 464 312.782 L 480 304.762 L 496 296.742 L 512 288.722 L 528 280.702 L 544 272.682 L 560 264.662 L 576 256.642 L 592 248.622 L 608 240.602 L 624 232.581 L 640 224.561
Worked out from OpenStax College Algebra 2e, section 3.2 Domain and Range and 3 other sources.

Your figures

Updates as you type
y = f(x), or z = f(x, y) in 3D mode. In piecewise mode separate the branches with "|".
A second curve g(x). Its intersections with f(x) are reported.
Ignored in 3D mode, which always uses x and y.
Points on the x grid, endpoints included.
Ascending cut points. Each branch applies from its breakpoint up to the next one.
In parametric mode the "Function" field is x(t) and this one is y(t).

How this is worked out

4 steps
  1. f(x) = x^2 for x < 0; 2 * x + 1 for x >= 0
  2. Sampled 41 points on [-5, 5] at x_i = -5 + 10 * i / 40.
  3. Sampled range: 0.0625 to 25 over 41 of 41 points.
  4. No sign change or exact zero was found on the sampled grid.
Sampled pointstable
xy
-525
-4.7522.5625
-4.520.25
-4.2518.0625
-416
-3.7514.0625
-3.512.25
-3.2510.5625
-39
-2.757.5625
-2.56.25
-2.255.0625
-24
-1.753.0625
-1.52.25
-1.251.5625
-11
-0.750.5625
-0.50.25
-0.250.0625
01
0.251.5
0.52
0.752.5
13
1.253.5
1.54
1.754.5
25
2.255.5
2.56
2.756.5
37
3.257.5
3.58
3.758.5
49
4.259.5
4.510
4.7510.5
511

Its 6 worked examples are re-run on every release, last on 15 September 2026. What changed

Sources and references

4 sources
OpenStax College Algebra 2e, section 3.2 Domain and Range
Definition of the graph of a function, its domain, range and intercepts.
OpenStax College Algebra 2e, section 3.4 Composition of Functions / piecewise definitions
Piecewise-defined functions: one branch per interval of the domain.
Burden & Faires, Numerical Analysis, section 2.1 (the Bisection Method)
A sign change on a bracket of a continuous function contains a root; bisection converges to it.
W3C Scalable Vector Graphics (SVG) 1.1, section 8.3 Path data
The moveto/lineto path grammar used for the returned plot path.

What the Piecewise Function Calculator calculates

Plots y = f(x), a piecewise function or a z = f(x, y) surface over a chosen domain, returning the sampled points, the range, the intercepts, the zeros and any intersection with a second curve.

How to use this Piecewise Function Calculator

Enter Function, Second function (optional), Variable and x from. Function plotted updates as you type. Change one figure at a time to see what drives the result.

How the result is worked out

Open “How this is worked out” beside the result for the step-by-step calculation behind Function plotted, Value at the query point and Smallest sampled value.

The method follows OpenStax College Algebra 2e, section 3.2 Domain and Range, OpenStax College Algebra 2e, section 3.4 Composition of Functions / piecewise definitions, Burden & Faires, Numerical Analysis, section 2.1 (the Bisection Method) and W3C Scalable Vector Graphics (SVG) 1.1, section 8.3 Path data.

What you can compare

Change one input at a time to see how it affects Function plotted, Value at the query point and Smallest sampled value. The inputs you can vary are Function, Second function (optional), Variable, x from, x to and Sample points.

Results are general information, not financial, tax, legal, medical or engineering advice. Check any decision that matters with a qualified professional.

Embed this calculator on your website

Copy this code into any page. The calculator appears with the figures currently entered, sizes itself to fit, and a small credit line links back here. Free, no account, no ads inside it, no tracking of your readers. Set your own figures and fixed fields; Personal removes the credit line, sets your colour and shows you which sites use it.

Preview

See something wrong? Report a problem with this calculator

Frequently asked questions

How to get piecewise function on calculator?

Plots y = f(x), a piecewise function or a z = f(x, y) surface over a chosen domain, returning the sampled points, the range, the intercepts, the zeros and any intersection with a second curve. Open “How this is worked out” beside the result to see each step for your own figures.

Can you do piecewise functions on TI-84?

Plots y = f(x), a piecewise function or a z = f(x, y) surface over a chosen domain, returning the sampled points, the range, the intercepts, the zeros and any intersection with a second curve. On the figures this page opens with — x from -2, x to 2 and evaluate at x -1 — the function plotted is x² for x < 0; 2 * x + 1 for x >= 0. Put your own figures in their place and the working updates beside the result.

How to calculate a piecewise function?

It needs Function, Second function (optional), Variable, x from, x to and Sample points. Nothing else is required, and the figures stay in your browser.

How to graph a piecewise function calculator?

The result gives Function plotted, Value at the query point, Smallest sampled value, Largest sampled value, y-intercept and Zeros in the interval, each labelled with its unit so the figure can be read on its own.

What information do I need for the Piecewise Function Calculator?

You need Function, Second function (optional), Variable, x from, x to, Sample points, Piecewise breakpoints and Evaluate at x. The page opens with default figures that give function plotted of x^2 for x < 0; 2 * x + 1 for x >= 0, so you can see the scale before entering your own.

What does this Piecewise Function Calculator show?

It shows Function plotted, Value at the query point, Smallest sampled value, Largest sampled value, y-intercept, Zeros in the interval, Intersections with the second curve and Sampled points, with the working and any warnings for your entries.

Related calculators

View all related calculators8 more