# Using &kmplot;

&kmplot; deals with several different types of functions, which can be written in function form or as an equation:

- Cartesian plots can either be written as &eg; y = x^2, where x has to be used as the variable; or as &eg; f(a) = a^2, where the name of the variable is arbitrary.

- Parametric plots are similar to Cartesian plots. The x and y coordinates can be entered as equations in t, &eg; x = sin(t), y = cos(t), or as functions, &eg; f_x(s) = sin(s), f_y(s) = cos(s).

- Polar plots are also similar to Cartesian plots. They can be either be entered as an equation in &thgr;, &eg; r = &thgr;, or as a function, &eg; f(x) = x.

- For implicit plots, the name of the function is entered separately from the expression relating the x and y coordinates. If the x and y variables are specified via the function name (by entering &eg;f(a,b) as the function name), then these variables will be used. Otherwise, the letters x and y will be used for the variables.

- Explicit differential plots are differential equations whereby the highest derivative is given in terms of the lower derivatives. Differentiation is denoted by a prime ('). In function form, the equation will look like f''(x) = f' − f. In equation form, it will look like y'' = y' − y. Note that in both cases, the (x) part is not added to the lower order differential terms (so you would enter f'(x) = −f and not f'(x) = −f(x)).

All the equation entry boxes come with a button on the right. Clicking this invokes the advanced Equation Editor dialog, which provides:

- A variety of mathematical symbols that can be used in equations, but aren't found on normal keyboards.

- The list of user constants and a button for editing them.

- The list of predefined functions. Note that if you have text already selected, it will be used as the function argument when a function is inserted. For example, if 1 + x is selected in the equation y = 1 + x, and the sine function is chosen, then the equation will become y = sin(1+x).

Here is a screenshot of the &kmplot; welcome window
Screenshot

## Function Types

### Cartesian Functions

To enter an explicit function (&ie;, a function in the form y=f(x)) into &kmplot;, just enter it in the following form:

    f(x) = expression

where:

- f is the name of the function, and can be any string of letters and numbers.

- x is the x-coordinate, to be used in the expression following the equals sign. It is a dummy variable, so you can use any variable name you like to achieve the same effect.

- expression is the expression to be plotted, given in the appropriate syntax for &kmplot;. See .

### Parametric Functions

Parametric functions are those in which the x and y coordinates are defined by separate functions of another variable, often called t. To enter a parametric function in &kmplot;, follow the procedure as for a Cartesian function for each of the x and y functions. As with Cartesian functions, you may use any variable name you wish for the parameter.

As an example, suppose you want to draw a circle, which has parametric equations x = sin(t), y = cos(t). After creating a parametric plot, enter the appropriate equations in the x and y boxes, &ie;, `f_x(t)=sin(t)` and `f_y(t)=cos(t)`.

You can set some further options for the plot in the function editor:

Min
Max

  These options control the range of the parameter t for which the function is plotted.

### Functions in Polar Coordinates

Polar coordinates represent a point by its distance from the origin (usually called r), and the angle a line from the origin to the point makes with the x-axis (usually represented by &thgr; the Greek letter theta). To enter functions in polar coordinates, click the Create button and select Polar Plot from the list. In the definition box, complete the function definition, including the name of the theta variable you want to use, &eg;, to draw the Archimedes' spiral r = &thgr;, enter:

    r(&thgr;) = &thgr;

. Note that you can use any name for the theta variable, so r(t) = t or f(x) = x will produce exactly the same output.

### Implicit Functions

An implicit expression relates the x and y coordinates as an equality. To create a circle, for example, click the Create button and select Implicit Plot from the list. Then, enter into the equation box (below the function name box) the following:

    x^2 + y^2 = 25

### Differential Functions

&kmplot; can plot explicit differential equations. These are equations of the form y(n) = F(x,y',y'',...,y(n−1)), where yk is the kth derivative of y(x). &kmplot; can only interpret the derivative order as the number of primes following the function name.

To draw a sinusoidal curve, for example, you would use the differential equation `y'' = − y` or `f''(x) = −f`.

However, a differential equation on its own isn't enough to determine a plot. Each curve in the diagram is generated by a combination of the differential equation and the initial conditions. You can edit the initial conditions by clicking on the Initial Conditions tab when a differential equation is selected. The number of columns provided for editing the initial conditions is dependent on the order of the differential equation.

You can set some further options for the plot in the function editor:

Step

  The step value in the precision box is used in numerically solving the differential equation (using the Runge Kutta method). Its value is the maximum step size used; a smaller step size may be used if part of the differential plot is zoomed in close enough.

## Combining Functions

Functions can be combined to produce new ones. Simply enter the functions after the equals sign in an expression as if the functions were variables. For example, if you have defined functions f(x) and g(x), you can plot the sum of f and g with:

    sum(x) = f(x) + g(x)

## Changing the appearance of functions

To change the appearance of a function's graph on the main plot window, select the function in the Functions sidebar. You can change the plot's line width, color and many other aspects by clicking on the Color or Advanced... button at the bottom of the section Appearance.

If you are editing a Cartesian function, the function editor will have three tabs. In the first one you specify the equation of the function. The Derivatives tab lets you draw the first and second derivative to the function. With the Integral tab you can draw the integral of the function.

## Popup menu

Graph right-click popup menu
Graph right-click popup menu

When right-clicking on a plot function or a single-point parametric plot function a popup menu will appear. In the menu there are three items available:

Edit

  Selects the function in the Functions sidebar for editing.

Hide

  Hides the selected graph. Other plots of the graph's function will still be shown.

Remove

  Removes the function. All its graphs will disappear.

Animate Plot...

  Displays the Parameter Animator dialog.

Calculator

  Opens the Calculator dialog.

Depending on the plot type, there will also be up to four tools available:

Plot Area...

  Select the minimum and maximum x-values for the graph in the new dialog that appears. Calculates the integral and draws the area between the graph and the x-axis in the selected range in the color of the graph.

Find Minimum...

  Find the minimum value of the graph in a specified range. The selected graph will be highlighted in the dialog that appears. Enter the lower and upper boundaries of the region in which you want to search for a minimum.

  Note: You can also tell the plot to visually show the extreme points in the Plot Appearance dialog, accessible in the Functions sidebar by clicking on Advanced....

Find Maximum...

  This is the same as Find Minimum... above, but finds the maximum value instead of the minimum value.