How to Graph Piecewise Functions in Desmos

How to Graph Piecewise Functions in Desmos

How to Graph Piecewise Functions in Desmosの実践テクニックを分かりやすく案内します。どなたでも必見の内容です。

Piecewise functions are all about conditions. Think of it like a choose-your-own-adventure book, but for numbers. On Desmos, the secret weapon is the curly bracket { }. This is how you tell the graph, "Hey, only run this line if this is true."

You start typing your function the normal way. For example, f(x) = x^2 gives you a nice parabola. But to make it piecewise, you add a condition after the function inside those curly braces. So you type: f(x) = x^2 {x < 0}. Boom! Now you only see the left half of the parabola, because you told Desmos to only show it when x is less than zero.

Is that not the coolest party trick? You just created a mathematical bouncer that decides which numbers get into the graph club.

The "One Rule per Piece" Dance

Now, what if you want two completely different rules for two different sections? Easy. You just stack them in the same equation line, separated by a space or a comma. Desmos is smart enough to know you're building a team.

Let’s say you want a function that is a flat line at y=1 for negative numbers, and a straight line (y=x) for positive numbers. Type this: f(x) = 1 {x < 0} and then on the same line, add x {x >= 0}. So the whole thing looks like: f(x) = 1 {x < 0} x {x >= 0}.

Hit enter, and you’ll see a bizarre but beautiful creature: a flat, horizontal line on the left that suddenly jumps into a diagonal line on the right. It’s like your function tripped over zero and changed its entire life plan.

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

石川 優花
Author

石川 優花

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