# Taylor Series

How to solve the Taylor series problems: Taylor's theorem, Taylor series, Maclaurin series, examples, and their solutions.

## Taylor's Theorem

Taylor's theorem shows

how to approximate a function

by rewriting the function into a polynomial function.

By making a non-polynomial function

into a polynomial function,

you can approximate the function easily.

Even by using the first two terms,*y* = *f*(*a*) + *f*'(*a*)(*x* - *a*),

which is the tangent line,

you can approximate the function quite accurate

near *x* = *a*.

So, by using the Taylor's theorem,

you can approximate *f*(*x*) quite accurate

near *x* = *a*.

## Taylor Series

As *n* → ∞,

the error of the right side goes to 0.

So the last remainder term, *R*_{n}(*x*), goes to 0.

Then the right side can be expressed

as an infinite series.

This infinite series is the Taylor series.*f*^{(0)}(*a*) in the summation means *f*(*a*).

## Maclaurin Series

The Maclaurin series

is the special case of a Taylor series

when *a* = 0.

The Maclaurin series is simpler.

So you'll most likely to see

the Maclaurin series problems.

## Example 1: *e*^{x}

When solving the Taylor series problems,

try to find a pattern between the derivative parts.*f*(0) = 1*f*'(0) = 1*f*''(0) = 1*f*'''(0) = 1

...

So the derivative parts are all 1.

Derivative of *e*^{x}

So *f*(*x*) = [1/0!]⋅*x*^{0} + [1/1!]⋅*x*^{1} + [1/2!]⋅*x*^{2} + [1/3!]⋅*x*^{3} + ... .

The exponent parts and the permutation parts

both show 0, 1, 2, 3, ... .

So *f*(*x*) is

the sum of [1/*n*!]⋅*x*^{n}

as *n* goes from 0 to infinity.

So *e*^{x} can be expressed as

1 + *x* + [1/2!]*x*^{2} + [1/3!]*x*^{3} + ... .

## Example 2: sin *x*

*f*(0) = 0*f*'(0) = 1*f*''(0) = 0*f*'''(0) = -1*f*''''(0) = 0

...

So the derivative parts show this pattern: 0, 1, 0, -1.

Derivative of sin *x*

Derivative of cos *x*

So *f*(*x*) = [0/0!]⋅*x*^{0} + [1/1!]⋅*x*^{1} + [0/2!]⋅*x*^{2} + [(-1)/3!]⋅*x*^{3}

= [0/4!]⋅*x*^{4} + [1/5!]⋅*x*^{5} + [0/6!]⋅*x*^{6} + [(-1)/7!]⋅*x*^{7} + ... .

Cancel the 0 terms. (dark gray)

Then *f*(*x*) = [1/1!]⋅*x*^{1} + [(-1)/3!]⋅*x*^{3} + [1/5!]⋅*x*^{5} + [(-1)/7!]⋅*x*^{7} + ... .

The derivative parts show 1, -1, 1, -1, ... .

So the *n*-th part is (-1)^{n}.

(*n* goes from 0.)

The exponent parts and the permutation parts

both show 1, 3, 5, 7, ... .

So the *n*-th part is 2*n* - 1.

So *f*(*x*) is

the sum of [(-1)^{n}/(2*n* - 1)!]⋅*x*^{2n - 1}

as *n* goes from 0 to infinity.

So sin *x* can be expressed as*x* - [1/3!]*x*^{3} + [1/5!]*x*^{5} - [1/7!]*x*^{7} + ... .

## Example 3: cos *x*

*f*(0) = 1*f*'(0) = 0*f*''(0) = -1*f*'''(0) = 0*f*''''(0) = 1

...

So the derivative parts show this pattern: 1, 0, -1, 0.

Derivative of cos *x*

Derivative of sin *x*

So *f*(*x*) = [1/0!]⋅*x*^{0} + [0/1!]⋅*x*^{1} + [(-1)/2!]⋅*x*^{2} + [0/3!]⋅*x*^{3}

= [1/4!]⋅*x*^{4} + [0/5!]⋅*x*^{5} + [(-1)/6!]⋅*x*^{6} + [0/7!]⋅*x*^{7} + ... .

Cancel the 0 terms. (dark gray)

Then *f*(*x*) = [1/0!]⋅*x*^{0} + [(-1)/2!]⋅*x*^{2} + [1/4!]⋅*x*^{4} + [(-1)/6!]⋅*x*^{6} + ... .

The derivative parts show 1, -1, 1, -1, ... .

So the *n*-th part is (-1)^{n}.

(*n* goes from 0.)

The exponent parts and the permutation parts

both show 0, 2, 4, 6, ... .

So the *n*-th part is 2*n*.

So *f*(*x*) is

the sum of [(-1)^{n}/2*n*!]⋅*x*^{2n}

as *n* goes from 0 to infinity.

So cos *x* can be expressed as

1 - [1/2!]*x*^{2} + [1/4!]*x*^{4} - [1/6!]*x*^{6} + ... .