Short answer: to graph a piecewise function in Desmos, put the pieces inside curly braces, with each condition followed by a colon and the formula: f(x) = {x < 0: -x, x ≥ 0: x^2}. Separate the pieces with commas. This works in the Desmos calculator built into the digital SAT.
The syntax, step by step
- Open curly braces: type
{. - Write the condition first: an inequality in x, like
x < 2. Type<=to get ≤. - Add a colon, then the formula for that piece:
x < 2: 3x + 1. - Add a comma, then the next piece:
, x ≥ 2: 7. - Close the braces:
}.
Full example: f(x) = {x < 2: 3x + 1, x ≥ 2: 7}. Both pieces meet at (2, 7), because 3(2) + 1 = 7.
Three shortcuts worth knowing
- Default piece: leave the last piece without a condition and it applies everywhere else:
{x < 0: -x, x}. That graphs the same thing as |x|. - Restrict one equation: to show only part of a graph, put the condition after it:
y = x^2 {-2 < x < 2}. - Evaluate a value: after defining
f(x), typef(5)on a new line and Desmos shows the answer. This is the fastest way to check a piecewise question on test day.
Worked example: evaluating a piecewise function
Suppose g(x) = {x ≤ -1: -4, -1 < x ≤ 3: x^2 + 2, x > 3: 4x - 1}. What is g(3) + g(4)?
- g(3): 3 fits the middle piece (−1 < 3 ≤ 3), so g(3) = 32 + 2 = 11.
- g(4): 4 fits the last piece (4 > 3), so g(4) = 4(4) − 1 = 15.
- Answer: 11 + 15 = 26.
The trap is the boundary. At x = 3 you must use the piece whose condition includes 3 (≤), not the one that starts after 3. In Desmos, typing g(3) + g(4) gives 26 right away.
Where piecewise shows up on the SAT
The most common case is absolute value. |x − a| is really a piecewise function: x − a when x ≥ a, and a − x when x < a. Hard SAT questions use this when they ask how many solutions an absolute value equation has. Two hard examples, fully solved, are in our hard SAT math practice test.
Practice more Desmos skills
- The full Desmos guide covers every shortcut for SAT Math.
- Hard SAT algebra questions and hard SAT math questions, each with a worked solution.
- Targeted Practice builds sets from the math skills you miss.
Practice with Desmos the way you will use it on test day.
Take a free full-length practice test with every math answer explained.
Frequently asked questions
How do you write a piecewise function in Desmos?
Use curly braces with condition: formula pairs separated by commas, like {x < 0: -x, x ≥ 0: x^2}.
How do I type ≤ in Desmos?
Type <= and Desmos turns it into ≤.
Can I use Desmos on the SAT?
Yes. The Desmos graphing calculator is built into Bluebook for the whole Math section.
Desmos for SAT Math
This guide is part of Desmos Guide: Complete Guide, Practice Plan, and Resources.
Related guides:
Explore every SAT hub
- Digital SAT Complete Guide Format, scoring and a full study plan
- Advanced Math and Vocabulary Hub Hard math topics and high-value words
- SAT Grammar Guide Every grammar and punctuation rule
- SAT Reading Guide Reading question types and strategies
- SAT Practice Tests Guide Official tests and how to use them
- Desmos Guide Calculator shortcuts for SAT Math
- SAT Scores by College Ranges and testing policies for 43 schools
- PSAT Guide PSAT/NMSQT, PSAT 10, PSAT 8/9 and National Merit
- Test Strategy Hub Timing, pacing and prep resources
- SAT Predictions Questions most likely to repeat
Sources
- Desmos, Restrictions (Learn Desmos).
- Desmos Help Center, Actions (piecewise expressions).
- College Board, The Math Section: Overview.
Frequently Asked Questions
How do you write a piecewise function in Desmos?
Use curly braces with condition: formula pairs separated by commas.
How do I type less than or equal to in Desmos?
Type <= and Desmos converts it.
Can I use Desmos on the SAT?
Yes, it is built into Bluebook for the whole Math section.