Docsity

TAYLOR'S SERIES and problems, Exercises of Mathematics

Toggle sidebar
bg1
Taylor series
Chris Hooley, University of St Andrews
first written 31st August 2006; last revised 13th September 2009
Contents
1 Introduction 1
2 What you absolutely need to know 2
3 Introduction to the theory 2
4 Taylor series: representing non-polynomial functions as polynomials 3
5 An example 4
6 Truncating the series, and estimating the error 5
7 A graphical interpretation 6
8 Taylor series for a function of a function 7
9 Exercises 7
9.1 On the need-to-know material . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
9.2 Moreadvanced ..................................... 7
1 Introduction
These notes are designed to be brief but self-contained, and deal with Taylor series at a fairly
elementary level. They are aimed at second-year students who either have not seen this topic be-
fore, or who have seen it but need to brush up. They assume familiarity with basic differentiation
and integration. The notes begin with a simple statement of the material you absolutely need
to know; this is followed by a development of the theory, which you are encouraged (though not
required) to study. If any questions arise, I can be contacted either during the scheduled drop-
in sessions, by e-mail ([email protected]), or at my office (temporarily
room 310, but reverting to 304 some time during the semester).
1
pf3
pf4
pf5

Partial preview of the text

Download TAYLOR'S SERIES and problems and more Exercises Mathematics in PDF only on Docsity!

Taylor series

Chris Hooley, University of St Andrews

first written 31st August 2006; last revised 13th September 2009

Contents

1 Introduction 1

2 What you absolutely need to know 2

3 Introduction to the theory 2

4 Taylor series: representing non-polynomial functions as polynomials 3

5 An example 4

6 Truncating the series, and estimating the error 5

7 A graphical interpretation 6

8 Taylor series for a function of a function 7

9 Exercises 7 9.1 On the need-to-know material............................. 7 9.2 More advanced..................................... 7

1 Introduction

These notes are designed to be brief but self-contained, and deal with Taylor series at a fairly elementary level. They are aimed at second-year students who either have not seen this topic be- fore, or who have seen it but need to brush up. They assume familiarity with basic differentiation and integration. The notes begin with a simple statement of the material you absolutely need to know; this is followed by a development of the theory, which you are encouraged (though not required) to study. If any questions arise, I can be contacted either during the scheduled drop- in sessions, by e-mail ([email protected]), or at my office (temporarily room 310, but reverting to 304 some time during the semester).

2 What you absolutely need to know

To obtain the Taylor expansion of a function f (x) about the point x = a:

  • Decide how many terms of the series you’re going to generate. Call this number n.
  • Obtain the derivatives of the function: f ′(x), f ′′(x),... , f (n−1)(x).
  • Evaluate these at the point a, to obtain f ′(a), f ′′(a),... , f (n−1)(a).
  • The resulting Taylor expansion is given by

f (a + x) = f (a) + xf ′(a) +

x^2 f ′′(a) +... +

(n − 1)! xn−^1 f (n−1)(a) + O(xn), (1)

where the notation O(xn) means ‘terms of order n or higher in the variable x’.

  • In the special case a = 0, (1) is called a Maclaurin expansion, but this is a mere terminological matter.

3 Introduction to the theory

Have you ever noticed how some functions ‘tell’ you how to calculate their values while others don’t? For example, consider the function

f (x) = x^2. (2)

You don’t need a table of values for this function. If I ask you to give me f (7), you can tell me straight away that the answer is 49. This is clearly true of any function that involves multiplying, adding, or subtracting the variables that it contains; likewise raising any of them to a positive integer power^1. Such a function is called a polynomial. If f (x) is a polynomial, then its degree means the highest power of x that it contains; for example, the function

f (x) = 6x^2 − 7 x + 4 (3)

is of degree two. Some of these have special names:

Degree of polynomial Name 0 constant 1 linear 2 quadratic 3 cubic 4 quartic 5 quintic On the other hand, a function like

f (x) = sin x (4)

does not ‘tell you how’ to work out its value. If you want to know the sine of 47 degrees, what do you do? Ask a calculator? But how does the calculator work out the answer? Before electronic (^1) Raising a number to a power is really just a form of multiplication, provided that the power is a positive integer or zero.

The conclusion: we can represent f (a + x) exactly as a polynomial providing that we already know the function and all its derivatives at the starting point a. The answer is^2

f (a + x) = f (a) + xf ′(a) +

x^2 f ′′(a) +

x^3 f ′′′(a) +... +

n! xnf (n)(a) +... (13)

∑^ ∞

n=

f (n)(a) n!

xn. (14)

5 An example

For example, let us construct the Taylor series for the function f (x) = sin x, starting at the point a = π 4. We know the value of the function and all its derivatives at point a:

f (x) = sin x → f (a) = sin π 4

f ′(x) = cos x → f ′(a) = cos π 4

f ′′(x) = − sin x → f ′′(a) = − sin π 4

f ′′′(x) = − cos x → f ′′′(a) = − cos

π 4

and since the fourth derivative of sin x is just sin x, the sequence then repeats forever^3. Taking out the common factor of √^12 , we therefore have

