# Functions of one and several variables

## 5.1 Mathematical functions

The following notations for elementary functions and constants are accepted.

### Constants

$\backslash$i — imaginary unit,

$\backslash$e — the basis of natural logarithm,

$\backslash$pi — the ratio of length of a circle to its diameter,

$\backslash$infty — infinity symbol.

### Functions of one argument

$\backslash$ln — natural logarithm,

$\backslash$lg — decimal logarithm,

$\backslash$sin — sine,

$\backslash$cos — cosine,

$\backslash$tg — tangent,

$\backslash$ctg — cotangent,

$\backslash$arcsin — arcsine,

$\backslash$arccos — arccosine,

$\backslash$arctg — arctangent,

$\backslash$arcctg — arccotangent,

$\backslash$sh — sine hyperbolic,

$\backslash$ch — cosine hyperbolic,

$\backslash$th — tangent hyperbolic,

$\backslash$cth — cotangent hyperbolic,

$\backslash$arcsh — arcsine hyperbolic,

$\backslash$arcch — arccosine hyperbolic,

$\backslash$arcth — arctangent hyperbolic,

$\backslash$arccth — arccotangent hyperbolic,

$\backslash$exp — exponent,

$\backslash$sqrt — root square,

$\backslash$abs — absolute value of real numbers (module for complex numbers), $\backslash$sign — number sign (returns $1$, $0$, $-1$ when number sign is $+$, $0$, $-$, correspondingly),

$\backslash$unitStep$(x)$ — is a function that for $x> 0$ takes the value $1$, and for $x <0$ takes the value $0$;

$\backslash$fact — factorial. It is defined for positive integers and equivalent to $n!$.

### Functions of two arguments

\^ — degree,

$\backslash$log — logarithm of function with given base,

$\backslash$rootOf(x, n) — root of degree n of x,

$\backslash$Gamma — the function Gamma,

$\backslash$Gamma2 — the function Gamma 2,

$\backslash$binomial — binomial coefficient.

No result yet

## 5.2 Calculation of the value of a function in a point

To calculate the value of a function in a point execute the command value(f, [var1, var2,…, varn]), where $f$ is a function, and $var1, var2,…, varn$ are values of variables, which are substituted instead of corresponding variables.

You can use radians or degrees for an angular measure. For an indication of angular measure, you can set the constant RADIAN. If you do not specify the angular measure, the radians is chosen. To change the angular measure from radians to degrees, run $RADIAN = 0$. If you need to change the angular measure in radians, then run $RADIAN = 1$.

If the arguments of trigonometric functions is integer, which is equal to $15k$ or $18k$ degrees (i.e. $\pi k/12$ and $\pi k/10$ radians, $k \in \mathbb{Z}$), then values of the trigonometric functions are algebraic numbers.

No result yet

No result yet

No result yet

No result yet

No result yet

No result yet

No result yet

## 5.3 Substitution of functions instead of ring variables

To calculate the composition of functions some functions must be substituted in place of the arguments. For this you must run value(f, [func1, func2, $…$, funcn]) , where $f$ ~ — this function, $func1, func2, …, funcn$ ~ — functions that are substituted into the corresponding places.

No result yet

## 5.4 Calculation of the limit of a function

To calculate the limit of a function at a point you must run lim(f, var), where $f$ ~ — this function, and $var$ ~ — point, possibly infinite, in which you want to find the limit. The limit may not exist, may be finite or infinite.

No result yet

No result yet

No result yet

No result yet

## 5.5 Differentiation of functions

To differentiate a function $f(x,y,z)$ with lowest variable $x$, you have to execute one of commands D(f), D(f,x) or D(f,x{ \widehat{ } 1)}. To fine the second derivative of $f(x,y,z)$ by variable $y$, you have to execute the command D(f,y{ \widehat{ } 2)}. And so on.

To find a mixed first-order derivative of the function $f$ there is a command D(f, [x, y]), to find the derivative of higher order to use the command D(f,[x { \widehat{ } k, z { }\widehat{ } m, y { }\widehat{ } n])}, where $k, m, n$ indicate the order of the derivative.

No result yet

No result yet

No result yet

## 5.6 Integration of the compositions of elementary functions

Symbolic integration of compositions of elementary functions is performed by using the int(f(x))d x.

No result yet

No result yet

No result yet

No result yet

No result yet

No result yet

No result yet

## 5.7 Simplification of compositions

