Next: Exercises
Up: Taylor Series
Previous: Introduction
Suppose that the function f(x) has continuous derivatives of orders
1, 2, ..., n+1. From the definition of the integral as the anti-derivative
of a function, we have:
where
is the derivative of f(t) with respect to its
argument, t in this case. The lower limit of the integral, where t =
a, and f(x) takes the value f(a), is arbitrary as long as the
function f(x) exists there and has the derivatives already specified.
The rule for the differentiation of the product of two functions,
say u and v, is:
which we can slightly re-arrange and integrate to obtain:
This leads to the technique of integration by parts. The choice
of u and v can often lead to a simpler integral to be evaluated.
In the case at hand, we can make the choices:
Upon differentiating u with respect to t and integrating dv with
respect to t, we have:
where in the result v = t - x, we have introduced a constant of
integration, x, which is indeed a constant when we integrate with
respect to t, as we are doing here.
Putting these results into the integration by parts formula, we obtain:
Noting that the left hand side is just f(x) - f(a), and that the first
term on the right hand side vanishes at the upper limit, t = x, and
is simply
at the lower limit, we have the result:
Thus we have succeeded in writing the function f(x) in terms of its
value f(a) at the point x = a, plus a linear term in (x-a) with
coefficient
,
the first derivative at the same point x =
a, with a remainder term which involves the second derivative
of f(t) on the interval t = a to t = x.
The approach used to obtain the first level result above can now be
applied again, but concentrating on the remaining integral, involving
the second derivative
.
We can use the same integration by parts technique again, but now choosing:
so that differentiating u with respect to t, and integrating dv
with respect to t yields:
where the notation f(n)(x) indicates the nth derivative of f(x)
with respect to its argument. Note that the constant of integration for
v has been taken to be zero at this level, as it will be taken at
higher levels.
The expression for f(x) becomes:
By repeating this integration by parts process on the remaining integral
p times, one has the result:
where
is
the factorial of n.
This result is valid when both x and a are in an interval over which
f(x) and its first n+1 derivatives are continuous, as defined in calculus
courses.
The expression for f(x) given here is called Taylor's formula with
integral remainder, derived by Brook Taylor (1685-1731). The last term
is referred to as the remainder, Rn(x), since it contains the
difference between the function f(x) and the representation of f(x)
offered by the first n+1 terms of the Taylor formula. When the remainder
reaches a limiting value of 0 as
,
we can represent
f(x) by the infinite Taylor series:
which we can also write as the infinite sum:
where it is important to note that n! is taken to have the value 1
when n = 0.
The remainder Rn(x) gives us the error we make in approximating
f(x) when we truncate the series at the term in (x-a)n.
The remainder can be written in a number of ways, some of which are more
usable than the integral form given above. For our purposes, the most
useful form is that derived by J. L. Lagrange (1736-1813), resulting in
the Taylor formula with derivative remainder:
where
is some number between x and a. Thus the explicit value
for the remainder in the integral form, which requires knowing the
function f(x) well enough to be able to evaluate the integral, has
been replaced by an form dependent only on the (n+1)th derivative of
f(x), but at some point,
,
unknown to us, except that it lies
between the values x and a.
When the point, a, about which we form the Taylor expansion is a = 0,
the expansion is called the Maclaurin expansion. As a first example, we
consider the Maclaurin expansion for the function
.
Using the
familiar results that:
we have f(0) = 0,
,
,
f(3)(0) = -1,
f(4)(0) = 0,
f(5)(0) = 1, continuing in
the sequence
{0,1,0,-1,0,1,0,-1,...}. The Taylor formula
for
about 0 is thus:
While it easy to see how to write any higher order terms, we still have to
demonstrate that Rn(x) approaches 0 as
.
The
derivative form of the remainder makes this quite easy, since we know that
the (n+1)th derivative is either
or
,
depending on
whether n is odd or even. Thus f(n+1)(x) always lies between -1
and +1, so that we can say that
|f(n+1)(x)|, the absolute value
of f(n+1)(x), always lies in the interval [0,1].
Thus the remainder satisfies:
Since the numerator of the right hand side is finite for finite x, and
the denominator approaches infnty as
,
the
remainder
as
.
Thus we can
conclude that the Taylor series for
about x = 0 will
converge.
The Taylor series has provided us with a way of evaluating a function
over an interval, but using only information about that function and
its derivatives at one point. In addition, it allows us to write the
function as a polynomial plus a remainder term, and when the Taylor
series converges, we can always make the remainder term as small as
we like, simply by taking a sufficient number of terms in the polynomial
expression. This is particularly useful because a lot is known about
polynomial functions, and leads to the basis for essentially all the
numerical techniques we will use in numerical scientific computation.
A related technique is to represent a function f as a series in the
basic trigonometric functions,
and
.
Such a series is
called a Fourier series, and is particularly useful in the analysis of
periodic systems, such as vibrating strings, etc.
Even though we started off assuming that f is known only at a, Taylor
series are actually very useful even if the function f is a known function.
For example, we have found that with
and a = 0:
This approximation holds for all values of x, as long as enough terms
in the series are used. (Calculators use this series to evaluate
.)
A similar approach yields
etc.
Besides giving a numerical value to the sine function at any desired point,
this approximation shows that for small x,
.
This
is because, the higher order terms all have powers of x greater than 1,
which means that the numerator is already much smaller than x, and then
they are divided by larger and larger denominators. So the higher order
terms are smaller than the first term. The bottom line is:
looks like y=x for
.
There are many applications of this
approximation. One is the function
.
At x=0, this function
is singular (0/0). But the Taylor series for
shows that this function
is approximately 1 at x=0, as we can by dividing the Taylor series
for
by x to yield:
Taking the limit as
,
it is clear that the limit of
the series is simply 1.
Another familiar example of the use of the
Taylor series is in
the consideration of the simple pendulum. In this case the restoring
force arising from the resolution of the vertical force of gravity and
the tension in the string is proportional to the
of the angular
displacement of the string from the vertical line. In this form the
equation for the pendulum is not particularly simple to solve, but if
one is limited to small displacements of the pendulum, then the
of the angle can be replaced by the Taylor series, and if the
displacement is very small, say limited to a few degrees, then the
function needs only be replaced by the leading term of
the
series. This leads to a linear restoring force,
the hallmark of a simple harmonic oscillator, a very useful
approximation indeed, since it arises in so many physical systems.
It is frequently useful to write the Taylor series in the slightly
different form:
In writing this we have used the notation h = x - a, so that x no
longer appears and the variable of interest is h, which measures the
distance of the point of evaluation, x = a + h, from the point where
the function and its derivatives are to be evaluated, ie. at x = a.
We have also introduced the notion of the order of the Taylor
series, indicating where the series has been truncated, indicated by
the notation
.
This means that all terms of order n
or higher have been ignored, and are to be interpreted as being
represented by the symbol
.
In the example given above,
one should consider only terms of order h3 or lower to be of
significance when using the series in a calculation.
Taylor series are most useful when it is possible to stop the infinite sum
at some point and use only the first few terms of the series. Since h is
usually small (h<1), the higher order terms will all contain higher powers
of h which should mean that they will be smaller than the first few terms.
So truncating the series should lead to an approximation which is not too
bad. It is frequently important to make it clear as to what order a
series has been evaluated before it was truncated, so the
notation is very useful.
Next: Exercises
Up: Taylor Series
Previous: Introduction
Charles Dyer
2002-04-24