sin

( (^) π 4

  • x

1 + x − x^2 2!

x^3 3!

x^4 4!

with the sign changing every other term^4. This is sometimes referred to as the Taylor expan- sion of sin x about the point π 4. We could, of course, choose a different starting point for the expansion. Let’s do the case a = 0; this special case of a Taylor series is often called a Maclaurin series. In this case, we have

f (x) = sin x → f (a) = sin 0 = 0; (20) f ′(x) = cos x → f ′(a) = cos 0 = 1; (21) f ′′(x) = − sin x → f ′′(a) = − sin 0 = 0; (22) f ′′′(x) = − cos x → f ′′′(a) = − cos 0 = −1; (23)

and again, since f ′′′′(x) = f (x), this quartet of coefficients repeats forever. Hence

sin x = x − x^3 3!

x^5 5!

x^7 7!

This is the Maclaurin expansion of sin x about the point 0.

(^2) This is just equation (5) copied out again, but replacing the coefficients cn with their values given by (12). (^3) Ah, the beauty of periodic functions! (^4) If you’d like an exercise, try to write this Taylor series in the form of a sum.

6 Truncating the series, and estimating the error

So that has solved the problem of determining the coefficients, but we still have to face the fact that the series usually has an infinite number of terms, making it slightly impractical. However, if x  1 (i.e. if the point we want is rather close to the starting point), then the x^2 term should be smaller than the x term, the x^3 term smaller than the x^2 term, and so forth. In that case, the terms will become so small after a while that they won’t be making a significant difference to the answer. For example, let’s calculate sin 47◦^ to eight decimal places. We should therefore Taylor- expand sin x around the nearest point for which we know its value, which in this case is 45◦^ = π 4. Copying the series from (19) above:

sin

( (^) π 4

  • x

1 + x −

x^2 2!

x^3 3!

x^4 4!

where now we will substitute in x = 2◦^ = 90 π. Hence^5

x = π 90

x^2 =

( (^) π 90

x^3 =

( (^) π 90

x^4 =

( (^) π 90

x^5 =

( (^) π 90

and we see that the terms from x^6 onwards won’t make any difference to the first eight decimal places^6. Hence we can use the truncated form of (25):

sin 47◦^ = sin

( (^) π 4

  • x

1 + x − x^2 2!

x^3 3!

x^4 4!

x^5 5!

This is described as the Taylor expansion of sin x about the point π 4 , up to and including fifth-order terms. You are encouraged to reproduce this calculation for yourself, and then check it against the answer your calculator gives when you ask it for sin 47◦^ directly! It is sometimes useful to make an estimate of the error made by truncating the Taylor series. Provided that x  1, a good estimate of the error is just the first term that we didn’t include. So in this case, the error estimate ε is given by the sixth-order term that we dropped^7 :

ε ≈

x^6 6!

= 2. 5 × 10 −^12. (34)

(^5) All these results are reported to eight decimal places. (^6) In fact, because of the factor 1 5! in the Taylor expansion, the^ x (^5) term isn’t needed either. But it’s better to be on the safe side if in doubt. (^7) The relevant term in the Taylor series would in fact have been negative, but we ignore the sign, since errors have to do with magnitudes.

8 Taylor series for a function of a function

A quick note about finding truncated Taylor series for more complicated functions. For example, suppose I want the third-order Maclaurin expansion^8 of the function

h(y) = sin [ln(1 + y)]. (38)

One way to do it would be using the ordinary rules for deriving a Taylor series. The other would be to use the series for sin x and ln(1 + y), which are easier to derive^9 :

sin x = x − x^3 3!

  • O(x^5 ); (39)

ln(1 + y) = y − y^2 2

y^3 3

  • O(y^4 ). (40)

If we substitute the right-hand side of (40) in place of x in (39), we obtain

sin [ln(1 + y)] =

y − y^2 2

y^3 3

y − y^2 2

y^3 3

  • O(y^4 ) (41)

= y − y^2 2

y^3 6

  • O(y^4 ), (42)

where to obtain the last line we have multiplied out the brackets and thrown away all terms of higher order than y^3. You are encouraged to derive the Maclaurin series for (38) directly and check that the answer comes out the same.

9 Exercises

9.1 On the need-to-know material

  1. Find the Taylor expansion of the function cos x about the point x = π 6 , to all orders.
  2. Find the Taylor expansion of the function (^1) t about the point t = 2, to all orders.
  3. Find the Maclaurin expansion of the function

1 + x, up to and including terms of order x^4.

9.2 More advanced

  1. Find the third-order Maclaurin expansion of the function (^) 1+^1 y , and use it to estimate the decimal expansion of 1011. Estimate the error in your answer.
  2. Using Taylor-series techniques, obtain the value of tan 138◦^ to five decimal places. (Hint: Choose a sensible starting point! A sketch of the angle involved may help.)

(^8) Remember, a Maclaurin expansion is just a Taylor expansion about the origin. (^9) The symbol O(y (^4) ) at the end means that all the omitted terms are of fourth order or higher in y.