Graph with arrows using GeoGebra

Textbooks usually display graphs of polynomial functions with arrows indicating that the graph continues onward beyond what is displayed.  One can add nice arrows to graphs using GeoGebra.  Rather than walk you through step by step, here is the final product, and you can download the GeoGebra worksheet and modify it as you need it to make your own.  (Details on how to make your own sheet will follow below.)  To modify the function being graphed, open the worksheet in GeoGebra, click the box with an arrow in (the "Move" arrow) and then right click the function definition in the left-hand pane, and choose "Redefine".  Then modify the definition of the function.  Change the left-hand and right-hand limits a and b in the same way.  There is no need to change the vectors which make the arrows.

Starting with a blank GeoGebra sheet, here is how to re-create this graph.  Type the following into the Input window:


a = -2
b = 2
f = Function[x^3-x^2,a,b]
u = Vector[(b,f(b)), (b+0.01,f(b)+0.01f'(b))]
v = Vector[(a,f(a)), (a-0.01,f(a)-0.01f'(a))]

Note: The Function command sets up a function with domain restricted to [a,b].

Note: The vectors u and v are supposed to be tangent vectors.  When the curvature is high, they might not look exactly like you would like them to look.

Note: You may wish to have GeoGebra NOT display the letters u and v next to the arrows.  Right click u and v in the left-hand pane and select "Display label" to toggle off the display of the label.