Message Boards Message Boards

0
|
3298 Views
|
5 Replies
|
3 Total Likes
View groups...
Share
Share this post:

How to plot piecewise function in Wolfram|Alpha?

Posted 1 year ago

f(x)=[ x^2 x<0
[ x+2 0≤x≤2
[4 x>2

I want to draw a graph of this function through Wolfram Alpha.
I googled it for 3 hours, but I have no idea.
I'd appreciate it if you could tell me the commands to enter.

Attachment

Attachment

POSTED BY: kor mathchobo
5 Replies
Posted 1 year ago

Thank you for your thoughtful response. I copied and pasted it, and it appeared immediately.

POSTED BY: Robin Hood

This might be what you want.

f[x_] := Piecewise[{{x^2, x < 0}, {x + 2, 0 <= x <= 2}, {4, x > 2}}] Plot[f[x], {x, -4, 4}]

Posted 1 year ago

thank you so much,I didn't know that English speakers call this a piecewise. now i know

POSTED BY: kor mathchobo
Posted 1 year ago

WA understands some Mathematica commands.

You can search for those commands here

Searching for piecewise there provides documentation.

This appears to work in WA

piecewise[{{x^2,x<0},{x+2,0<=x<=2},{4,x>2}}]
POSTED BY: Bill Nelson
Posted 1 year ago

Thank you for your very kind reply. I copied and pasted it and it came out right away.

POSTED BY: kor mathchobo
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract