Range Variables and Graphing Functions
Range Variables

A range variable takes on a range of values separated by uniform steps. If you use a range variable in an expression, Mathcad evaluates that expression once for each value taken by the range variable.
Mathcad shows the semicolon as two periods to indicate the range. This definition indicates that j now takes on the values 1, 2...8.
Mathcad permits range variables with values ranging from any value to any other value, using any constant increment or decrement,
type k:1,1.1;2
in the above example:
- k is the name of the range variable,
- 1 is the first value taken by the range variable k,
- 1.1 is the second value in the range; note that this is not the step-size; the step-size is 1.1 - 1 = 0.1
- 2 is the last value in the range
The range variable definition:
defines the following values: 2, 2.1, 2.2, 2.3, ..., 3
The following range variable definition:
defines the values: 0, 1, 2, 3, and 4. If such a small set of points, x, is used to create a graph, y = f(x), then the graph may not be smooth. Specifying a small increment would increase the number if x values and would make the graph look smoother. Example:

Graphing Functions
To graph a simple function using a range variable, do the following:

Define a function of one variable that you wish to plot. For example, graph the following function:
type f(x):-x^2[Spacebar]+8*x-27
Define an independent variable for the horizontal axis.
For example:
type x:1;7
Create your plot by clicking in the worksheet window, then type @ to create the x-y plot and type x in the middle placeholder on the horizontal axis and type f(x) in the middle placeholder on the vertical axis. Then press [Enter].
Your plot should look like this:
The trace looks a little rough. To smooth the trace out, try changing the definition of
to
. The smaller increment (or step) means more points calculated, which means more plotted, which makes the trace smoother because Mathcad is simply connecting the dots.
To format an x-y plot, just double-click on it (or choose Graph from the Format menu) to bring up a formatting dialog box. The tabbed dialog box lets you change options for logarithmic axes, grid lines, legends, trace types, markers, colors, axis limits, and more. Experiment with the x-y plot below. Double-clicking on any Mathcad plot -- contour, surface, polar, vector, etc. -- brings up an appropriate formatting dialog box.
Graphing Two or More Functions

Plotting multiple functions over a single domain on a single graph is straightforward. For example, suppose you want to plot two functions, f(x) and g(x) = 10sin(2x) - 20 on one plot. Just type the two expressions separated by a comma in the middle placeholder on the vertical axis
You can also add a comma after an expression on the y-axis, followed by another expression. In this way, you can plot up to 16 expressions on one plot.