7 | SERIES EXPANSION AND APPROXIMATIONS

This chapter of Single Variable Calculus by Dr JH Klopper is licensed under an Attribution-NonCommercial-NoDerivatives 4.0 International Licence available at http://creativecommons.org/licenses/by-nc-nd/4.0/?ref=chooser-v1 .

7.1 Introduction

In this chapter we explore the series expansion of functions. The Maclaurin series is a special case of Taylor expansions. Such expansions allow us to recreate functions within an interval. This helps us understand the approximation of functions.

7.2 Higher-order derivatives


7.3 Maclaurin series


7.4 Taylor series

The Taylor series expansion of a function
f(x)
is the generalization of the Maclaurin series at
x
x
0
.
Definition 7.4.1 The Taylor series is an infinite expansion of a function
f(x)
at
x
x
0
, given in ().
f(x)=
f(
x
0
)
0
(x-
x
0
)
0!
+
f'(
x
0
)
1
(x-
x
0
)
1!
+
f''(
x
0
)
2
(x-
x
0
)
2!
+
(3)
f
(
x
0
)
3
(x-
x
0
)
3!
+…​​f(x)=
lim
n->∞

n
∑
i=0
(i)
f
(
x
0
)
i
(x-
x
0
)
i!

(
17
)
We can once again truncate the expansion to the
th
n
-order derivative, shown in ().
f(x)‶
f(
x
0
)
0
(x-
x
0
)
0!
+
f'(
x
0
)
1
(x-
x
0
)
1!
+
f''(
x
0
)
2
(x-
x
0
)
2!
+
(3)
f
(
x
0
)
3
(x-
x
0
)
3!
+…+
(n)
f
(
x
0
)
n
(x-
x
0
)
n!
+O
n+1
(x-
x
0
)
(
18
)
​
Problem 7.4.1 Calculate the Taylor series expansion of the function
f(x)
x
e
at
x4
to the fifth order derivative.
In () we calculate
f(4)
, and the derivatives with respect to
x
at
x4
.
f(x)=
x
e
andf(4)=
4
e
​​f'(x)=
x
e
andf'(4)=
4
e
​​⋮​​
(5)
f
(x)=
x
e
and
(5)
f
=
4
e
(
19
)
In () we use the calculation above and the definition of the Taylor series to calculate the solution.
f(x)≈
4
e
0
(x-4)
0!
+
4
e
1
(x-4)
1!
+
4
e
2
(x-4)
2!
+
4
e
3
(x-4)
3!
+
4
e
4
(x-4)
4!
+
4
e
5
(x-4)
5!
+O
6
(x-4)
​​f(x)≈
4
e
1+(x-4)+
2
(x-4)
2
+
3
(x-4)
6
+
4
(x-4)
24
+
5
(x-4)
120
+O
6
(x-4)
(
20
)
The code below confirms the result. Note that the Wolfram Language result does not extract
4
e
as a common factor.
In[]:=
Series[
x

,{x,4,5}]
Out[]=
4

+
4

(x-4)+
1
2
4

2
(x-4)
+
1
6
4

3
(x-4)
+
1
24
4

4
(x-4)
+
1
120
4

5
(x-4)
+
6
O[x-4]
​

7.5 Linear approximation

In () we consider the point-slope form of a line in the Cartesian plane tangent to a curve
f(x)
at
x
1
=a
, where
m=f'(a)
with
(
x
1
,
y
1
)=(a,f(a))
and
y=L(x)
, the function of the tangent line.
y-
y
1
=m(x-
x
1
)​​y=m(x-
x
1
)+
y
1
​​L(x)=(x-a)f'(a)+f(a)
(
21
)
In () we consider the function
f(x)=
2
x
at
x
1
=1
, where
y
1
=f(1)=
2
1
=1
with
f'(x)=2x
and
f'(1)=2
.
L(x)=(x-1)(2)+1​​L(x)=2x-2+1​​L(x)=2x-1
(
22
)
This is the function for the tangent line
L(x)
at
(
x
1
,
y
1
)(1,1)
.
Figure 7.5.1 visualizes the curve
f(x)
2
x
and the tangent line
L(x)
at
(
x
1
,
y
1
)(1,1)
.
ShowPlot{
2
x
,2x-1},x,
6
10
,
3
2
,PlotLegends->{"curve of the function","linear approximation"},PlotLabel->"Figure 7.5.1",AxesLabel->{"x","y"},GridLines->Automatic,ImageSize->Large,Graphics[{PointSize[Large],Point[{1,1}]}]
Out[]=
curve of the function
linear approximation
The tangent line approximates the curve at
x=1
and is called a linear approximation.
Definition 7.5.1 The linear approximation of a function
f(x)
at
xa
is the function of the tangent line
L(x)≈f(x)
at
xa
, shown in ().
L(x)=(x-a)f'(a)+f(a)
(
23
)
We can calculate the interval on which the difference between the function and its linear approximation less than (or equal to) a given value. In the code cell below, we create the user-defined functions f and tangent to hold the original function in the example above and its linear approximation at
x=1
.
In[]:=
f[x_]:=
2
x
​​tangent[x_]:=2x-1
The code considers where the difference between the function and its linear approximation is less than a tenth. We use the RealAbs function since the difference is a distance and should not be sign dependent. The TraditionalForm function prints the results in mathematical format.
In[]:=
TraditionalFormRealAbs[f[x]-tangent[x]]<
1
10

Out[]//TraditionalForm=

2
x
-2x+1<
1
10
The Reduce function calculates the interval.
In[]:=
TraditionalFormReduceRealAbs[f[x]-tangent[x]]<
1
10
,x
Out[]//TraditionalForm=
1
10
(10-
10
)<x<
1
10
(10+
10
)
Using the N function, we can calculate a linear approximation to the domain.
In[]:=
NTraditionalFormReduceRealAbs[f[x]-tangent[x]]<
1
10
,x
Out[]//TraditionalForm=
0.683772<x<1.31623
The inequality of fairly simple to solve by hand. First, we factor the expression
2
x
-2x+1
which is the difference between the function and its linear approximation in().
2
x
-2x+1=(x-1)(x-1)=
2
(x-1)
(
24
)
The factorization is confirmed using code.
In[]:=
Factor[
2
x
-2x+1]
Out[]=
2
(-1+x)
We solve the inequality for
x
in ().

2
(x-1)
<
1
10
​​
2
(x-1)
<
1
10
​​x-1<
1
10
​​-
1
10
<x-1<
1
10
(expansionoftheinequality)
​​-
1
10
+1<x<
1
10
+1​​-
1
10
+1<x<
1
10
+1​​-
10
10
+
10
10
<x<
10
10
+
10
10
​​
1
10
(10-
10
)<x<
1
10
(
10
+10)
(
25
)
​
Problem 7.5.1 Calculate a linear approximation
L(x)
of the function
f(x)+
x
near
x=4
.
The result is shown in ().
​
​
We use the same code as in the explanation of linear approximations above to solve the problem.
​
​
We use the definition of the linear approximation in ().
We plot the solution in Figure 7.5.3.
​

7.6 Approximation using series expansion

By using the Maclaurin series expansion, and more generally the Taylor series expansion, we can calculate approximations that are closer to the original function on a larger domain.
​
Below we calculate terms up to the eight derivative.
​