Professional Documents
Culture Documents
Chebyshev polynomials
Orthogonal polynomials
Converge faster than a Taylor series
Rational functions
Ratio of two polynomials
Fourier series
Seriesof sine and cosine terms
Can approximate periodic or discontinuous functions
Numerical Methods © Wen-Chieh Lin 3
Truncation Error in Taylor Series
Recall that Taylor series
f " (a )
f ( x ) f (a ) f ' (a )( x a ) ( x a )2
2!
f ( n ) (a ) f ( n 1)
()
f (a ) ( x a )
n
( x a ) n 1
n! ( n 1)!
If approximating a function using first n terms
f ( n 1) ()
Error ( x a )n 1
(n 1)!
Proof
Tn 1 ( x ) Tn 1 ( x ) 2 xTn ( x )
T0 ( x ) 1 1 T0
T1 ( x ) x x T1
1
T2 ( x ) 2 x 1
2
x (T2 T0 )
2
2
1
T3 ( x ) 4 x 3 3x x (T3 3T1 )
3
4
1
T4 ( x ) 8 x 4 8 x 2 1 x (T4 4T2 3T0 )
4
~ x a
f ( x) f ( ~
x) x 2 1
b a
Numerical Methods © Wen-Chieh Lin 8
Example: Economizing a Power Series
Maclaurin series is Taylor series expansion of
a function about 0 1
x (T2 T0 )
2
x 2
Maclaurin series of e
1
2 3 4 5 6 x 3
(T3 3T1 )
x x x x x 4
e 1 x
x
2 6 24 120 720 1
x (T4 4T2 3T0 )
4
8
Approximated by a Chebyshev series
1 1 1 1 1 1
e T0 T1 (T2 T0 ) (T3 3T1 ) (T4 4T2 3T0 )
x
2 2 6 4 24 8
1 1 1
(10T1 5T3 ) (10T0 15T2 )
120 16 23040
Numerical Methods © Wen-Chieh Lin 9
Example (cont.)
Maclaurin series of ex truncated after 3rd
degree 2 3 4 5 6
x x x x x
e x 1 x
2 6 24 120 720
x2 x3
1 x
2 6
Chebyshev series of ex truncated after 3rd
degree
e x 1.2661T0 1.1302T1 0.2715T2 0.0443T3
x
Numerical Methods © Wen-Chieh Lin 11
Orthogonaliy of Chebyshev Polynomials
Two polynomials p(x), q(x) are orthogonal on
an interval [a, b] if their inner product
b
p, q p( x ) q( x ) w( x )dx 0, w( x ) 0
a
N n m 1
Padé approximation: n ≥m
Numerical Methods © Wen-Chieh Lin 15
Padé Approximation
Represent a function in a Taylor series
expanded at x = 0
Coefficients are determined by setting
f ( x ) RN ( x ) f ( i ) (0)
ci
i!
a a x a x 2
a x n
( c0 c1 x c2 x 2 cN x N ) 0 1 2 n
1 b1 x b2 x 2 bm x m
and equating coefficients
a0 c0 cn 1 b1cn bm cn m 1 0
a1 b1c0 c1
cN b1cN 1 bm cN m 0
an bm cn m b1cn 1Numerical
cn Methods © Wen-Chieh Lin 16
Example: Padé Approximation
Findarctan(x) ≈R10(x)
Maclaurin series of arctan(x) through x10 is
1 3 1 5 1 7 1 9
arctan( x ) x x x x x
3 5 7 9
f(x) = R10(x)
Pade approximation
True value
Pade approximation
Maclaurin series
Numerical Methods © Wen-Chieh Lin 20
Chebyshev-Padé Rational Function
We can get a rational function approximation
from a Chebyshev series expansion of a
function as well
Example:
e x 1.2661T0 1.1302T1 0.2715T2 0.0443T3
We first form
a0 a1T1 a2T2
1.2661T0 1.1302T1 0.2715T2 0.0443T3
1 b1T1
Chebyshev serires
Pade-Chebyshev
rational function
0, n 0
sin( nx )dx 0
cos(nx )dx
2, n 0
sin( nx ) cos( mx )dx 0
0, n m
sin(nx ) sin( mx )dx
, n m
0, n m
cos(nx ) cos(mx )dx
, n m
Numerical Methods © Wen-Chieh Lin 27
Computing Fourier Coefficients
using Orthogonality
A0
f ( x ) An cos(nx ) Bn sin( nx )
2 n 1
A0
f ( x )dx dx An cos(nx )dx Bn sin(nx )dx
2
n1 n 1
A00 0
A
cos( mx ) f ( x ) dx 0
cos(mx )dx An cos(nx ) cos(mx )dx
2
n1
Bn sin(nx ) cos(mx )dx
n
1
0 Am0
1
Am cos(mx ) f ( x )dx, m 1,2....
Numerical Methods © Wen-Chieh Lin 28
Computing Fourier Coefficients
using Orthogonality (cont.)
A0
f ( x ) An cos(nx ) Bn sin( nx )
2 n 1
A
sin( mx ) f ( x ) dx 0
sin(mx )dx An cos(nx ) sin(mx )dx
2
n 1
Bn sin(nx ) sin(mx )dx
n
1
0 Bm0
1
Bm f ( x ) sin(mx )dx, m 1,2....
Numerical Methods © Wen-Chieh Lin 29
Fourier Series for Periods other than 2π
Letthe period of f(x) be P
Consider that f(x) is periodic in [-P/2, P/2]
Change of variable y
x
P2
1
Am cos(mx ) f ( x )dx, m 1,2....
2 P2 2mx
Am f ( x ) cos( )dx, m 1,2....
P P 2 P
1
Bm f ( x ) sin(mx )dx, m 1,2....
2 P2 2mx
Bm f ( x ) sin( )dx, m 1,2....
P P 2 P
Numerical Methods © Wen-Chieh Lin 30
Fourier Series for Periods other than 2π
A0
2nx 2nx
f ( x ) An cos( ) Bn sin( )
2 n 1 P P
2 P2 2nx
An f ( x ) cos( )dx, n 1,2....
P P 2 P
2 P2 2nx
Bn f ( x ) sin( )dx, n 1,2....
P P 2 P
Numerical Methods © Wen-Chieh Lin 31
Example: f(x) = x, x in [-π,π]
1
Am cos(mx ) f ( x )dx, m 1,2....
1 1 sin(mx ) sin(mx )
cos(mx ) xdx x dx 0
m m
1
Bm f ( x ) sin(mx )dx, m 1,2....
1 1 cos(mx ) cos(mx )
sin(mx ) xdx x dx
m m
2 cos(m) 2( 1) m 1
2( 1) m 1
m m x sin( mx )
m
1 m
Numerical Methods © Wen-Chieh Lin 32
Fourier Series for Nonperiodic Functions
Chop the interval of interest [0, L]
L
if f ( x ) is odd f ( x)dx 0
L
Numerical Methods © Wen-Chieh Lin 36
Fourier Series for Even Functions
2 P2 2mx
Am f ( x ) cos( )dx, m 1,2....
P P 2 P
2 L 2mx
f ( x ) cos( )dx even function
2 L L 2L
1 L mx
2 f ( x ) cos( )dx
L 0 L
2 P2 2mx
Bm f ( x ) sin( )dx, m 1,2....
P P 2 P
0 odd function
Numerical Methods © Wen-Chieh Lin 37
Fourier Series for Odd Functions
2 P2 2mx
Am f ( x ) cos( )dx, m 1,2....
P P 2 P
0 odd function
2 P2 2mx
Bm f ( x ) sin( )dx, m 1,2....
P P 2 P
2 L 2mx
f ( x ) sin( )dx even function
2L L 2L
1 L mx
2 f ( x ) sin( )dx
L 0 L
Numerical Methods © Wen-Chieh Lin 38
Example: Fourier Series of Nonperiodic
Functions—even extension y
0, 0 x 1
f ( x ) 1
1, 1 x 2
2 L mx x
Am f ( x ) cos( )dx -2 -1 1 2
L 0 L
mx 0, m even
2 2
f ( x ) cos( )dx ( 1)( m 1) 2
2 0 2 2 , m odd
m
2 2
A0 f ( x )dx 1
2 0
A0 2nx 2nx
f ( x ) An cos( ) Bn sin( )
2 n 1 P P
Numerical Methods © Wen-Chieh Lin 39
Example: Fourier Series of Nonperiodic
Functions—odd extension y
0, 0 x 1
1
f ( x )
1, 1 x 2
x
2 L mx -2 -1 1 2
Bm f ( x ) sin( )dx -1
L 0 L
2 2 mx 2 m
f ( x ) sin( )dx cos(m) cos( )
2 0 2 m 2
A0 2nx 2nx
f ( x ) An cos( ) Bn sin( )
2 n 1 P P
n
2 cos(n) cos( 2 ) nx
sin( )
n 1 n 2
Numerical Methods © Wen-Chieh Lin 40