Calculus/Taylor series

From testwiki
Jump to navigation Jump to search

Taylor Series

Template:Calculus/Def

As the degree of the Taylor series rises, it approaches the correct function. sin(x) and Taylor approximations, polynomials of degree 1, 3, 5, 7, 9, 11 and 13.

Here, n! is the factorial of n and f(n)(a) denotes the nth derivative of f at the point a . If this series converges for every x in the interval (ar,a+r) and the sum is equal to f(x) , then the function f(x) is called analytic. To check whether the series converges towards f(x), one normally uses estimates for the remainder term of Taylor's theorem. A function is analytic if and only if a power series converges to the function; the coefficients in that power series are then necessarily the ones given in the above Taylor series formula.

If a=0 , the series is also called a Maclaurin series.

The importance of such a power series representation is threefold. First, differentiation and integration of power series can be performed term by term and is hence particularly easy. Second, an analytic function can be uniquely extended to a holomorphic function defined on an open disk in the complex plane, which makes the whole machinery of complex analysis available. Third, the (truncated) series can be used to approximate values of the function near the point of expansion.

Template:-

Around zero, the function looks very flat. The function f(z)=e1z2 is not analytic: the Taylor series is 0, although the function is not.

Note that there are examples of infinitely often differentiable functions f(x) whose Taylor series converge, but are not equal to f(x) . For instance, for the function defined piecewise by saying that f(x)={0x=0e1x2x0 , all the derivatives are 0 at x=0 , so the Taylor series of f(x) is 0, and its radius of convergence is infinite, even though the function most definitely is not 0. This particular pathology does not afflict complex-valued functions of a complex variable. Notice that f(z)=e1z2 does not approach 0 as z approaches 0 along the imaginary axis.

Some functions cannot be written as Taylor series because they have a singularity; in these cases, one can often still achieve a series expansion if one allows also negative powers of the variable x; see Laurent series. For example, f(z)=e1z2 can be written as a Laurent series.

The Parker-Sockacki theorem is a recent advance in finding Taylor series which are solutions to differential equations. This theorem is an expansion on the Picard iteration.

Derivation

Suppose we want to represent a function as an infinite power series, or in other words a polynomial with infinite terms of degree "infinity". Each of these terms are assumed to have unique coefficients, as do most finite-polynomials do. We can represent this as an infinite sum like so:

f(x)=c0(xa)0+c1(xa)1+c2(xa)2+c3(xa)3++cn(xa)n+

where a is the radius of convergence and c0,c1,c2,,cn, are coefficients. Next, with summation notation, we can efficiently represent this series as

n=0cn(xa)n

which will become more useful later. As of now, we have no schematic for finding the coefficients other than finding each one in the series by hand. That method would not be particularly useful. Let us, then, try to find a pattern and a general solution for finding the coefficients. As of now, we have a simple method for finding the first coefficient. If we substitute a for x then we get

f(a)=c0

This gives us c0 . This is useful, but we still would like a general equation to find any coefficient in the series. We can try differentiating with respect to x the series to get

f(x)=c1(xa)0+2c2(xa)1+3c3(xa)2+4c4(xa)3++ncn(xa)(n1)+

We can assume cn and a are constant. This proves to be useful, because if we again substitute a for x we get

f(a)=c1

Noting that the first derivative has one constant term (c1(xa)0=c1) we can find the second derivative to find c2 . It is

f(x)=2c2+(2×3)c3(xa)1+(3×4)c4(xa)2++(n)(n1)cn(xa)(n2)+

If we again substitute a for x :

f(a)=2c2

Note that c2's initial exponent was 2, and c1's initial exponent was 1. This is slightly more enlightening, however it is still slightly ambiguous as to what is happening. Going off the previous examples, if we differentiate again we get

f(x)=(2×3)c3(xa)0+(2×3×4)c4(xa)1+(3×4×5)c5(xa)2++(n)(n1)(n2)cn(xa)n3

If we substitute x=a we, again, that

f(a)=(2×3)c3

By now, the pattern should be becoming clearer. (n)(n1)(n2) looks suspiciously like n! . And indeed, it is! If we carry this out n times by finding the nth derivative, we find that the multiple of the coefficient is n! . So for some cn , for any integer n0 ,

n!×cn=dndxnf(a)

Or, with some simple manipulation, more usefully,

cn=f(n)(a)n!

where f(0)(x)=f(x) and f(1)(x)=f(x) and so on. With this, we can find any coefficient of the "infinite polynomial". Using the summation definition for our "polynomial" given earlier,

n=0cn(xa)n

we can substitute for cn to get

f(x)=n=0f(n)(a)n!(xa)n

This is the definition of any Taylor series. But now that we have this series, how can we derive the definition for a given analytic function? We can do just as the definition specifies, and fill in all the necessary information. But we will also want to find a specific pattern, because sometimes we are left with a great many terms simplifying to 0.

First, we have to find f(a) . Because we are now deriving our own Taylor Series, we can choose anything we want for f(x) , but note that not all functions will work. It would be useful to use a function that we can easily find the n-th derivative for. A good example of this would be sin(x) . With sin(x) chosen, we can begin to find the derivatives. Before we begin, we should also note that a is essentially the "offset" of the function along the x-axis, because this is also essentially true for any polynomial. With that in mind, we can assume, in this particular case, that the offset is 0 and so a=0. With that in mind, "0-th" derivative or the function itself would be

sin(0)=0

If we plug that in to the definition of the first term in the series, again noting that a=0 , we get

00!x0=0

where 0!=1 . This means that the first term of the series is 0, because anything multiplied by 0 is 0. Take note that not all Taylor series start out with a 0 term. Next, to find the next term, we need to find the first derivative of the function. Remembering that the derivative of sin(x) is cos(x) we get that

ddxsin(0)=cos(0)=1

This means that our second term in the series is

11!x1=x

Next, we need to find the third term. We repeat this process.

d2dx2sin(0)=sin(0)=0

Because the derivative of cos(x)=sin(x) . We continue with

02!x2=0

The fourth term:

d3dx3sin(0)=cos(0)=1
13!x3=x36

Repeating this process we can get the sequence

00!x0,11!x1,02!x2,13!x3,04!x4,15!x5,06!x6,17!x7,

which simplifies to

0,x,0,x36,0,x5120,0,x75040,

Because we are ultimately dealing with a series, the zero terms can be ignored, giving use the new sequence

x,x36,x5120,x75040,

There is a pattern here, however it may be easier to see if we take the numerator and the denominator separately. The numerator:

1,1,1,1,
1!,3!,5!,7!,

And for the x part of the terms, we have the sequence

x,x3,x5,

By this point, at least for the denominator and the x part, the pattern should be obvious. It is, for the denominator

(2n1)!=denomn

The x term:

x2n1=xtermn

Finally, the numerator may not be as obvious, but it follows this pattern:

(1)n1

With all of these things discovered, we can put them together to find the rule for the nth term of the sequence:

(1)n1(2n1)!x2n1=sumtermn

And so our Taylor (Maclaurin) series for sin(x) is

f(x)=n=1(1)n1(2n1)!x2n1

List of Taylor series

Several important Taylor series expansions follow. All these expansions are also valid for complex arguments x .

Exponential function and natural logarithm:

ex=n=0xnn! for all x
ln(1+x)=n=1(1)n1nxn for |x|<1

Geometric series:

11x=n=0xn for |x|<1

Binomial series:

(1+x)α=n=0(αn)xn for all |x|<1 and all complex α

Trigonometric functions:

sin(x)=n=1(1)n1(2n1)!x2n1 for all x
cos(x)=n=0(1)n(2n)!x2n for all x
tan(x)=n=1B2n(4)n(14n)(2n)!x2n1 for |x|<π2
sec(x)=n=0(1)nE2n(2n)!x2n for |x|<π2
arcsin(x)=n=0(2n)!4n(n!)2(2n+1)x2n+1 for |x|<1
arctan(x)=n=0(1)n2n+1x2n+1 for |x|<1

Hyperbolic functions:

sinh(x)=n=1x2n1(2n1)! for all x
cosh(x)=n=0x2n(2n)! for all x
tanh(x)=n=1B2n22n(22n1)(2n)!x2n1 for |x|<π2
arsinh(x)=n=0(1)n(2n)!22n(n!)2(2n+1)x2n+1 for |x|<1
artanh(x)=n=1x2n12n1 for |x|<1


Lambert's W function:

W0(x)=n=1(n)n1n!xn for |x|<1e

The numbers Bk appearing in the expansions of tan(x) and tanh(x) are the Bernoulli numbers. The (αn) in the binomial expansion are the binomial coefficients. The Ek in the expansion of sec(x) are Euler numbers.

Multiple dimensions

The Taylor series may be generalized to functions of more than one variable with

n1=0nd=0n1x1n1ndxdndf(a1,,ad)n1!nd!(x1a1)n1(xdad)nd

History

The Taylor series is named for mathematician Brook Taylor, who first published the power series formula in 1715.

Constructing a Taylor Series

Several methods exist for the calculation of Taylor series of a large number of functions. One can attempt to use the Taylor series as-is and generalize the form of the coefficients, or one can use manipulations such as substitution, multiplication or division, addition or subtraction of standard Taylor series (such as those above) to construct the Taylor series of a function, by virtue of Taylor series being power series. In some cases, one can also derive the Taylor series by repeatedly applying integration by parts. The use of computer algebra systems to calculate Taylor series is common, since it eliminates tedious substitution and manipulation.

Example 1

Consider the function

f(x)=ln(1+cos(x))

for which we want a Taylor series at 0.

We have for the natural logarithm

ln(1+x)=n=1(1)n+1nxn=xx22+x33x44+ for |x|<1

and for the cosine function

cos(x)=n=0(1)n(2n)!x2n=1x22!+x44! for all x

We can simply substitute the second series into the first. Doing so gives

(1x22!+x44!)12(1x22!+x44!)2+13(1x22!+x44!)3

Expanding by using multinomial coefficients gives the required Taylor series. Note that cosine and therefore f are even functions, meaning that f(x)=f(x), hence the coefficients of the odd powers x, x3, x5, x7 and so on have to be zero and don't need to be calculated. The first few terms of the series are

ln(1+cos(x))=ln(2)x24x496x6144017x832256031x107257600

The general coefficient can be represented using Faà di Bruno's formula. However, this representation does not seem to be particularly illuminating and is therefore omitted here.

Example 2

Suppose we want the Taylor series at 0 of the function

g(x)=excos(x)

We have for the exponential function

ex=n=0xnn!=1+x+x22!+x33!+x44!+

and, as in the first example,

cos(x)=1x22!+x44!

Assume the power series is

excos(x)=c0+c1x+c2x2+c3x3+

Then multiplication with the denominator and substitution of the series of the cosine yields

ex =(c0+c1x+c2x2+c3x3+)cos(x)
=(c0+c1x+c2x2+c3x3+c4x4+)(1x22!+x44!)
=c0c02x2+c04!x4+c1xc12x3+c14!x5+c2x2c22x4+c24!x6+c3x3c32x5+c34!x7+

Collecting the terms up to fourth order yields

=c0+c1x+(c2c02)x2+(c3c12)x3+(c4+c04!c22)x4+

Comparing coefficients with the above series of the exponential function yields the desired Taylor series

excos(x)=1+x+x2+2x33+x42+

Convergence

Generalized Mean Value Theorem

Template:Calculus/Stub Template:BookCat