For transformation of a trigonometric and logarithmic function by means of identities: $sin(x)cos(y) \pm cos(x)sin(y) = sin(x \pm y)$ $cos(x)cos(y) \pm sin(x)sin(y) = cos(x \mp y)$ $sin^2(x) + cos^2(x) = 1$ $cos^2(x) - sin^2(x) = cos(2x)$ $ln(a) + ln(b) = ln(ab)$ $ln(a) - ln(b) = ln(\dfrac{a}{b})$ the command Expand(f(x)) is used.

No result yet

No result yet

No result yet

For simplification of a trigonometric and logarithmic function by means of all formulas mentioned above and formulas: $ln(a)^k = k\cdot ln(a)$ $e^{iz} + e^{-iz} = 2Cos(z)$ $e^{iz} - e^{-iz} = 2iSin(z)$ $Ln(1+iz) - Ln(1-iz) = 2i*arctg(z)$ $Ln(1-iz) - Ln(1+iz) = 2i*arcctg(z)$ $e^{z} + e^{-z} = 2Ch(z)$ $e^{z} - e^{-z} = 2iSh(z)$ the command Factor(f(x)) is used.

No result yet

No result yet

No result yet

Unit of commands Factor(f(x)) and Expand(f(x)) allows to solve more difficult examples:

No result yet

%\chapter

## 5.8 Arithmetic-geometric mean

%{Definitions}

Given two non-negative numbers $x$ and $y$, one can define their arithmetic, geometric and harmonic means as $\frac{x+y}{2}$, $\sqrt{xy}$, and $\frac{2xy}{x+y}$, respectively. Moreover, AGM(x,y) denotes the arithmetic-geometric mean of $x$ and $y$. GHM(x,y) denotes the geometric-harmonic mean of $x$ and $y$. At last, MAGM(x,y) denotes the modified arithmetic-geometric mean of $x$ and $y$. Every mean is a symmetric homogeneous function in their two variables $x$ and $y$. In contrast to well-known means, AGM(x,y), GHM(x,y), and MAGM(x,y) are calculated iteratively.

The arithmetic-geometric mean AGM(x,y) is equal to the limit of both sequences $x_n$ and $y_n$, where $x_0=x$, $y_0=y$, $x_{n+1}=\frac{1}{2}(x_n+y_n)$, and $y_{n+1}=\sqrt{x_ny_n}$.

In the same way, the geometric-harmonic mean GHM(x,y) is equal to the limit of both sequences $x_n$ and $y_n$, where $x_0=x$, $y_0=y$, $x_{n+1}=\sqrt{x_ny_n}$, and $y_{n+1}=\frac{2x_ny_n}{x_n+y_n}$.

The modified arithmetic-geometric mean MAGM(x,y) is equal to the limit of the sequence $x_n$, where $x_0=x$, $y_0=y$, $z_0=0$, $x_{n+1}=\frac{x_n+y_n}{2}$, $y_{n+1}=z_n+\sqrt{(x_n-z_n)(y_n-z_n)}$, and $z_{n+1}=z_n-\sqrt{(x_n-z_n)(y_n-z_n)}$.

No result yet

## 5.9 The complete elliptic integrals of the first and second kind

Let us use the parameter $0\le k\le 1$.

The complete elliptic integral of the first kind $K(k)$ is defined as $$K(k)=\int_0^1\frac{dt}{\sqrt{(1-t^2)(1-k^2t^2)}}$$ It can be computed in terms of the arithmetic-geometric mean: $$K(k)=\frac{\pi}{2 AGM(1,\sqrt{1-k^2})}$$ On the other hand, for $k<1$, it can be computed in terms of the geometric-harmonic mean: $$K(k)=\frac{\pi}{2} GHM(1,\frac{1}{\sqrt{1-k^2}})$$

The complete elliptic integral of the second kind $E(k)$ is defined as $$E(k)=\int_0^1\sqrt{\frac{1-k^2t^2}{1-t^2}}dt$$ It can be computed in terms of the modified arithmetic-geometric mean: $$E(k)=K(k) MAGM(1,1-k^2)$$ See also: S. Adlaj (2012) An eloquent formula for the perimeter of an ellipse. Notices of the American Mathematical Society. 59(8), 1094-1099. DOI:10.1090/noti879

## 5.10 The period of a simple gravity pendulum

A point mass suspended from a pivot with a massless cord. The length of the pendulum equals $L = 1$ metre. It swings under gravitational acceleration $g = 9.80665$ metres per second squared. The maximum angle that the pendulum swings away from vertical, called the amplitude, equals $\theta_0=2.0944$, that is, $\frac{2}{3}\pi$ radians.

Find the period $T$ of the pendulum using the arithmetic-geometric mean $$T=\frac{2\pi}{AGM(1,\cos(\theta_0/2))}\sqrt{\frac{L}{g}}$$

No result yet