FANDOM

1,019 Pages

Taylor series are a type of power series that are often employed by computers and calculators to approximate transcendental functions. They are used to convert these functions into infinite sums that are easier to analyze. The partial sums of the Taylor series are called Taylor polynomials, and they are classified by degree (the greatest power of $x$ appearing in them). Functions that are equal to its own Taylor series must be analytic or holomorphic.

Definition

The Taylor series of a function is defined as

$f(x)=\sum_{k=0}^\infty\dfrac{f^{(k)}(a)}{k!}(x-a)^k$

where $a$ is some arbitrary constant. This definition holds for holomorphic functions and holomorphic functions only. The proof of it is as follows:

Proof. Let's assume that a function has a power series expansion and it is written as

$f(x)=\sum_{k=0}^\infty C_k(x-a)^k$

for some coefficient $C$ that depends on k and some arbitrary constant $a$ . Then, assuming that the function is holomorphic over its domain (infinitely differentiable), we obtain

$f^{(k)}(x)=C_k k!$

Then, it easily follows that the coefficient $C$ is

$C_k=\frac{f^{(k)}(x)}{k!}$

Setting $x=a$ gives

$C_{k}=\frac{f^{(k)}(a)}{k!}$

which completes the proof.

$a$ is the constant that the Taylor polynomial approximations will be centered about. When $a=0$ , the Taylor series are also called Maclaurin series.

Examples

Taylor series for the exponential function

Since we know $(e^x)'=e^x$ , we take a as 0 and easily obtain that

$\exp(x)=e^x=\sum_{k=0}^\infty\dfrac{x^k}{k!}$

This can be used to find a numerical approximation for $e$ .

$e=e^1=\sum_{k=0}^\infty\dfrac{1}{k!}=1+1+\frac12+\frac16+\frac{1}{24}+\cdots$

Taylor series for sine and cosine

We know that $(\sin(x))''=-\sin(x)$ , so each four differentiations, we return to the beginning. The first four derivatives evaluated at a=0 of sine is 0,1,0,-1 respectively. Only odd derivatives are of significance, so we drop out the even terms and obtain the Taylor series

$\sin(x)=\sum_{k=1}^\infty(-1)^{k-1}\dfrac{x^{2k-1}}{(2k-1)!}$

We also know that $(\cos(x))''=-\cos(x)$ , and the cycle is the same as above. The first four derivatives at a=0 are 1,0,-1,0. Only even derivatives are of significance, so we drop out the odd terms and obtain the Taylor series

$\cos(x)=\sum_{k=0}^\infty(-1)^k\dfrac{x^{2k}}{(2k)!}$

Taylor series for the inverse tangent

This result is already derived here, so it is not necessary to repeat the process.

Partial sums

Partial sums of Taylor series, the Taylor polynomials, are often very good approximations for functions with even a small number of terms summed. We can often see this applying the d'Alembert test for convergence, which only works if the series converge asymptotically as the geometric series. Of course, there are some cases where the series aren't such good approximations; such as the inverse tangent.

As an example, we will try to find the sine of 45 degrees, so pi over 4 radians. We know this value is $\frac{1}{\sqrt2}$ , which is approximately 0.7071. If we evaluate a Taylor polynomial of degree 7 for sine, we will get 0.7071. You can try this with a computer program. Simply, the sum you will want to evaluate is

$\frac{\pi}{4}-\frac{\pi^3}{4^3\cdot3!}+\frac{\pi^5}{4^5\cdot5!}-\frac{\pi^7}{4^7\cdot7!}$

This is no different than typing $\sin\left(\tfrac{\pi}{4}\right)$ with a calculator because this is how calculators find the value of sine (with better degrees for polynomials of course.)

An upper bound for the error of our approximation can be given by $\frac{\pi^9}{4^9\cdot9!}$ , which is indeed a very small value.

A sample computer algorithm

This computer algorithm uses the Taylor polynomials to approximate the exponential function and is written in C++.

int factorial(int i) {
if (i <= 1)
return i;
return (i * factorial(i - 1));
}

float exp(float num, int degree)
{
int i = 0;
float s = 0;
while (i<=degree) {
s = s + (pow(num,i)/factorial(i));
i++;
}
return s;
}


An upper bound for the error in this approximation can be found with some calculations:

$\frac{x^{k+1}}{(k+1)!}3^x$

where $k$ is the degree of the Taylor polynomial and $x$ is the unknown of the function.

An upper bound for the error

In general, for any Taylor polynomial of degree $k$ , the error is at most

$\frac{f^{(k+1)}(b)}{(k+1)!}(x-a)^{k+1}$

where $b$ is some real constant between $a$ and $x$ . This statement is Taylor's theorem.