Applet Introduction
The calculus applets are all based on the Web Components for Mathematics library and developed with the Java programming language. A typical applet, for graphing a function, appears below.
Try the following:
- At the top of the applet is a drop down menu of
examples. Click on it to drop down the menu, then click on one of the
selections. Note that the function definition (just below the graph)
changes, as does the graph itself. Many of the applets have an examples
menu at the top.
- You can type your own function definition.
Click-drag over the current function definition and type a new one, such
as x^3, then press Enter. You will see your cubic on the graph. More
information on the syntax of function definitions can be found
below.
- Error messages show up in the graphing area. For
example, type in the function z^3 and press Enter. Since this applet
doesn't know about the variable z (only about x), it displays an error
message. To fix things, just edit the z back to an x and press Enter.
- You can zoom in and out using the zoom buttons on
the Limit Control Panel, shown to the right of the graph. You can also
directly edit the xmin, xmax, ymin, and ymax fields, pressing Enter to
cause your limits to take effect (or click the Set Limits button).
Pressing the Restore Limits button returns you to the last saved set of
limits, useful if you've messed around with the limits and want to get
back where you started. Some applets also have a Save Limits button,
which saves the current limits for use by the Restore Limits
button.
- You can also zoom and pan using the mouse. Click on
the graph and the applet will zoom in by a factor of 2, centered on the
location of the click. Do this with the Shift key held down to zoom out
x2. Click-drag on the graph window creates a rectangle; when you let go
of the mouse button, the graph will be zoomed to that rectangle.
Click-drag with the right mouse button (or while holding down the command
key on a Macintosh) will pan the graph. Remember, you can always undo
your zoom/pan experiments with the Restore Limits button.
- The Equalize button will cause both axes to have
the same scale (i.e., circles will look like circles instead of
ellipses). This is useful if you want the scales to be the same on both axes and you have
resized the window or zoomed in a way that the axes no longer have the
same scale.
- Try dragging the slider at the bottom of the
applet, and watch the crosshair move along the graph. Many applets have
sliders that allow you to adjust a value. You can also type a value into
the x = box next to the slider, and have the slider updated directly to
your desired value. Once you have clicked on the slider, you can also move the slider using the ← and → keys on your keyboard.
- If you want to project an applet onto a screen for
use in a lecture, the normal applet's lines and fonts may be too small.
Most pages provide a Launch Presentation button that opens a new window
with the applet in it, also with larger fonts and wider lines. Try
clicking the button below to see what this looks like. The resulting
window can be resized to fit your screen.
Function Syntax: The syntax for the definition of a function is very similar to that found on common graphing calculators. Binary operators such as + (addition), - (subtraction), * (multiplication), / (division), and ^ (exponentiation) follow the standard rules for precedence. Operators at equal levels are performed left to right, and grouping parentheses are also supported. The following are the symbols and operations allowed in a function definition.
Built-in Functions: The following built-in functions are provided:
Piecewise Functions: In addition, a special syntax is provided for conditional expressions, which enables you to graph piecewise functions. A conditional expression is an expression using the ? operator. An example is ((x > 0)? x : -x) which says: “if x is greater than 0, then the value is x, otherwise it is – x.” The part before the ? is the condition and compares two quantities using one of the comparison operators =, >, <, >=, <=, or <> (not equal). You can also write more complex expressions using & (the AND binary operator), | (the OR binary operator), and ~ (the NOT unary operator). The part between the ? and the : is the value if the condition is true and can be any valid expression (even another conditional expression). The part after the : is the value if the condition is false. Note that the parentheses surrounding the conditional expression are not required, but are recommended if the conditional expression is part of a larger expression. The false part (after the :) is optional. If it is not present, then when the condition is false the expression evaluates to “not a number,” which will cause nothing to be graphed for that domain value.
Background: These applets are built using the Web Components for Mathematics(WCM) library and the Java programming language. More information on WCM can be found at http://webcompmath.sourceforge.net/






















