Worksheets · Algebra 2

Writing piecewise functions worksheet

To write a piecewise function, write each piece’s own rule, then the x-values it covers. A filled dot means the piece includes that x, so its condition uses ≤ or ≥; an open dot means it stops just short, so its condition uses < or >. Easy writes two linear pieces from a graph, medium writes three pieces and rules for stories, and hard writes absolute value as pieces, finds the value that makes pieces meet, and works with quadratic pieces and restricted domains.

Not quite the one you need? Same words, different skill:

Select your difficulty

Pick more than one for a sheet that mixes them.

The preview can look cramped on a phone. The PDF and printed sheet come out normal.

Free math worksheets at sigmaprep.io/worksheets© 2026 Sigma Prep

Sigma Prep · sigmaprep.io/worksheets

Name

Writing Piecewise Functions

Date Period

Answer as each heading asks.

  1. Write a piecewise rule for each graph of three pieces

    Write a three-piece rule for the function graphed. None of its pieces is constant.−5−4−3−2−1012345−7−6−5−4−3−2−1012345xy
  2. Write a three-piece rule for the function graphed. Its middle piece is constant.−5−4−3−2−1012345−5−4−3−2−1012345xy
  3. Write a piecewise rule for the function graphed. One piece is a single point.−5−4−3−2−1012345−5−4−3−2−101234567891011xy
  4. Write a three-piece rule for the function graphed. Its first and last pieces are constant.−5−4−3−2−1012345−5−4−3−2−1012345xy
  1. Write a piecewise function for each story

    A phone plan costs $30 a month for up to 3 GB of data, and $5 per GB for any data over 3 GB, charged for exactly the amount used. Write the monthly cost C(d) for d GB, for d≥0, as a piecewise function.
  2. Jo earns $18 an hour for the first 35 hours of a week, and $27 an hour for each hour after that. Write Jo's pay P(h) for h hours in a week as a piecewise function.
  3. An online store charges $10 shipping on orders under $25, $7 on orders from $25 up to but not including $50, and free shipping on orders of $50 or more. Write the shipping cost S(x) for an order of x dollars as a piecewise function.
  4. A tank starts empty. It fills at 6 gallons a minute for 8 minutes, then sits full for 3 minutes, then drains at 12 gallons a minute until it is empty. Write the volume V(t), in gallons, after t minutes as a piecewise function, from t=0 until it is empty.
  1. Write a piecewise rule for each graph, then answer the question

    Write a piecewise rule for the function graphed. Then say where it is increasing, decreasing and constant.−5−4−3−2−1012345−5−4−3−2−1012345678xy
  2. Sam walks from home to a store and back. The graph shows his distance d from home, in blocks, t minutes after he leaves. Write d(t) as a piecewise function. What does the middle piece mean?0123456789012345678td
  3. Write a piecewise rule for the function graphed. At which break do the pieces meet, and at which is there a jump?−5−4−3−2−10123456−5−4−3−2−1012345xy
  4. Write a piecewise rule for the function graphed. Then solve f(x)=−4.−6−5−4−3−2−1012345−8−7−6−5−4−3−2−1012345xy

Free math worksheets at sigmaprep.io/worksheets© 2026 Sigma Prep

Sigma Prep · sigmaprep.io/worksheets

Name

Writing Piecewise FunctionsAnswer keyVersion 1

Date Period

