How to Graph Piecewise Functions Desmos

How to Graph Piecewise Functions Desmos

How to Graph Piecewise Functions Desmosを効率よく進めるためのおすすめの方法をピックアップして解説します。

Here’s the secret sauce. Desmos uses curly braces { } to set conditions. You type the function, then the condition inside those braces. Example: y = x + 1 {x < 0}. That’s it. The graph only shows up for negative x values.

Want two pieces? Just add another line. Or, if you’re feeling fancy, use a single line with multiple conditions. Like this: f(x) = {x < 0: x+1, x >= 0: x^2}. That colon (:) acts like a “then” command. It’s dangerously simple.

Pro tip: Don’t forget the commas between conditions. Desmos will ghost you and give you an error if you skip them. It’s petty like that.

Step 1: Open Desmos and Relax

Go to desmos.com. Don’t panic. The blank grid is your blank canvas. Breathe. You’re not back in high school detention.

Click into the first expression line. Type your first piece. Let’s say: y = 2x + 1 {x <= 3}. Boom—a line appears only up to x = 3. You can drag the little blue dot at the endpoint to adjust the boundary visually. How cool is that?

Step 2: Stack the Pieces

Now add a second line. Type: y = 5 {x > 3}. This gives you a flat horizontal line for all x greater than 3. You now have a weird but beautiful function that climbs, then goes flat. Congratulations—you just Frankensteined a function.

Want to add a third piece? Go for it. Desmos doesn’t judge. Add a parabola, a sine wave, even a polar petal. Just remember the curly braces and the colon if you’re using the compact syntax.

井上 凛
著者

井上 凛

心身ともに健康で持続可能なライフスタイルをテーマに、最新のウェルネストレンドを発信中。