# Background

## Introduction

TaylorSeries.jl is an implementation of high-order automatic differentiation, as presented in the book by W. Tucker [1]. The general idea is the following.

The Taylor series expansion of an analytical function $f(t)$ with *one* independent variable $t$ around $t_0$ can be written as

where $f_0=f(t_0)$, and the Taylor coefficients $f_k = f_k(t_0)$ are the $k$-th *normalized derivatives* at $t_0$:

Thus, computing the high-order derivatives of $f(t)$ is equivalent to computing its Taylor expansion.

In the case of *many* independent variables the same statements hold, though things become more subtle. Following Alex Haro's approach [2], the Taylor expansion is an infinite sum of *homogeneous polynomials* in the $d$ independent variables $x_1, x_2, \dots, x_d$, which takes the form

Here, $\mathbf{m}\in \mathbb{N}^d$ is a multi-index of the $k$-th order homogeneous polynomial and $\mathbf{x}=(x_1,x_2,\ldots,x_d)$ are the $d$ independent variables.

In both cases, a Taylor series expansion can be represented by a vector containing its coefficients. The difference between the cases of one or more independent variables is that the coefficients are real or complex numbers in the former case, but homogeneous polynomials in the latter case. This motivates the construction of the `Taylor1`

and `TaylorN`

types.

## Arithmetic operations

Arithmetic operations involving Taylor series can be expressed as operations on the coefficients:

## Elementary functions of polynomials

Consider a function $y(t)$ that satisfies the ordinary differential equation $\dot{y} = f(y)$, $y(t_0)=y_0$, where $t$ is the independent variable. Writing $y(t)$ and $f(t)$ as Taylor polynomials of $t$, substituting these in the differential equation and equating equal powers of the independent variable leads to the recursion relation

The last equation and the corresponding initial condition $y(t_0)=y_0$ define a recurrence relation for the Taylor coefficients of $y(t)$ around $t_0$.

The following are examples of such recurrence relations for some elementary functions:

The recursion relations for $s(t) = \sin\big(f(t)\big)$ and $c(t) = \cos\big(f(t)\big)$ depend on each other; this reflects the fact that they are solutions of a second-order differential equation.

All these relations hold for Taylor expansions in one and more independent variables; in the latter case, the Taylor coefficients $f_k$ are homogeneous polynomials of degree $k$; see [2].

## References

[1] W. Tucker, *Validated Numerics: A Short Introduction to Rigorous Computations*, Princeton University Press (2011).

[2] A. Haro, *Automatic differentiation methods in computational dynamical systems: Invariant manifolds and normal forms of vector fields at fixed points*, preprint.