6.1 Standard functions y = f(x)

The following simulation in Fig.6.1 is a plotter for arbitrary functions y = f(x). From a selection menu you can choose preset functions, that can be changed. You can also enter totally new analytic functions.

The original function itself is shown in red. With option switches you can call several functions to calculate and display them: inverse function, first derivative, second derivative and integral.

The derivatives are calculated in secant approximation , the integrals in the parabolic approximation.

inverse function : x = g(y).

This involves the problem of finding for a given function y = f(x) for a certain image variable y the preimage x. Graphically this corresponds to a reflection of y = f(x) on the angle bisector y = x or swapping of x and y. This line is shown in the corresponding plot. In the following picture this is shown for a polynomial of fifth order with three zeros. The angle bisector is shown in gray, the inverse function in light brown. The plot of this function is an example for the situation where the function y = f(x) is unique, each xi is mapped to exactly one yi, but the inverse function is not unique, i.e. there are many yi for which three xj exist.

PIC

first derivative: y = d dxf(x) is shown in magenta.

PIC

second derivative: y = d2 dx2 f(x) = d dxy is shown in green.

PIC

The integral xminxf(x)dx with adjustable initial value I0 for xmin, is shown in blue.


PIC
Figure 6.1: Plot of function (red), inverse function (light brown), first derivative (magenta), second derivative (green) and integral (blue), shown for the example of the polynomial of fifth degree y = -x5 - 0.2x2 + x.

When calculating the integral you have to remember, that the calculation starts at x0 with and initial value I0. The variable region and the initial value must be chosen in such a way, that the integral curve stays in the window.

Fig.6.2 shows the Gaussian y = e-x2 with inverse function, first and second derivative and integral.

The command panel allows for up to three parameters a,b and c a continuous variation and for a fourth parameter a choice of integers.

With the coloured option boxes the inverse function, 1. and 2. derivative and integral can be shown or suppressed.

The presentation is for abscissa and ordinate symmetric to the origin. In the first white field on the bottom you can adjust the variable range - xmax < x < xmax by hand, in the second field the y-range and in the the third the initial value of the integral for - xmax. If the symmetric range of variation is not sufficient for your function, you can increase or decrease it via entering factors in the formulas.


PIC
Figure 6.2: Function plotter for functions that can be specified at will; optionally the inverse function (light brown), the first derivative (magenta) and second derivative (green) and the integral (blue) are drawn as well. The figure shows the example of a Gaussian, whose amplitude, width and center can be adjusted with the sliders. The function can be edited

As usual the window can be pulled to full screen size and after marking a point you may read off its coordinates on the lower boundary of the graphic.

The preset functions are




functions

constant

p-th power, p > 0 and integer

b-th power, (b rational; x > 0)

sine

cosine

sine with three parameters

cosine with three parameters

power of sine

power of cosine

tangent with three parameters

exponential function

exponential decay

natural logarithm

hyperbolic sine

hyperbolic cosine

hyperbolic tangent

Gauss distribution with three parameters

sin x x

sin x x 2

formulas in Java-syntax

a

a*xˆp

a*xˆb

sin(x)

cos(x)

a*sin(b*x + c)

a*cos(b*x + c)

sin(a*x)ˆp

cos(a*x)ˆp

a*tan(b*x + c)

a*exp(x/b)

a*exp(-x/b)

ln(x/a)

(exp(a*x) - exp(-a*x))/2

(exp(a*x) + exp(-a*x))/2

(exp(a*x) - exp(-a*x))/(exp(a*x) + exp(-a*x))

a*exp(-b*(x-c)ˆ2

sin(a*x)/(a*x)

(sin(a*x)/(a*x))ˆ2




In the simulation you may change the preset functions or enter new formulas from scratch.