How can I graph a piecewise function in Desmos?

Hi everyone, I’m currently trying to graph a piecewise function in Desmos, but I’m not quite sure how to do it. The function I’m working with is f(x) = { 2x + 1 if x ≤ 0, 4x - 3 if x > 0 }. I’ve tried entering it as two separate functions, but that doesn’t seem to work. I also tried using the “piecewise” function in Desmos, but I’m not sure how to properly format it. Can anyone help me with this? Thanks in advance!
easeus data recovery crack download

1 Like
f(x)={x<=0:2x+1, 4x-3}


This can be extended to additional pieces, where you have {condition 1:expression 1, condition 2:expression 2, … , “otherwise” expression}


To graph a piecewise function in Desmos, you can follow these steps.

  1. Open the Desmos graphing calculator in your web browser
  2. Define your piecewise function using curly braces and separate each piece with a comma. Each piece should be defined using the if function, which has the syntax: if(condition, value_if_true, value_if_false).
    For example, let’s say you have a piecewise function defined as follows:

f(x) = {
2x, if x < 0,
x^2, if 0 <= x <= 2,
sqrt(x - 2) + 2, if x > 2

In Desmos, you would write this as:

f(x) = 2x {x < 0} + x^2 {0 <= x <= 2} + sqrt(x - 2) + 2 {x > 2}

After that, enter the piecewise function in the expression input field in Desmos then Press the “Enter key or click the “+” button to graph the function.

Desmos will then plot the graph of your piecewise function based on the conditions and values specified.

This method doesn’t work for me, which is likely because pieces of this are undefined so no sum can be determined. @Daniel_Wekselgreene gives the correct conditional notation for Desmos, which is:

{condition: value_if_true, value_if_false}

and you can nest them…

{condition: value_if_true, condition2: value_if_true2, value_if_false}

That post reads to me like the AI bot-driven spam posts that have been appearing. I wonder what that’s all about.

LOL. Just makin’ stuff up when it doesn’t know.

This might be a bit late by the format is f(x)={condition:function}. Then repeat that with commas after function. for example f(x)={x<2:2,x>2:x}. Will graph f(x)=2 when x <2 and f(x)=x when x>2.


Also if your function gets complicated, use this notation:

f(x) = x + 1 { x < 0 }

and simply add more lines. This makes it easier to read imo