Math

Piecewise Function Calculator

Evaluate and graph piecewise-defined functions, and test continuity at a point.

Enter your values

Format: expression if condition. Conditions like x < 1, -2 <= x < 3, else.

ⓘ Live results

Results
f(1)
3
Active branch
2x + 1 (x >= 1)
Left-hand limit
0.999998
Right-hand limit
3.000002
Continuity at x
Not continuous (jump)

The one-sided limits disagree with f(x), so the graph jumps here.

Working

  1. 1Locate the branch whose condition contains x = 1 → x >= 1
  2. 2Substitute into 2x + 1
  3. 3f(1) = 3

Quick answer

A piecewise function calculator evaluates a function defined by different expressions on different intervals: it picks the branch whose condition contains your x-value, returns f(x), and checks whether the branches meet (continuity) at the breakpoints.

f(x) = { g(x) if x < a ; h(x) if x ≥ a }

How to use the Piecewise Function Calculator

  1. 1Write each branch on its own line as expression if condition.
  2. 2Enter the x-value you want to evaluate.
  3. 3The calculator selects the matching branch, substitutes x, and reports f(x).
  4. 4One-sided limits are compared with f(x) to flag jumps or holes.

Inputs explained

Function definition (one branch per line)
Format: expression if condition. Conditions like x < 1, -2 <= x < 3, else.

Worked example

Using the values the calculator loads with:

Inputs

  • Function definition (one branch per line)x^2 if x < 1 2x + 1 if x >= 1
  • Evaluate at x =1

Results

  • f(1)3
  • Active branch2x + 1 (x >= 1)
  • Left-hand limit0.999998
  • Right-hand limit3.000002
  • Continuity at xNot continuous (jump)
  1. Locate the branch whose condition contains x = 1 → x >= 1
  2. Substitute into 2x + 1
  3. f(1) = 3

Frequently asked questions

How do you evaluate a piecewise function?

Find the branch whose condition is true for your x-value, then substitute x into only that expression. Every other branch is ignored for that input.

How do I know if a piecewise function is continuous?

At each breakpoint, compare the left-hand limit, the right-hand limit and the defined value. If all three agree the function is continuous there; if they differ the graph has a jump or a hole.

What conditions can I type?

Single comparisons (x < 2, x >= -1) and compound intervals (-3 <= x < 4), plus 'else' for the remaining domain.

About this calculator

Results are estimates for general information. For medical, legal, structural or financial decisions, confirm with a qualified professional.