# How to plot piecewise function in Wolfram|Alpha?

Posted 11 days ago
178 Views
|
5 Replies
|
3 Total Likes
|
 f(x)=[ x^2 x<0 [ x+2 0≤x≤2 [4 x>2I 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. Attachments:
5 Replies
Sort By:
Posted 10 days ago
 Thank you for your thoughtful response. I copied and pasted it, and it appeared immediately.
Posted 11 days ago
 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 10 days ago
 thank you so much,I didn't know that English speakers call this a piecewise. now i know
Posted 11 days ago
 WA understands some Mathematica commands.You can search for those commands hereSearching 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 10 days ago
 Thank you for your very kind reply. I copied and pasted it and it came out right away.