In this tutorial, we are going to learn how to graph piecewise functions. In our example, we will graph the piecewise function
.
The output of our tutorial is shown below. GeoGebra has not yet developed a way to construct piecewise functions, however, its features is more than good enough for improvisation. In the construction below, we will use the function command to graph functions with specified domains. We will create manually, the two endpoints of the functions on (1,1) and (1,0). We will also use the vector tool to construct arrows.
If you want to follow this tutorial stepbystep, you can open the GeoGebra window in your browser by clicking here. The output applet of this tutorial can be viewed here.
StepbyStep Instructions
1. Open GeoGebra. In this tutorial, we will not need the coordinate Axes so be sure that it is displayed. If not, from the menu bar, click View>Axes to display it in the GeoGebra window.  
2. In graphing a piecewise function, we will use the function command of GeoGebra. The syntax of the function command is function [f,a,b], where f is the equation of the function, a is the start xvalue and b is the end xvalue. So to graph y = 1 – x with domain (∞,1] type function[1x, ∞,1] and the press the ENTER key. The ∞ symbol can is located on the dropdown list box located to the immediate right of the input box.  
3. To graph the second function, y = x^{2} from with domain (1,∞), type function[x^2,1,∞] and then press the ENTER key. Your drawing should look like Figure 1.


4. Now, using the New Point tool, construct two points with coordinates (1,0) and (1,1).  
5. We will now change the color of the point at (1,0) to black and change the color of the point at (1,1) to white. To do this, right click the point and choose the Object Properties from the context menu.  
6. In the Object Properties window, select the Color tab and choose the appropriate color.  
7. Next, we use the Vector between Two Points on the first graph to construct arrows on the graphs.


8. Next, we hide the vector points. To do this, right click the points and choose Show Object from the context menu. Your graph should look like the figure shown above.  
9. Next, use the Move Graphics View to adjust the drawing pad such that the line and curve after the vector are not shown.  
10. Save your file by clicking File>Save on the menu bar. 
How about:
f(x)=if[x<=1,1x,x^2]
oh, that’s nice. I haven’t explored the if statement yet. Well, I guess, I’ll revise this one sooner.
On second thought, as far as I know, the latest version of GeOGebra does not support nested ifs yet, so I think, they have to learn the function command to create graphs of piecewise functions with more than two equations. So I think, tutorial 32 will remain as is, for now. 🙂
very nice tutorial.. visit back, please.. 🙂
If[x2,1,2x]]
I don’t think I copied that last one correctly:
If[x2,1,2x]]
Nope. What I typed in doesn’t translate to comment properly. I did use a nested if and it works. Let me try one more time.
if[x < 0, 1, if[ x > 2, 0, 2x]]
It’s alright. Yeah, i tried it and it worked. Maybe, i’ll use it in future tutorials. Thanks. 🙂
Thanks for this information. I have quiet a few graphing program and none of them show me how to graph piecewise function.
Thanks agaim.
Do you have information how to graph greatest integer functon using geogebra?
As far as I know, it’s not yet capable of graphing GIF as of this writing.
Pingback: Top Posts for February 2011 « Mathematics and Multimedia
Pingback: Math and Multimedia 2011 Quarter 1 Top Posts « Mathematics and Multimedia
Pingback: GeoGebra Intermediate Tutorial Series