calculus (version 0.1.0)

taylor: Taylor Series

Description

Computes the Taylor series for functions, expressions or characters.

Usage

taylor(f, var = "x", order = 1, accuracy = 2, stepsize = NULL)

Arguments

f

function, expression or character

var

character. The variables of f.

order

the order of the Taylor approximation.

accuracy

accuracy degree for numerical derivatives.

stepsize

finite differences stepsize for numerical derivatives. Auto-optimized by default.

Value

list with components

f

the Taylor series.

order

the approximation order.

terms

data.frame containing the variables, coefficients and degrees of each term in the Taylor series.

Examples

Run this code
# NOT RUN {
# univariate taylor series 
taylor('exp(x)', var = 'x', order = 3)

# univariate taylor series of arbitrary functions
taylor(function(x) exp(x), var = 'x', order = 3)

# multivariate taylor series 
taylor('sin(x*y)', var = c('x','y'), order = 6)

# multivariate taylor series of arbitrary functions
taylor(function(x,y) sin(x*y), var = c('x','y'), order = 6)

# }

Run the code above in your browser using DataLab