MHB Graphing Functions with Limits on WolframAlpha

  • Thread starter Thread starter Taryn1
  • Start date Start date
  • Tags Tags
    Confusion
AI Thread Summary
To graph a piecewise-defined function in WolframAlpha, users can input the function using a specific syntax. The example function provided is h(x) = 4 - x^2 for x < -2, h(x) = 3 + x for -2 ≤ x < 0, and h(x) = x^2 + 1 for x ≥ 0. A suggested input format is: plot(piecewise(((4-x^2,x<-2),(3+x,-2 <= x < 0),(x^2+1,x>=0)))) {x,-5,5}. This method allows for setting limits on the x-value's domain effectively. Users can refer to additional resources for more complex formatting options.
Taryn1
Messages
25
Reaction score
0
Hi again I'm trying to graph a function in WolframlAlpha, but I can't figure out how to set limits on the x-value's domain. Is that an option for that site? I'm trying to do this function set:

_____ 4-x^2, x < -2
h(x) = 3 + x, -2 \le x < 0
_____x^2 + 1, x \ge 0

It's hard enough to figure out how to enter that in here, even more so to figure out to enter it into WolframlAlpha!

And that's like a set of a function, you know, it would usually be written with one large { to the left of the three equations and to the right of the h(x).

Editing again! the \le means 'equal to or less than' and the \ge means 'equal to or greater than'. I can't get the fancy math symbols to work...

Help! (Sweating)
 
Last edited:
Physics news on Phys.org
Welcome to MHB, Taryn!

Ah, I see you are attempting a piecewise-defined function:

$$h(x)=\begin{cases}4-x^2,\quad x<-2 \\ 3+x,\quad -2\le x<0 \\ x^2+1,\quad x\ge 0 \end{cases}.$$

(Right-click this nice mathy stuff, and you can see the $\LaTeX$ code that makes it tick.)

Is that correct? Yeah, that's a bit tricky in WolframAlpha (aka W|A). You might try this convoluted thing:

Code:
plot(piecewise(((4-x^2,x<-2),(3+x,-2 <= x < 0),(x^2+1,x>=0)))) {x,-5,5}

It seemed to work. I got this tip off of this video, and added the $-5\le x\le 5$ domain as an afterthought, which W|A interpreted correctly.
 
Cool. Thanks so much for the help!
 
Back
Top