Answer as each heading asks.

  1. Write a piecewise rule for each graph of three pieces

    Write a three-piece rule for the function graphed. None of its pieces is constant.−5−4−3−2−1012345−7−6−5−4−3−2−1012345xyf(x)={x+1x<−2−2x−2≤x≤2−3x+6x>2
  2. Write a three-piece rule for the function graphed. Its middle piece is constant.−5−4−3−2−1012345−5−4−3−2−1012345xyf(x)={x+2x<−13−1≤x≤13x−5x>1
  3. Write a piecewise rule for the function graphed. One piece is a single point.−5−4−3−2−1012345−5−4−3−2−101234567891011xyf(x)={3x+10x<−20x=−23x+10x>−2 (or 3x+10 for x≠−2, and 0 for x=−2)
  4. Write a three-piece rule for the function graphed. Its first and last pieces are constant.−5−4−3−2−1012345−5−4−3−2−1012345xyf(x)={4x≤−2−2x−2<x≤00x>0 (the pieces meet at both breaks, so either piece may include each one)
  1. Write a piecewise function for each story

    A phone plan costs $30 a month for up to 3 GB of data, and $5 per GB for any data over 3 GB, charged for exactly the amount used. Write the monthly cost C(d) for d GB, for d≥0, as a piecewise function.C(d)={300≤d≤330+5(d−3)d>3
  2. Jo earns $18 an hour for the first 35 hours of a week, and $27 an hour for each hour after that. Write Jo's pay P(h) for h hours in a week as a piecewise function.P(h)={18h0≤h≤35630+27(h−35)h>35
  3. An online store charges $10 shipping on orders under $25, $7 on orders from $25 up to but not including $50, and free shipping on orders of $50 or more. Write the shipping cost S(x) for an order of x dollars as a piecewise function.S(x)={100<x<25725≤x<500x≥50
  4. A tank starts empty. It fills at 6 gallons a minute for 8 minutes, then sits full for 3 minutes, then drains at 12 gallons a minute until it is empty. Write the volume V(t), in gallons, after t minutes as a piecewise function, from t=0 until it is empty.V(t)={6t0≤t≤8488<t≤1148−12(t−11)11<t≤15
  1. Write a piecewise rule for each graph, then answer the question

    Write a piecewise rule for the function graphed. Then say where it is increasing, decreasing and constant.−5−4−3−2−1012345−5−4−3−2−1012345678xyf(x)={−2x−1x≤−2x−2<x≤2−3x>2; decreasing for x<−2, increasing for −2<x<2, constant for x>2
  2. Sam walks from home to a store and back. The graph shows his distance d from home, in blocks, t minutes after he leaves. Write d(t) as a piecewise function. What does the middle piece mean?0123456789012345678tdd(t)={2t0≤t≤363<t≤66−3(t−6)6<t≤8; he stays 6 blocks from home for 3 minutes, at the store
  3. Write a piecewise rule for the function graphed. At which break do the pieces meet, and at which is there a jump?−5−4−3−2−10123456−5−4−3−2−1012345xyf(x)={−x−1x<−1x−1−1≤x≤3−x+5x>3; they meet at x=3 (either piece may include it) and jump at x=−1
  4. Write a piecewise rule for the function graphed. Then solve f(x)=−4.−6−5−4−3−2−1012345−8−7−6−5−4−3−2−1012345xyf(x)={3x+8x<−3−2−3≤x≤−1−x−2x>−1; x=−4 or x=2

Free math worksheets at sigmaprep.io/worksheets© 2026 Sigma Prep

How to do these

Write the rule: a line through (−3,0) and (0,3) up to a filled dot at (1,4), then the constant 1 from an open dot at (1,1)

  1. The left piece has slope 1 and y-intercept 3, so it is x + 3.
  2. Its dot at x = 1 is filled, so its condition is x ≤ 1.
  3. The right piece is the constant 1, with an open dot at x = 1, so its condition is x > 1.

The answer is f(x)={x+3x≤11x>1.

Where students go wrong

Putting x = c in both pieces, or in neither. At a break the filled dot says which piece owns it; when the pieces meet at one point, either piece may take it, but only one.

Also called writing piecewise functions from graphs, piecewise functions from a graph or piecewise function word problems.

What you can put on this worksheet

Two pieces (easy); three pieces (medium); absolute value (hard)
Write a piecewise rule for the function graphed. The two pieces meet at one filled dot. — the graph of a piecewise function, x from -5 to 5, y from -6 to 5, points (2, -4) → f(x)={−2xx≤2−12x−3x>2 (the pieces meet at x=2, so either piece may include it)
Open and filled dots (easy); stories (medium); continuity (hard)
Ana wrote f(x)={0x<02x+2x≥0 for the graph. What is wrong? Write the correct rule. — the graph of a piecewise function, x from -5 to 5, y from -5 to 6, points (0, 0) open (0, 1) → The right piece's rule is wrong: it should be 2x+1, which gives 3 at x=1: f(x)={0x<02x+1x≥0
Write the rule, then use it (easy, medium); quadratic pieces and domains (hard)
The table shows a function made of two linear pieces that change at x=2. Write a piecewise rule for it.
x−1012345f(x)−1−2−30246
→ f(x)={−x−2x<22x−4x≥2

Questions about these worksheets

Yes. Every writing piecewise functions sheet is free to print and free to download as a PDF. There is no account to make, no email to hand over and no limit on how many you take.

Yes. The answer key prints on a second page, and you can choose whether it shows each question beside its answer or just the answers in a list.

Yes. Print straight from the page, or download the PDF and print that. The sheet is laid out for paper rather than squeezed off a screen, so there is room to work under each question, and the answer key comes out on its own page.

Algebra 2 is usually taken around 10th or 11th grade, though schools vary and plenty of students meet it earlier or later. Pick the difficulty rather than the grade: the easy level suits a first lesson on it, the hard level suits review before a test.

Yes, as many as you like. The questions are built fresh each time rather than picked from a fixed set of files, so pressing Generate gives a new sheet. That is what you want for a second class, a retake, or two students sitting next to each other.

That is the closest comparison, and Kuta Software is good software. It is also paid software you install on a computer. These worksheets run in a browser tab for free, with no account and nothing to install. Like Kuta, the writing piecewise functions questions are generated when you ask for them rather than pulled from a fixed set of files, so two classes never get the same sheet, and the answer key comes with it.

Yes. There are three levels, and you can tick more than one for a sheet that mixes them, in which case the questions come out easiest first. The harder levels are not just larger numbers: they ask for something the easy ones do not.

You pick from 3: two pieces (easy); three pieces (medium); absolute value (hard), open and filled dots (easy); stories (medium); continuity (hard) and write the rule, then use it (easy, medium); quadratic pieces and domains (hard). Tick as many as you want and set how many of each, or let it spread them evenly.

Putting x = c in both pieces, or in neither. At a break the filled dot says which piece owns it; when the pieces meet at one point, either piece may take it, but only one.