website page counter
How To Do A Piecewise Function In Desmos

Let’s talk about Desmos. That magical graphing calculator that makes math feel like art.

Yes, even piecewise functions. You know, those scary math problems with curly brackets and multiple conditions? They’re actually a blast to build.

Think of it like writing a choose-your-own-adventure book. This part of the graph happens here, that part happens there. Desmos makes it ridiculously simple.

The secret sauce? The curly brackets.

Type this: y = {x < 0: x^2, x >= 0: x+1}. Hit enter. Boom. You just made two graphs that switch at zero. It’s like a math light switch.

The format is: {condition: output}. If the condition is true, Desmos shows that formula. If false, it moves to the next part.

Here’s the fun part. You can layer these like a mathematical lasagna. Want three pieces? No problem. Just add more commas and conditions.

Graphing Piecewise Functions Calculator Desmos at Anna Crace blogGraphing Piecewise Functions Calculator Desmos at Anna Crace blog

Try y = {x < -2: 3, -2 < x < 2: x^2, x > 2: 5}. You just created a flat line, then a parabola, then another flat line. It’s like a graph doing yoga poses.

The “Quirky” Secret No One Tells You

You can also use inequalities to shade regions. Type y = {x > 0: x^2} and Desmos only draws the right half of the parabola. It’s like your graph has a curfew.

Want to make a discontinuous jump? Leave a gap on purpose. Type y = {x < 1: 2, x > 1: 4}. Notice the hole at x=1? That’s a tiny mathematical black hole. No value exists there. Wild.

You can even use trig functions inside piecewise. Try y = {x < pi: sin(x), x >= pi: cos(x)}. You just made a graph that switches instruments mid-song.

eat play math: How DESMOS changed the way I teach.eat play math: How DESMOS changed the way I teach.

Why This is Fun

Piecewise functions let you break the rules. Normal graphs are smooth. Boring. Piecewise graphs can jump, skip, and hide. They’re the rebellious teenagers of the math world.

You can make a graph that spells “HI” using piecewise lines. Try it. Use short line segments with different domains. It’s like connect-the-dots for adults.

Pro tip: Use sliders to animate your piecewise function. Add a variable inside the condition, like a. Then slide that slider. Watch your graph’s pieces wiggle and slide apart. Pure visual candy.

Common Goofs (And Laughs)

Forget a closing bracket? Desmos throws a red error at you. It’s the app’s way of saying “nope, try again.” Just count your brackets. It’s like making sure all your Tupperware lids are on.

How to do piecewise functions on Desmos Graph Calculator?How to do piecewise functions on Desmos Graph Calculator?

Put a condition backwards? Your graph might disappear entirely. Don’t panic. Just swap the inequality sign. It’s turned around, like your socks.

And here’s a weird one: you can’t have overlapping domains. If two conditions are true at the same x, Desmos picks the first one. It’s a little lazy about it. Math drama!

Final Challenge

Go make a piecewise function that looks like a spaceship. Use a parabola for the cockpit, lines for wings, and a flat top for the roof. Share it with a friend. They’ll think you’re a wizard.

Piecewise functions in Desmos aren’t just homework. They’re your chance to draw with math. So go break some graphs. It’s allowed. Actually, it’s encouraged.

Now go type some curly brackets. Click enter. Smile at your weird, wonderful, jumpy creation.