## Name:

taylor computes a Taylor expansion of a function in a point

## Library name:

sollya_obj_t sollya_lib_taylor(sollya_obj_t, sollya_obj_t, sollya_obj_t)

## Usage:

taylor(function, degree, point) : (function, integer, constant) -> function

## Parameters:

• function represents the function to be expanded
• degree represents the degree of the expansion to be delivered
• point represents the point in which the function is to be developed

## Description:

• The command taylor returns an expression that is a Taylor expansion of function function in point point having the degree degree.

Let f be the function function, t be the point point and n be the degree degree. Then, taylor(function,degree,point) evaluates to an expression mathematically equal to f(t) + f'(t) * x + ... + 1/(n!) * f[n](t) * x^n. In other words, if p(x) denotes the polynomial returned by taylor, p(x-t) is the Taylor polynomial of degree n of f developed at point t.

Remark that taylor evaluates to 0 if the degree degree is negative.

## Example 1:

> print(taylor(exp(x),3,1));
exp(1) + x * (exp(1) + x * (0.5 * exp(1) + x * exp(1) / 6))

## Example 2:

> print(taylor(asin(x),7,0));
x * (1 + x^2 * (1 / 6 + x^2 * (3 / 40 + x^2 * 5 / 112)))

## Example 3:

> print(taylor(erf(x),6,0));
x * (2 / sqrt(pi) + x^2 * ((2 / sqrt(pi) * (-2)) / 6 + x^2 * (2 / sqrt(pi) * 12) / 120))