Find the (smallest) period of
c
o
s
n
ω
x
{\displaystyle cosn\omega x}
and
s
i
n
n
ω
x
{\displaystyle sinn\omega x}
.
Show that these functions also have a period p .
Show that the constant
a
o
{\displaystyle a_{o}}
is also a periodic function with period p .
Given (1) p.9-2:
f
(
x
+
n
p
)
=
f
(
x
)
{\displaystyle f(x+np)=f(x)}
for all
n
(
.
.
.
,
−
2
,
−
1
,
0
,
1
,
2...
)
{\displaystyle n(...,-2,-1,0,1,2...)}
and where p is the period.
The smallest period occurs when n =1 thus we can use the equation as:
f
(
x
+
p
)
=
f
(
x
)
{\displaystyle f(x+p)=f(x)}
For
f
(
x
)
=
c
o
s
(
n
ω
x
)
{\displaystyle f(x)=cos(n\omega x)}
we have:
f
(
x
+
p
)
=
c
o
s
n
ω
(
x
+
p
)
=
c
o
s
(
n
ω
x
+
n
ω
p
)
=
c
o
s
(
n
ω
x
)
c
o
s
(
n
ω
p
)
−
s
i
n
(
n
ω
x
)
s
i
n
(
n
ω
p
)
{\displaystyle f(x+p)=cosn\omega (x+p)=cos(n\omega x+n\omega p)=cos(n\omega x)cos(n\omega p)-sin(n\omega x)sin(n\omega p)}
Thus,
c
o
s
(
n
ω
x
)
c
o
s
(
n
ω
p
)
−
s
i
n
(
n
ω
x
)
s
i
n
(
n
ω
p
)
=
c
o
s
n
ω
x
{\displaystyle cos(n\omega x)cos(n\omega p)-sin(n\omega x)sin(n\omega p)=cosn\omega x}
c
o
s
(
n
ω
x
)
c
o
s
(
n
ω
p
)
=
c
o
s
(
n
ω
x
)
(
1
)
{\displaystyle cos(n\omega x)cos(n\omega p)=cos(n\omega x)(1)}
c
o
s
(
n
ω
p
)
=
1
{\displaystyle cos(n\omega p)=1}
n
ω
p
=
2
π
{\displaystyle n\omega p=2\pi }
p
=
2
π
n
ω
{\displaystyle p={\frac {2\pi }{n\omega }}}
, smallest period occurs when n =1 so,
p
=
2
π
ω
{\displaystyle p={\frac {2\pi }{\omega }}}
For
f
(
x
)
=
s
i
n
(
n
ω
x
)
{\displaystyle f(x)=sin(n\omega x)}
we have:
f
(
x
+
p
)
=
s
i
n
n
ω
(
x
+
p
)
=
s
i
n
(
n
ω
x
+
n
ω
p
)
=
s
i
n
(
n
ω
x
)
c
o
s
(
n
ω
p
)
−
c
o
s
(
n
ω
x
)
s
i
n
(
n
ω
p
)
{\displaystyle f(x+p)=sinn\omega (x+p)=sin(n\omega x+n\omega p)=sin(n\omega x)cos(n\omega p)-cos(n\omega x)sin(n\omega p)}
< br />
Thus,
s
i
n
(
n
ω
x
)
c
o
s
(
n
ω
p
)
−
c
o
s
(
n
ω
x
)
s
i
n
(
n
ω
p
)
=
s
i
n
(
n
ω
x
)
{\displaystyle sin(n\omega x)cos(n\omega p)-cos(n\omega x)sin(n\omega p)=sin(n\omega x)}
s
i
n
(
n
ω
x
)
c
o
s
(
n
ω
p
)
=
s
i
n
(
n
ω
x
)
(
1
)
{\displaystyle sin(n\omega x)cos(n\omega p)=sin(n\omega x)(1)}
c
o
s
(
n
ω
p
)
=
1
{\displaystyle cos(n\omega p)=1}
n
ω
p
=
2
π
{\displaystyle n\omega p=2\pi }
p
=
2
π
n
ω
{\displaystyle p={\frac {2\pi }{n\omega }}}
, smallest period occurs when n =1 so,
p
=
2
π
ω
{\displaystyle p={\frac {2\pi }{\omega }}}
From (1) p9-5, we know that
ω
=
2
π
p
{\displaystyle \omega ={\frac {2\pi }{p}}}
Then,
p
=
2
π
ω
=
2
π
2
π
p
=
p
{\displaystyle p={\frac {2\pi }{\omega }}={\frac {2\pi }{\frac {2\pi }{p}}}=p}
Thus, the period of both of these functions is also
p
{\displaystyle p}
.
From (1) p.9-7, we know
a
o
=
1
2
L
∫
0
2
L
f
(
x
)
d
x
=
1
p
<
f
,
1
>
{\displaystyle a_{o}={\frac {1}{2L}}\int _{0}^{2L}f(x)dx={\frac {1}{p}}<f,1>}
Also,
a
o
=
1
2
π
∫
0
2
π
f
(
x
)
d
x
=
1
p
<
f
,
1
>
{\displaystyle a_{o}={\frac {1}{2\pi }}\int _{0}^{2\pi }f(x)dx={\frac {1}{p}}<f,1>}
Thus,
p
=
2
π
{\displaystyle p=2\pi }
showing
a
o
{\displaystyle a_{o}}
is a periodic function with period
p
{\displaystyle p}
.
This problem is solved and uploaded by Radina Dikova
Is the given function even or odd or either even nor odd? Find its Fourier series. Show details of your work.
11.
f
(
x
)
=
x
2
,
(
−
1
<
x
<
1
)
,
p
=
2
{\displaystyle 11.f(x)=x^{2},\;(-1<x<1),\;p=2}
12.
f
(
x
)
=
1
−
x
2
4
,
(
−
2
<
x
<
2
)
,
p
=
4
{\displaystyle 12.f(x)=1-{\frac {x^{2}}{4}},\;(-2<x<2),\;p=4}
Solved and uploaded by William Knapper
K 2011 p.491 pbs 15,17
Find if the graph is for an even or odd problem and then find the fourier series. Graph the resulting equations.
Problem 15:
Problem 17:
For problem 15:
f(-x) = -f(x), therefore the graph shows an odd function. Similarly, L =
π
{\displaystyle \pi }
.
Therefore we can use the Euler formula for an odd function:
f
(
x
)
=
∑
n
=
1
∞
b
n
sin
(
n
x
)
{\displaystyle f(x)=\sum _{n=1}^{\infty }b_{n}\sin(nx)}
b
n
=
2
π
∫
0
π
f
(
x
)
sin
(
n
x
)
d
x
{\displaystyle b_{n}={\frac {2}{\pi }}\int _{0}^{\pi }f(x)\sin(nx)dx}
During
[
0
,
π
2
]
{\displaystyle [0,{\frac {\pi }{2}}]}
, f(x) = x. During
[
π
2
,
π
]
{\displaystyle [{\frac {\pi }{2}},\pi ]}
,
f
(
x
)
=
π
−
x
{\displaystyle f(x)=\pi -x}
Therefore,
b
n
=
2
π
(
∫
0
π
2
x
sin
(
n
x
)
d
x
+
∫
π
2
π
(
π
−
x
)
sin
(
n
x
)
d
x
)
{\displaystyle b_{n}={\frac {2}{\pi }}(\int _{0}^{\frac {\pi }{2}}x\sin(nx)dx+\int _{\frac {\pi }{2}}^{\pi }(\pi -x)\sin(nx)dx)}
Using integration by parts shows
b
n
{\displaystyle b_{n}}
to be:
b
n
=
2
π
n
2
(
2
sin
(
π
2
n
)
−
sin
(
π
n
)
)
{\displaystyle b_{n}={\frac {2}{\pi n^{2}}}(2\sin({\frac {\pi }{2}}n)-\sin(\pi n))}
when, for the first integral:
u
=
x
,
d
u
=
d
x
,
d
v
=
sin
(
n
x
)
d
x
,
a
n
d
v
=
−
1
n
cos
(
n
x
)
{\displaystyle u=x,du=dx,dv=\sin(nx)dx,andv=-{\frac {1}{n}}\cos(nx)}
and for the second integral (where u, du, v, and dv are not the same as the first integral):
u
=
π
−
x
,
d
u
=
−
d
x
,
d
v
=
−
sin
(
n
x
)
d
x
,
a
n
d
v
=
1
n
cos
(
n
x
)
{\displaystyle u=\pi -x,du=-dx,dv=-\sin(nx)dx,andv={\frac {1}{n}}\cos(nx)}
Therefore, when n is odd,
b
n
=
+
o
r
−
4
π
n
2
{\displaystyle b_{n}=+or-{\frac {4}{\pi n^{2}}}}
and when n is even,
b
n
=
0
{\displaystyle b_{n}=0}
Therefore, the fourier series' are as follows:
For n=2 ->
f
(
x
)
=
4
π
sin
(
x
)
{\displaystyle f(x)={\frac {4}{\pi }}\sin(x)}
For n=4 ->
f
(
x
)
=
4
π
sin
(
x
)
+
4
π
9
sin
(
3
x
)
{\displaystyle f(x)={\frac {4}{\pi }}\sin(x)+{\frac {4}{\pi 9}}\sin(3x)}
For n = 8 ->
f
(
x
)
=
4
π
sin
(
x
)
+
4
π
9
sin
(
3
x
)
+
4
π
25
sin
(
5
x
)
+
4
π
49
sin
(
7
x
)
{\displaystyle f(x)={\frac {4}{\pi }}\sin(x)+{\frac {4}{\pi 9}}\sin(3x)+{\frac {4}{\pi 25}}\sin(5x)+{\frac {4}{\pi 49}}\sin(7x)}
A graph of the fourier series' is shown below:
For Problem 17:
f
(
−
x
)
=
f
(
x
)
{\displaystyle f(-x)=f(x)}
Therefore, it is an even function and L = 1. Similarly, because it's an even function, the Euler equations for an even function can be used:
f
(
x
)
=
a
0
+
∑
n
=
1
∞
a
n
cos
(
n
x
)
{\displaystyle f(x)=a_{0}+\sum _{n=1}^{\infty }a_{n}\cos(nx)}
a
0
=
1
π
∫
0
π
f
(
x
)
d
x
{\displaystyle a_{0}={\frac {1}{\pi }}\int _{0}^{\pi }f(x)dx}
a
n
=
2
π
∫
0
π
f
(
x
)
cos
(
n
x
)
d
x
{\displaystyle a_{n}={\frac {2}{\pi }}\int _{0}^{\pi }f(x)\cos(nx)dx}
During [0,1],
f
(
x
)
=
1
−
x
{\displaystyle f(x)=1-x}
Therefore:
a
0
=
∫
0
1
(
1
−
x
)
d
x
=
1
2
{\displaystyle a_{0}=\int _{0}^{1}(1-x)dx={\frac {1}{2}}}
However, the period is not 2
π
{\displaystyle \pi }
, so in
a
n
{\displaystyle a_{n}}
cos
(
n
x
)
{\displaystyle \cos(nx)}
is replaced with
c
o
s
(
n
π
x
)
{\displaystyle cos(n\pi x)}
to shift the function to a period of 2
π
{\displaystyle \pi }
. Similarly,
2
π
{\displaystyle {\frac {2}{\pi }}}
is replaced with
2
1
{\displaystyle {\frac {2}{1}}}
since L = 1.
Therefore:
a
n
=
2
∫
0
1
(
f
(
x
)
cos
(
n
π
x
)
)
d
x
=
2
∫
0
1
(
(
1
−
x
)
cos
(
n
π
x
)
)
d
x
{\displaystyle a_{n}=2\int _{0}^{1}(f(x)\cos(n\pi x))dx=2\int _{0}^{1}((1-x)\cos(n\pi x))dx}
Letting
u
=
1
−
x
,
d
u
=
−
d
x
,
d
v
=
cos
(
n
π
x
)
d
x
,
v
=
1
n
π
sin
(
n
π
x
)
{\displaystyle u=1-x,du=-dx,dv=\cos(n\pi x)dx,v={\frac {1}{n\pi }}\sin(n\pi x)}
where u, du, v, and dv are not the same as was used in number 15 above.
Integration by parts then yields:
a
n
=
2
(
−
1
n
2
π
2
(
cos
(
n
π
)
+
1
n
2
π
2
)
{\displaystyle a_{n}=2({\frac {-1}{n^{2}\pi ^{2}}}(\cos(n\pi )+{\frac {1}{n^{2}\pi ^{2}}})}
T
h
e
r
e
f
o
r
e
,
w
h
e
n
n
i
s
o
d
d
,
<
m
a
t
h
>
a
n
=
4
n
2
π
2
{\displaystyle Therefore,whennisodd,<math>a_{n}={\frac {4}{n^{2}\pi ^{2}}}}
and when n is even,
a
n
=
0
{\displaystyle a_{n}=0}
Therefore, the fourier series's are as follows:
For n = 2 ->
f
(
x
)
=
1
2
+
4
π
2
cos
(
π
x
)
{\displaystyle f(x)={\frac {1}{2}}+{\frac {4}{\pi ^{2}}}\cos(\pi x)}
For n = 4 ->
f
(
x
)
=
1
2
+
4
π
2
cos
(
π
x
)
+
4
9
π
2
cos
(
3
π
x
)
{\displaystyle f(x)={\frac {1}{2}}+{\frac {4}{\pi ^{2}}}\cos(\pi x)+{\frac {4}{9\pi ^{2}}}\cos(3\pi x)}
For n = 8 ->
f
(
x
)
=
1
2
+
4
π
2
cos
(
π
x
)
+
4
9
π
2
cos
(
3
π
x
)
+
4
25
π
2
cos
(
5
π
x
)
+
4
49
π
2
cos
(
7
π
x
)
{\displaystyle f(x)={\frac {1}{2}}+{\frac {4}{\pi ^{2}}}\cos(\pi x)+{\frac {4}{9\pi ^{2}}}\cos(3\pi x)+{\frac {4}{25\pi ^{2}}}\cos(5\pi x)+{\frac {4}{49\pi ^{2}}}\cos(7\pi x)}
This problem was solved and uploaded by John North
Consider the L2-ODE-CC with the window function f(x) from p9-8 as excitation:
y
″
−
3
y
′
+
2
y
=
r
(
x
)
{\displaystyle \ y''-3y'+2y=r(x)\ }
where r(x) = f(x)
and the initial conditions
y
(
0
)
=
1
,
y
′
(
0
)
=
0
{\displaystyle \ y(0)=1,y'(0)=0\ }
1. Find
y
n
(
x
)
{\displaystyle \ y_{n}(x)\ }
such that:
y
n
″
+
a
y
n
′
+
b
y
n
=
r
n
(
x
)
{\displaystyle \ y_{n}''+ay_{n}'+by_{n}=r_{n}(x)\ }
with the same initial conditions as above.
Plot
y
n
(
x
)
{\displaystyle \ y_{n}(x)\ }
for n = 3, 6, 9 for x in [0, 10]
2. Use the matlab command ode45 to integrate the L2-ODE-CC and plot the numerical soln to compare with the analytical soln.
Level 1: n = 0,1
λ
2
−
3
λ
+
2
=
0
=>
(
λ
−
2
)
(
λ
−
1
)
=
0
{\displaystyle \ \lambda ^{2}-3\lambda +2=0=>(\lambda -2)(\lambda -1)=0\ }
λ
1
,
2
=
2
,
1
{\displaystyle \ \lambda _{1,2}=2,1\ }
The Fourier series of a periodic function
f
(
x
)
=
a
0
+
∑
n
=
1
∞
[
a
n
{\displaystyle \ f(x)=a_{0}+\sum _{n=1}^{\infty }[a_{n}\ }
cos(nωx) +
b
n
{\displaystyle \ b_{n}\ }
sin(nωx)]
For an odd function the Fourier series will be the following:
f
(
x
)
=
∑
n
=
1
∞
b
n
{\displaystyle \ f(x)=\sum _{n=1}^{\infty }b_{n}\ }
sin(nωx)
=
∑
n
=
1
∞
b
n
s
i
n
(
n
∗
p
i
L
x
)
d
x
{\displaystyle \ =\sum _{n=1}^{\infty }b_{n}sin({\frac {n*pi}{L}}x)dx\ }
The independent variable t will be used to shift x to the left
t
=
x
−
1
4
{\displaystyle \ t=x-{\frac {1}{4}}\ }
The period of oscillation and frequency of oscillation will be as follows:
p
=
2
L
=
4
{\displaystyle \ p=2L=4\ }
ω = π/2
where
b
n
=
2
L
∫
0
L
f
(
x
)
s
i
n
(
n
∗
p
i
L
x
)
d
x
=
1
2
∫
0
2
f
(
x
)
s
i
n
(
n
∗
p
i
2
x
)
d
x
{\displaystyle \ b_{n}={\frac {2}{L}}\int _{0}^{L}f(x)sin({\frac {n*pi}{L}}x)dx={\frac {1}{2}}\int _{0}^{2}f(x)sin({\frac {n*pi}{2}}x)dx\ }
which comes to be:
b
n
=
A
n
∗
p
i
{\displaystyle \ b_{n}={\frac {A}{n*pi}}\ }
(1 - cosnπ)
y
″
−
3
y
′
+
2
y
=
r
(
x
)
{\displaystyle \ y''-3y'+2y=r(x)\ }
= 1/2 + (2/nπ) sin(nπ/2}t
The homogeneous equation for Y will be as follows:
Y
h
=
C
1
e
2
x
+
C
2
e
x
{\displaystyle \ Y_{h}=C_{1}e^{2x}+C_{2}e^{x}\ }
Y
=
Y
h
+
Y
p
=
C
1
e
2
x
+
C
2
e
x
+
C
3
{\displaystyle \ Y=Y_{h}+Y_{p}=C_{1}e^{2x}+C_{2}e^{x}+C_{3}\ }
This problem was solved and uploaded by Mike Wallace
Redo R4.2 to redisplay the particular solution, the homogenous solution, and the exact solution for n = 3,5,9 over the interval [0,20π]
Redisplay the particular solution, the homogenous solution, and the exact solution. Superpose each solution with the exact solution.
Redo R4.3 with the TA code over the interval [0.10]. Zoom in about x = -0.5, 0, and 0.5 and comment on the accuracy of different approximations.
Redo R4.4 with the TA code over the interval [0.9,10] for n = 4, 7. Zoom in about x = 1, 1.5, 2, 2.5 and comment on the accuracy of different approximations.
The re-displayed functions for the homogenous solutions are:
y
3
h
(
x
)
=
2
e
x
−
0.8008
e
2
x
{\displaystyle \displaystyle y_{3h}(x)=2e^{x}-0.8008e^{2x}\ }
y
5
h
(
x
)
=
2.0001
e
x
−
0.8001
e
2
x
{\displaystyle \displaystyle y_{5h}(x)=2.0001e^{x}-0.8001e^{2x}\ }
y
9
h
(
x
)
=
2
e
x
−
0.8
e
2
x
{\displaystyle \displaystyle y_{9h}(x)=2e^{x}-0.8e^{2x}\ }
The re-displayed functions for the particular solutions are:
y
3
p
(
x
)
=
−
9.9206
∗
10
−
5
x
7
−
0.0010
x
6
−
0.0031
x
5
−
0.0078
x
4
−
0.0990
x
3
−
0.3984
x
2
−
0.3984
x
−
0.1992
{\displaystyle \displaystyle y_{3p}(x)=-9.9206*10^{-5}x^{7}-0.0010x^{6}-0.0031x^{5}-0.0078x^{4}-0.0990x^{3}-0.3984x^{2}-0.3984x-0.1992\ }
y
5
p
(
x
)
=
−
1.2526
∗
10
−
8
x
11
−
2.0668
∗
10
−
7
x
10
−
1.0334
∗
10
−
6
x
9
−
4.6503
∗
10
−
6
x
8
−
1.1781
∗
10
−
4
x
7
{\displaystyle \displaystyle y_{5p}(x)=-1.2526*10^{-8}x^{11}-2.0668*10^{-7}x^{10}-1.0334*10^{-6}x^{9}-4.6503*10^{-6}x^{8}-1.1781*10^{-4}x^{7}\ }
−
0.0011
x
6
−
0.0033
x
5
−
0.0083
x
4
−
0.0999
x
3
−
0.3999
x
2
−
0.399
x
−
0.2000
{\displaystyle \displaystyle -0.0011x^{6}-0.0033x^{5}-0.0083x^{4}-0.0999x^{3}-0.3999x^{2}-0.399x-0.2000\ }
y
9
p
(
x
)
=
−
4.1103
∗
10
−
18
x
19
−
1.1714
∗
10
−
16
x
18
−
1.0543
∗
10
−
15
x
17
−
8.9615
∗
10
−
15
x
16
{\displaystyle \displaystyle y_{9p}(x)=-4.1103*10^{-18}x^{19}-1.1714*10^{-16}x^{18}-1.0543*10^{-15}x^{17}-8.9615*10^{-15}x^{16}\ }
−
4.5405
∗
10
−
13
x
15
−
9.1408
∗
10
−
12
x
14
−
6.3985
∗
10
−
11
x
13
−
4.1590
∗
10
−
10
x
12
−
1.5021
∗
10
−
8
x
11
−
2.2040
∗
10
−
7
x
10
{\displaystyle \displaystyle -4.5405*10^{-13}x^{15}-9.1408*10^{-12}x^{14}-6.3985*10^{-11}x^{13}-4.1590*10^{-10}x^{12}-1.5021*10^{-8}x^{11}-2.2040*10^{-7}x^{10}}
−
1.1020
∗
10
−
6
x
9
−
4.9591
∗
10
−
6
x
8
−
1.1904
∗
10
−
4
x
7
−
0.0011
x
6
−
0.0033
x
5
−
0.0083
x
4
−
0.1000
x
3
−
0.4000
x
2
−
0.4000
x
−
0.2000
{\displaystyle \displaystyle -1.1020*10^{-6}x^{9}-4.9591*10^{-6}x^{8}-1.1904*10^{-4}x^{7}-0.0011x^{6}-0.0033x^{5}-0.0083x^{4}-0.1000x^{3}-0.4000x^{2}-0.4000x-0.2000\ }
The re-displayed functions for the general solutions are:
y
3
(
x
)
=
2
e
x
−
0.8008
e
2
x
−
9.9206
∗
10
−
5
x
7
−
0.0010
x
6
−
0.0031
x
5
−
0.0078
x
4
−
0.0990
x
3
−
0.3984
x
2
−
0.3984
x
−
0.1992
{\displaystyle \displaystyle y_{3}(x)=2e^{x}-0.8008e^{2x}-9.9206*10^{-5}x^{7}-0.0010x^{6}-0.0031x^{5}-0.0078x^{4}-0.0990x^{3}-0.3984x^{2}-0.3984x-0.1992\ }
y
5
(
x
)
=
2.0001
e
x
−
0.8001
e
2
x
−
1.2526
∗
10
−
8
x
11
−
2.0668
∗
10
−
7
x
10
−
1.0334
∗
10
−
6
x
9
−
4.6503
∗
10
−
6
x
8
{\displaystyle \displaystyle y_{5}(x)=2.0001e^{x}-0.8001e^{2x}-1.2526*10^{-8}x^{11}-2.0668*10^{-7}x^{10}-1.0334*10^{-6}x^{9}-4.6503*10^{-6}x^{8}\ }
−
1.1781
∗
10
−
4
x
7
−
0.0011
x
6
−
0.0033
x
5
−
0.0083
x
4
−
0.0999
x
3
−
0.3999
x
2
−
0.399
x
−
0.2000
{\displaystyle \displaystyle -1.1781*10^{-4}x^{7}-0.0011x^{6}-0.0033x^{5}-0.0083x^{4}-0.0999x^{3}-0.3999x^{2}-0.399x-0.2000\ }
y
9
(
x
)
=
2
e
x
−
0.8
e
2
x
−
4.1103
∗
10
−
18
x
19
−
1.1714
∗
10
−
16
x
18
−
1.0543
∗
10
−
15
x
17
−
8.9615
∗
10
−
15
x
16
{\displaystyle \displaystyle y_{9}(x)=2e^{x}-0.8e^{2x}-4.1103*10^{-18}x^{19}-1.1714*10^{-16}x^{18}-1.0543*10^{-15}x^{17}-8.9615*10^{-15}x^{16}\ }
−
4.5405
∗
10
−
13
x
15
−
9.1408
∗
10
−
12
x
14
−
6.3985
∗
10
−
11
x
13
−
4.1590
∗
10
−
10
x
12
−
1.5021
∗
10
−
8
x
11
{\displaystyle \displaystyle -4.5405*10^{-13}x^{15}-9.1408*10^{-12}x^{14}-6.3985*10^{-11}x^{13}-4.1590*10^{-10}x^{12}-1.5021*10^{-8}x^{11}\ }
−
2.2040
∗
10
−
7
x
10
−
1.1020
∗
10
−
6
x
9
−
4.9591
∗
10
−
6
x
8
−
1.1904
∗
10
−
4
x
7
−
0.0011
x
6
{\displaystyle \displaystyle -2.2040*10^{-7}x^{10}-1.1020*10^{-6}x^{9}-4.9591*10^{-6}x^{8}-1.1904*10^{-4}x^{7}-0.0011x^{6}\ }
−
0.0033
x
5
−
0.0083
x
4
−
0.1000
x
3
−
0.4000
x
2
−
0.4000
x
−
0.2000
{\displaystyle \displaystyle -0.0033x^{5}-0.0083x^{4}-0.1000x^{3}-0.4000x^{2}-0.4000x-0.2000\ }
Plot for
y
3
(
x
)
{\displaystyle \displaystyle y_{3}(x)\ }
Plot for
y
5
(
x
)
{\displaystyle \displaystyle y_{5}(x)\ }
Plot for
y
9
(
x
)
{\displaystyle \displaystyle y_{9}(x)\ }
Matlab code:
x = 0:0.01:10;
y = log(1+x);
EDU>> x1 = 0:0.01:10;
EDU>> y1 = zeros(1,1001);
EDU>> for i = 1:4
for j = 1:1001
y1(j) = y1(j) - ((-x1(j))^i)/i;
end
end
EDU>> y2 = zeros(1,1001);
EDU>> for i = 1:7
for j = 1:1001
y2(j) = y2(j) - ((-x1(j))^i)/i;
end
end
EDU>> y3 = zeros(1,1001);
EDU>> for i = 1:11
for j = 1:1001
y3(j) = y3(j) - ((-x1(j))^i)/i;
end
end
EDU>> y4 = zeros(1,1001);
EDU>> for i = 1:16
for j = 1:1001
y4(j) = y4(j) - ((-x1(j))^i)/i;
end
end
EDU>> h = plot(x,y);
orange = [1 0.5 0.2];
EDU>> set(h,'Color',orange);
EDU>> hold on;
EDU>> plot(x1,y1,'r');
EDU>> plot(x1,y2,'g');
EDU>> plot(x1,y3,'b');
EDU>> plot(x1,y4,'c');
legend('log(1+x)','T_4','T_7','T_1_1','T_1_6');
EDU>> grid on;
EDU>> axis([0 10 -10 10])
Zoom plot about 0:
This plot makes it appear that only the 16 term approximation is in the window at point 0. This is, therefore, the most accurate of the other n solution approximations.
Zoom plot about 0.5:
This plot makes it appear that most of the approximations are very accurate and close to the exact solution. The only approximation that appears to deviate a little after 0.5 is the n = 4 approximation.
Matlab code:
syms x
EDU>> f = log(x+1);
EDU>> fT1 = taylor(f,5,1);
EDU>> fT2 = taylor(f,8,1);
X = 0.9:0.1:10;
Y(:,1) = subs(fT1,'x',X);
EDU>> Y(:,2) = subs(fT2,'x',X);
EDU>> Y(:,3) = log(1+X);
EDU>> figure
EDU>> plot(X,Y);
axis([0.9 10 -10 10])
Zoom in about 1:
This shows that neither of the approximations are very close about x = 1 to the exact solution.
Zoom in about 1.5:
This shows that the n = 7 approximation is close about x = 1.5 to the exact solution.
Zoom in about 2:
This shows that all the approximations are very close to the exact solution about x = 2.
Zoom in about 2.5:
This shows that the approximations are very close about x = 2.5, however, the n = 4 approximation is beginning to deviate and soon will not be a good approximation.
This problem was solved and uploaded by David Herrick
(1) Find the separated ODEs for the heat equation
∂
u
∂
t
=
κ
∂
2
u
∂
x
2
{\displaystyle \displaystyle {\frac {\partial u}{\partial t}}=\kappa {\frac {\partial ^{2}u}{\partial x^{2}}}}
Assuming
u
(
x
,
t
)
=
F
(
x
)
⋅
G
(
t
)
{\displaystyle \displaystyle u(x,t)=F(x)\cdot G(t)}
Then:
∂
u
(
x
,
t
)
∂
t
=
F
(
x
)
⋅
G
˙
(
t
)
{\displaystyle \displaystyle {\frac {\partial u(x,t)}{\partial t}}=F(x)\cdot {\dot {G}}(t)}
∂
2
u
(
x
,
t
)
∂
x
2
=
F
″
(
x
)
⋅
G
(
t
)
{\displaystyle \displaystyle {\frac {\partial ^{2}u(x,t)}{\partial x^{2}}}=F''(x)\cdot {G}(t)}
Substituting partial derivatives back into original PDE:
F
(
x
)
⋅
G
˙
(
t
)
=
κ
F
″
(
x
)
⋅
G
(
t
)
{\displaystyle \displaystyle F(x)\cdot {\dot {G}}(t)=\kappa F''(x)\cdot G(t)}
G
˙
(
t
)
κ
G
(
t
)
=
F
″
(
x
)
F
(
x
)
=
c
{\displaystyle \displaystyle {\frac {{\dot {G}}(t)}{\kappa G(t)}}={\frac {F''(x)}{F(x)}}=c}
* Where "c" is a constant, because if both sides were variables then they would never be equal one another (each side would be a function of a different variable.) Kreysig 2011, pp.546
Multiplying by the denominators to get two separate ODEs:
F
″
(
x
)
−
c
F
(
x
)
=
0
{\displaystyle \displaystyle F''(x)-cF(x)=0}
G
˙
(
t
)
−
κ
c
G
(
t
)
=
0
{\displaystyle \displaystyle {\dot {G}}(t)-\kappa cG(t)=0}
Solved and uploaded by Joshua House
Contribution Summary
edit