For the series shown in the notes on p. 7-20
∑
j
=
0
n
−
2
[
c
j
+
2
(
j
+
2
)
(
j
+
1
)
+
a
c
j
+
1
(
j
+
1
)
+
b
c
j
]
x
j
+
a
c
n
n
x
n
−
1
+
b
[
c
n
−
1
x
n
−
1
+
c
n
x
n
]
=
∑
j
=
0
n
d
j
x
j
{\displaystyle \ \sum _{j=0}^{n-2}[c_{j+2}(j+2)(j+1)+ac_{j+1}(j+1)+bc_{j}]x^{j}+ac_{n}nx^{n-1}+b[c_{n-1}x^{n-1}+c_{n}x^{n}]=\sum _{j=0}^{n}d_{j}x^{j}\ }
Obtain the equations for the coefficients of
x
{\displaystyle \ x}
,
x
2
{\displaystyle \ x^{2}}
,
x
n
−
2
{\displaystyle \ x^{n-2}\ }
,
x
n
−
1
{\displaystyle \ x^{n-1}\ }
,
x
n
{\displaystyle \ x^{n}}
Then, set up the coefficient matrix A for the general case with the coefficients obtained.
For j=0:
2
c
2
+
a
c
1
+
b
c
0
=
d
0
{\displaystyle \displaystyle 2c_{2}+ac_{1}+bc_{0}=d_{0}}
(1)
For j=1:
6
c
3
+
2
a
c
2
+
b
c
1
=
d
1
{\displaystyle \displaystyle 6c_{3}+2ac_{2}+bc_{1}=d_{1}}
(2)
For j=2:
12
c
4
+
3
a
c
3
+
b
c
2
=
d
2
{\displaystyle \displaystyle 12c_{4}+3ac_{3}+bc_{2}=d_{2}}
(3)
For j=n-2:
[
c
n
(
n
)
(
n
−
1
)
+
a
c
n
−
1
(
n
−
1
)
+
b
c
n
−
2
]
=
d
n
−
2
{\displaystyle \displaystyle [c_{n}(n)(n-1)+ac_{n-1}(n-1)+bc_{n-2}]=d_{n-2}}
(4)
For j=n-1:
a
c
n
n
+
b
c
n
−
1
=
d
n
−
1
{\displaystyle \displaystyle ac_{n}n+bc_{n-1}=d_{n-1}}
(5)
For j=n:
b
c
n
=
d
n
{\displaystyle \displaystyle bc_{n}=d_{n}}
(6)
Setting up the A matrix using equations (1)-(6):
A
=
[
b
a
2
b
2
a
b
b
a
(
n
−
1
)
n
(
n
−
1
)
b
a
n
b
]
{\displaystyle \displaystyle A={\begin{bmatrix}b&a&2&&&\\&b&2a&&&\\&&b&&&\\&&&b&a(n-1)&n(n-1)\\&&&&b&an\\&&&&&b\end{bmatrix}}}
Solved and uploaded by Joshua House
Proofread by David Herrick
Consider the L2-ODE-CC(5) p.7b-7 with sin x as excitation:
y
″
−
3
y
′
+
2
y
=
r
(
x
)
{\displaystyle \displaystyle \ y''-3y'+2y=r(x)\ }
r
(
x
)
=
sin
x
{\displaystyle \displaystyle \ r(x)=\sin x\ }
and with the initial conditions
y
(
0
)
=
1
,
y
′
(
0
)
=
0
{\displaystyle \displaystyle \ y(0)=1,y'(0)=0\ }
Use the Taylor series for
sin
x
{\displaystyle \displaystyle \ \sin x\ }
in (1)p6-4 to reproduce the figure on p7-24
Let
y
p
(
x
)
{\displaystyle \displaystyle \ y_{p}(x)\ }
be the particular soln corresponding to the excitating
r
n
(
x
)
{\displaystyle \displaystyle \ r_{n}(x)\ }
:
y
p
″
+
a
y
p
′
+
b
y
p
=
r
n
(
x
)
{\displaystyle \displaystyle \ y''_{p}+ay'_{p}+by_{p}=r_{n}(x)\ }
Let
r
n
(
x
)
{\displaystyle \displaystyle \ r_{n}(x)\ }
be the truncated Taylor series of sin x :
∑
n
=
0
∞
(
−
1
)
k
(
t
)
2
k
+
1
(
2
k
+
1
)
!
=
t
−
t
3
3
!
+
.
.
.
+
(
−
1
)
n
(
t
)
2
n
+
1
(
2
n
+
1
)
!
=:
r
n
(
x
)
{\displaystyle \sum _{n=0}^{\infty }{\frac {(-1)^{k}(t)^{2k+1}}{(2k+1)!}}=t-{\frac {t^{3}}{3!}}+...+{\frac {(-1)^{n}(t)^{2n+1}}{(2n+1)!}}=:r_{n}(x)\ }
Let
y
n
(
x
)
{\displaystyle \ y_{n}(x)\ }
be the overall soln for the L2-ODE-CC corresponding to (2)-(3) p.7-26 :
y
n
″
+
a
y
n
′
+
b
y
n
=
r
n
(
x
)
{\displaystyle \displaystyle \ y''_{n}+ay'_{n}+by_{n}=r_{n}(x)\ }
with the same initial conditions (3b)p.3-7.
Find the
y
n
(
x
)
{\displaystyle \ y_{n}(x)\ }
for n = 3, 5, 9; plot these solns for x in the interval [0,4π].
Use the particular soln in K 2011 p.82 Table 2.1 to find the exact overall soln y(x) and plot it in the above figure to compare with
y
n
(
x
)
{\displaystyle \ y_{n}(x)\ }
for n = 3, 5, 9.
To solve the non-homogeneous ODE we have to solve the homogeneous ODE and find any solution of
y
p
(
x
)
{\displaystyle \ y_{p}(x)\ }
. Using the method of undetermined coefficients, specifically the basic rule, where r(x) is in one of the functions in the first column in Table 2.1 K 2011 p. 82 and choose the
y
p
(
x
)
{\displaystyle \ y_{p}(x)\ }
in the same line and determine its undetermined coefficients by substituting
y
p
{\displaystyle \ y_{p}\ }
and its derivatives.
For an excitation
r
n
(
x
)
{\displaystyle \ r_{n}(x)\ }
n = 3
r
3
(
x
)
=
t
−
(
t
3
)
/
3
!
{\displaystyle \displaystyle \ r_{3}(x)=t-(t^{3})/3!\ }
n = 5
r
5
(
x
)
=
t
−
(
t
3
)
/
3
!
+
(
t
5
)
/
5
!
{\displaystyle \displaystyle \ r_{5}(x)=t-(t^{3})/3!+(t^{5})/5!\ }
n = 9
r
9
(
x
)
=
t
−
(
t
3
)
/
3
!
+
(
t
5
)
/
5
!
−
(
t
7
)
/
7
!
+
(
t
9
)
/
9
!
{\displaystyle \displaystyle \ r_{9}(x)=t-(t^{3})/3!+(t^{5})/5!-(t^{7})/7!+(t^{9})/9!\ }
The term in
r
(
x
)
{\displaystyle \ r(x)\ }
that will be used will be
k
x
n
(
n
=
3
,
5
,
9
)
{\displaystyle \ kx^{n}(n=3,5,9)\ }
For n = 3
K
3
x
3
+
K
2
x
2
+
K
1
x
+
K
0
{\displaystyle \ K_{3}x^{3}+K_{2}x^{2}+K_{1}x+K_{0}\ }
For n = 5
K
5
x
5
+
K
4
x
4
+
K
3
x
3
+
K
2
x
2
+
K
1
x
+
K
0
{\displaystyle \ K_{5}x^{5}+K_{4}x^{4}+K_{3}x^{3}+K_{2}x^{2}+K_{1}x+K_{0}\ }
For n = 9
K
9
x
9
+
K
8
x
8
+
K
7
x
7
+
K
6
x
6
+
K
5
x
5
+
K
4
x
4
+
K
3
x
3
+
K
2
x
2
+
K
1
x
+
K
0
{\displaystyle \ K_{9}x^{9}+K_{8}x^{8}+K_{7}x^{7}+K_{6}x^{6}+K_{5}x^{5}+K_{4}x^{4}+K_{3}x^{3}+K_{2}x^{2}+K_{1}x+K_{0}\ }
The homogeneous solution for y will be in the form of
y
h
(
x
)
=
C
1
e
2
x
+
C
2
e
x
{\displaystyle \displaystyle \ y_{h}(x)=C_{1}e^{2x}+C_{2}e^{x}\ }
Plugging
y
p
″
,
y
p
′
,
y
p
{\displaystyle \ y_{p}'',y_{p}',y_{p}\ }
into the original equation will give the following:
For n = 3
(
6
K
3
x
+
2
K
2
)
−
3
(
3
K
3
x
2
+
2
K
2
x
+
K
1
)
+
2
(
K
3
x
3
+
K
2
x
2
+
K
1
x
+
K
0
)
=
x
−
(
x
3
)
/
6
!
{\displaystyle \ (6K_{3}x+2K_{2})-3(3K_{3}x^{2}+2K_{2}x+K_{1})+2(K_{3}x^{3}+K_{2}x^{2}+K_{1}x+K_{0})=x-(x^{3})/6!\ }
For n = 5
(
20
K
5
x
3
+
12
K
4
x
2
+
6
K
3
x
+
4
K
2
x
)
−
3
(
5
K
5
x
4
+
4
K
4
x
3
+
3
K
3
x
2
+
2
K
2
x
+
K
1
)
+
2
(
K
5
x
5
+
K
4
x
4
+
K
3
x
3
+
K
2
x
2
+
K
1
x
+
K
0
)
{\displaystyle \ (20K_{5}x^{3}+12K_{4}x^{2}+6K_{3}x+4K_{2}x)-3(5K_{5}x^{4}+4K_{4}x^{3}+3K_{3}x^{2}+2K_{2}x+K_{1})+2(K_{5}x^{5}+K_{4}x^{4}+K_{3}x^{3}+K_{2}x^{2}+K_{1}x+K_{0})\ }
=
x
−
(
x
3
)
/
3
!
+
(
x
5
)
/
5
!
{\displaystyle \ =x-(x^{3})/3!+(x^{5})/5!\ }
For n = 9
(
72
K
9
x
7
+
56
K
8
x
6
+
42
K
7
x
5
+
30
K
6
x
4
+
20
K
5
x
3
+
12
K
4
x
2
+
6
K
3
x
+
4
K
2
x
)
−
3
(
9
K
9
x
8
+
8
K
8
x
7
+
7
K
7
x
6
+
6
K
6
x
5
+
5
K
5
x
4
+
4
K
4
x
3
{\displaystyle \ (72K_{9}x^{7}+56K_{8}x^{6}+42K_{7}x^{5}+30K_{6}x^{4}+20K_{5}x^{3}+12K_{4}x^{2}+6K_{3}x+4K_{2}x)-3(9K_{9}x^{8}+8K_{8}x^{7}+7K_{7}x^{6}+6K_{6}x^{5}+5K_{5}x^{4}+4K_{4}x^{3}\ }
+
3
K
3
x
2
+
2
K
2
x
+
K
1
+
2
(
K
9
x
9
+
K
8
x
8
+
K
7
x
7
+
K
6
x
6
+
K
5
x
5
+
K
4
x
4
+
K
3
x
3
+
K
2
x
2
+
K
1
x
+
K
0
)
=
x
−
(
x
3
)
/
3
!
+
(
x
5
)
/
5
!
−
(
x
7
)
/
7
!
+
(
x
9
)
/
9
!
{\displaystyle \ +3K_{3}x^{2}+2K_{2}x+K_{1}+2(K_{9}x^{9}+K_{8}x^{8}+K_{7}x^{7}+K_{6}x^{6}+K_{5}x^{5}+K_{4}x^{4}+K_{3}x^{3}+K_{2}x^{2}+K_{1}x+K_{0})=x-(x^{3})/3!+(x^{5})/5!-(x^{7})/7!+(x^{9})/9!\ }
Equating the coefficients of
x
n
{\displaystyle \ x^{n}\ }
on both sides
For n = 3
x
3
:
2
K
3
=
−
1
/
6
{\displaystyle \ x^{3}:2K_{3}=-1/6\ }
K
3
=
−
1
/
12
{\displaystyle \ K_{3}=-1/12\ }
x
2
:
−
9
K
3
+
2
K
2
=
0
{\displaystyle \ x^{2}:-9K_{3}+2K_{2}=0\ }
K
2
=
−
3
/
8
{\displaystyle \ K_{2}=-3/8\ }
x
:
6
K
3
−
6
K
2
+
2
K
1
=
1
{\displaystyle \ x:6K_{3}-6K_{2}+2K_{1}=1\ }
K
1
=
−
3
/
8
{\displaystyle \ K_{1}=-3/8\ }
c
:
2
K
2
−
3
K
1
+
2
K
0
=
0
{\displaystyle \ c:2K_{2}-3K_{1}+2K_{0}=0\ }
K
0
=
−
3
/
16
{\displaystyle \ K_{0}=-3/16\ }
Now plugging in the particular and homogeneous equation
y
=
y
h
+
y
p
{\displaystyle \ y=y_{h}+y_{p}\ }
and solving for the initial conditions.
y
=
C
1
e
2
x
+
C
2
e
x
−
(
1
/
12
)
x
3
−
(
3
/
8
)
x
2
−
(
3
/
8
)
x
−
3
/
16
{\displaystyle \ y=C_{1}e^{2x}+C_{2}e^{x}-(1/12)x^{3}-(3/8)x^{2}-(3/8)x-3/16\ }
y
(
0
)
=
C
1
+
C
2
−
3
/
16
=
1
{\displaystyle \ y(0)=C_{1}+C_{2}-3/16=1\ }
y
′
(
0
)
=
2
C
1
+
C
2
−
3
/
8
=
0
{\displaystyle \ y'(0)=2C_{1}+C_{2}-3/8=0\ }
This gives constant values of
C
1
=
−
13
/
16
{\displaystyle \ C_{1}=-13/16\ }
C
2
=
2
{\displaystyle \ C_{2}=2\ }
For n = 3 Final solution is:
y
3
=
(
−
13
/
16
)
e
2
x
+
2
e
x
−
(
1
/
12
)
x
3
−
(
3
/
8
)
x
2
−
(
3
/
8
)
x
−
3
/
16
{\displaystyle \ y_{3}=(-13/16)e^{2x}+2e^{x}-(1/12)x^{3}-(3/8)x^{2}-(3/8)x-3/16\ }
For n = 5
Equating the coefficients
x
5
:
2
K
5
=
1
/
120
{\displaystyle \ x^{5}:2K_{5}=1/120\ }
K
5
=
1
/
240
{\displaystyle \ K_{5}=1/240\ }
x
4
:
−
15
K
5
+
2
K
4
=
0
{\displaystyle \ x^{4}:-15K_{5}+2K_{4}=0\ }
K
4
=
1
/
32
{\displaystyle \ K_{4}=1/32\ }
x
3
:
20
K
5
−
12
K
4
+
2
K
3
=
−
1
/
6
{\displaystyle \ x^{3}:20K_{5}-12K_{4}+2K_{3}=-1/6\ }
K
3
=
−
11
/
24
{\displaystyle \ K_{3}=-11/24\ }
x
2
:
12
K
4
−
9
K
3
+
2
K
2
=
0
{\displaystyle \ x^{2}:12K_{4}-9K_{3}+2K_{2}=0\ }
K
2
=
−
9
/
4
{\displaystyle \ K_{2}=-9/4\ }
x
:
6
K
3
−
6
K
2
+
2
K
1
=
1
{\displaystyle \ x:6K_{3}-6K_{2}+2K_{1}=1\ }
K
1
=
−
39
/
8
{\displaystyle \ K_{1}=-39/8\ }
c
:
4
k
2
−
3
K
1
+
2
K
0
=
0
{\displaystyle \ c:4k_{2}-3K_{1}+2K_{0}=0\ }
K
0
=
−
45
/
16
{\displaystyle \ K_{0}=-45/16\ }
Now plugging in the particular and homogeneous equation
y
=
y
h
+
y
p
{\displaystyle \ y=y_{h}+y_{p}\ }
and solving for the initial conditions.
y
=
C
1
e
2
x
+
C
2
e
x
+
(
1
/
240
)
x
5
+
(
1
/
32
)
x
4
−
(
11
/
24
)
x
3
−
(
9
/
4
)
x
2
−
(
39
/
8
)
x
−
45
/
16
{\displaystyle \ y=C_{1}e^{2x}+C_{2}e^{x}+(1/240)x^{5}+(1/32)x^{4}-(11/24)x^{3}-(9/4)x^{2}-(39/8)x-45/16\ }
y
(
0
)
=
C
1
+
C
2
−
45
/
16
=
1
{\displaystyle \ y(0)=C_{1}+C_{2}-45/16=1\ }
y
′
(
0
)
=
2
C
1
+
C
2
−
39
/
8
=
0
{\displaystyle \ y'(0)=2C_{1}+C_{2}-39/8=0\ }
This gives constant values of
C
1
=
79
/
48
{\displaystyle \ C_{1}=79/48\ }
C
2
=
13
/
6
{\displaystyle \ C_{2}=13/6\ }
For n = 5 the final solution is
y
5
=
(
79
/
48
)
e
2
x
+
(
13
/
6
)
e
x
+
(
1
/
240
)
x
5
+
(
1
/
32
)
x
4
−
(
11
/
24
)
x
3
−
(
9
/
4
)
x
2
−
(
39
/
8
)
x
−
45
/
16
{\displaystyle \ y_{5}=(79/48)e^{2x}+(13/6)e^{x}+(1/240)x^{5}+(1/32)x^{4}-(11/24)x^{3}-(9/4)x^{2}-(39/8)x-45/16\ }
For n = 9
Equating the coefficients
x
9
:
2
K
9
=
1
/
9
!
{\displaystyle \ x^{9}:2K_{9}=1/9!\ }
K
9
=
1.3778
e
−
6
{\displaystyle \ K_{9}=1.3778e^{-6}\ }
x
8
:
−
27
K
9
+
2
K
8
=
0
{\displaystyle \ x^{8}:-27K_{9}+2K_{8}=0\ }
k
8
=
1.86
e
−
5
{\displaystyle \ k_{8}=1.86e^{-5}\ }
x
7
:
72
K
9
−
24
K
8
+
2
K
7
=
−
1
/
7
!
{\displaystyle \ x^{7}:72K_{9}-24K_{8}+2K_{7}=-1/7!\ }
K
7
=
2.728
e
−
4
{\displaystyle \ K_{7}=2.728e^{-4}\ }
x
6
:
56
K
8
−
21
K
7
+
2
K
6
=
0
{\displaystyle \ x^{6}:56K_{8}-21K_{7}+2K_{6}=0\ }
K
6
=
0.0023
{\displaystyle \ K_{6}=0.0023\ }
x
5
:
42
K
7
−
18
K
6
+
2
K
5
=
1
/
5
!
{\displaystyle \ x^{5}:42K_{7}-18K_{6}+2K_{5}=1/5!\ }
K
5
=
0.0111
{\displaystyle \ K_{5}=0.0111\ }
x
4
:
30
K
6
−
15
K
5
+
2
K
4
=
0
{\displaystyle \ x^{4}:30K_{6}-15K_{5}+2K_{4}=0\ }
K
4
=
0.0488
{\displaystyle \ K_{4}=0.0488\ }
x
3
:
20
K
5
−
12
K
4
+
2
K
3
=
−
1
/
3
!
{\displaystyle \ x^{3}:20K_{5}-12K_{4}+2K_{3}=-1/3!\ }
K
3
=
0.0976
)
{\displaystyle \ K_{3}=0.0976)\ }
x
2
:
12
K
4
−
9
K
3
+
2
K
2
=
0
{\displaystyle \ x^{2}:12K_{4}-9K_{3}+2K_{2}=0\ }
K
2
=
0.1463
{\displaystyle \ K_{2}=0.1463\ }
x
:
6
K
3
−
6
K
2
+
2
K
1
=
1
{\displaystyle \ x:6K_{3}-6K_{2}+2K_{1}=1\ }
K
1
=
0.6461
{\displaystyle \ K_{1}=0.6461\ }
c
:
4
K
2
−
3
K
1
+
2
K
0
=
0
{\displaystyle \ c:4K_{2}-3K_{1}+2K_{0}=0\ }
K
0
=
0.6765
{\displaystyle \ K_{0}=0.6765\ }
Now plugging in the particular and homogeneous equation
y
=
y
h
+
y
p
{\displaystyle \ y=y_{h}+y_{p}\ }
and solving for the initial conditions.
y
=
C
1
e
2
x
+
C
2
e
x
+
y
p
{\displaystyle \ y=C_{1}e^{2x}+C_{2}e^{x}+y_{p}\ }
y
(
0
)
=
C
1
+
C
2
+
0.6765
=
1
{\displaystyle \ y(0)=C_{1}+C_{2}+0.6765=1\ }
y
′
(
0
)
=
2
C
1
+
C
2
+
0.6461
=
0
{\displaystyle \ y'(0)=2C_{1}+C_{2}+0.6461=0\ }
This gives constant values of
C
1
=
−
0.3226
{\displaystyle \ C_{1}=-0.3226\ }
C
2
=
0.6449
{\displaystyle \ C_{2}=0.6449\ }
For n = 9 the final solution is
y
9
=
−
0.3226
e
2
x
+
0.6449
e
x
+
1.37
e
−
6
x
9
+
1.86
e
−
5
x
8
+
2.72
e
−
4
x
7
+
0.0023
x
6
+
0.0111
x
5
+
0.0488
x
4
−
0.0976
x
3
{\displaystyle \ y_{9}=-0.3226e^{2x}+0.6449e^{x}+1.37e^{-6}x^{9}+1.86e^{-5}x^{8}+2.72e^{-4}x^{7}+0.0023x^{6}+0.0111x^{5}+0.0488x^{4}-0.0976x^{3}\ }
−
0.1463
x
2
−
0.6461
x
−
0.6765
{\displaystyle \ -0.1463x^{2}-0.6461x-0.6765\ }
The table 2.1 from K 2011 p.82 illustrates that for the method of undetermined coefficients for an r(x) term in the form of:
r(x) = k sin(ωx)
Then the choice for
y
p
(
x
)
{\displaystyle \ y_{p}(x)\ }
would be:
K cos(ωx) + M sin(ωx)
The homogeneous solution for y will be in the form of
y
h
(
x
)
=
y
(
x
)
=
C
1
e
2
x
+
C
2
e
x
{\displaystyle \displaystyle \ y_{h}(x)=y(x)=C_{1}e^{2x}+C_{2}e^{x}\ }
with roots of 2 and 1 derived from
y
″
−
3
y
′
+
2
y
=
0
{\displaystyle \displaystyle \ y''-3y'+2y=0\ }
Plugging in the derivatives for the particular solution into the original equation gives:
y
p
″
−
3
y
p
′
+
2
y
p
=
s
i
n
(
x
)
{\displaystyle \displaystyle \ y_{p}''-3y_{p}'+2y_{p}=sin(x)\ }
where
y
p
=
A
c
o
s
(
x
)
+
B
s
i
n
(
x
)
{\displaystyle \ y_{p}=Acos(x)+Bsin(x)\ }
y
p
′
=
−
A
s
i
n
(
x
)
+
B
c
o
s
(
x
)
{\displaystyle \ y_{p}'=-Asin(x)+Bcos(x)\ }
y
p
″
=
−
A
c
o
s
(
x
)
−
B
s
i
n
(
x
)
{\displaystyle \ y_{p}''=-Acos(x)-Bsin(x)\ }
−
A
c
o
s
(
x
)
−
B
s
i
n
(
x
)
−
3
(
−
A
s
i
n
(
x
)
+
B
c
o
s
(
x
)
)
+
2
(
A
c
o
s
(
x
)
+
B
s
i
n
(
x
)
)
=
s
i
n
(
x
)
{\displaystyle \displaystyle \ -Acos(x)-Bsin(x)-3(-Asin(x)+Bcos(x))+2(Acos(x)+Bsin(x))=sin(x)\ }
(
A
−
3
B
)
c
o
s
(
x
)
+
(
3
A
+
B
)
s
i
n
(
x
)
=
s
i
n
(
x
)
{\displaystyle \displaystyle \ (A-3B)cos(x)+(3A+B)sin(x)=sin(x)\ }
3
A
+
B
=
1
;
A
−
3
B
=
0
;
{\displaystyle \ 3A+B=1;A-3B=0;\ }
A
=
3
/
10
;
B
=
1
/
10
{\displaystyle \ A=3/10;B=1/10\ }
Combining the particular and homogeneous solution of y gives the following:
y
=
y
h
+
y
p
=
C
1
e
2
x
+
C
2
e
x
+
(
3
/
10
)
c
o
s
(
x
)
+
(
1
/
10
)
s
i
n
(
x
)
{\displaystyle \displaystyle \ y=y_{h}+y_{p}=C_{1}e^{2x}+C_{2}e^{x}+(3/10)cos(x)+(1/10)sin(x)\ }
Solving for the initial conditions where
y
(
0
)
=
1
,
a
n
d
y
′
(
0
)
=
0
{\displaystyle \ y(0)=1,andy'(0)=0\ }
y
(
0
)
=
C
1
+
C
2
=
7
/
10
{\displaystyle \ y(0)=C_{1}+C_{2}=7/10\ }
y
′
(
0
)
=
2
C
1
+
C
2
+
1
/
10
{\displaystyle \ y'(0)=2C_{1}+C_{2}+1/10\ }
2
C
1
+
7
/
10
−
C
1
=
−
1
/
10
{\displaystyle \ 2C_{1}+7/10-C_{1}=-1/10\ }
C
1
=
−
8
/
10
;
C
2
=
−
1
/
10
{\displaystyle \ C_{1}=-8/10;C_{2}=-1/10\ }
This gives the final solution:
y
=
(
−
8
/
10
)
e
2
x
−
(
1
/
10
)
e
x
+
(
3
/
10
)
c
o
s
(
x
)
+
(
1
/
10
)
s
i
n
(
x
)
{\displaystyle \displaystyle \ y=(-8/10)e^{2x}-(1/10)e^{x}+(3/10)cos(x)+(1/10)sin(x)\ }
From the figure it is barely discernible between this figure and the figure above it in part two. The final solution for y in part three is very similar if not approximately identical to the lower curve in the figure in part two.
This problem was solved and uploaded by Michael Wallace
Consider the L2-ODE-CC:
y
″
−
3
y
′
+
2
y
=
r
(
x
)
{\displaystyle \displaystyle \ y''-3y'+2y=r(x)\ }
Where
r
(
x
)
=
log
(
1
+
x
)
{\displaystyle \displaystyle \ r(x)=\log(1+x)\ }
with initial conditions
y
(
−
3
4
)
=
1
,
y
′
(
−
3
4
)
=
0
{\displaystyle \displaystyle \ y(-{\frac {3}{4}})=1,y'(-{\frac {3}{4}})=0\ }
Develop
log
(
1
+
x
)
{\displaystyle \displaystyle \ \log(1+x)\ }
in Taylor series about x(hat) = 0 to reproduce the figure in the notes on p. 7-25.
Let
r
n
(
x
)
{\displaystyle \displaystyle \ r_{n}(x)\ }
be the truncated Taylor series with n terms -- which is also the highest degree of the Taylor (power) series -- of
log
(
1
+
x
)
{\displaystyle \displaystyle \ \log(1+x)\ }
.
Find
y
n
(
x
)
{\displaystyle \displaystyle \ y_{n}(x)\ }
for n = 4, 7, and 11 such that:
y
n
″
+
a
y
n
′
+
b
y
n
=
r
n
(
x
)
{\displaystyle \displaystyle \ y_{n}''+ay_{n}'+by_{n}=r_{n}(x)\ }
Plot
y
n
(
x
)
{\displaystyle \displaystyle \ y_{n}(x)\ }
for n = 4,7,11 for x in
[
−
3
4
,
3
]
{\displaystyle \displaystyle \ [-{\frac {3}{4}},3]\ }
Use the matlab command ODE45 to integrate numerically the same function with the same initial conditions to obtain
y
(
x
)
{\displaystyle \displaystyle \ y(x)\ }
. Then plot
y
(
x
)
{\displaystyle \displaystyle \ y(x)\ }
in the same figure with
y
n
(
x
)
{\displaystyle \displaystyle \ y_{n}(x)\ }
The formula to develop the Taylor Series about x(hat) = 0 is given by:
f
(
0
)
+
f
′
(
0
)
(
x
−
0
)
1
1
!
+
f
″
(
0
)
(
x
−
0
)
2
2
!
+
f
‴
(
0
)
(
x
−
0
)
3
3
!
+
.
.
.
∑
n
=
0
∞
f
n
(
0
)
(
x
−
0
)
n
n
!
{\displaystyle \displaystyle \ f(0)+{\frac {f'(0)(x-0)^{1}}{1!}}+{\frac {f''(0)(x-0)^{2}}{2!}}+{\frac {f'''(0)(x-0)^{3}}{3!}}+...\sum _{n=0}^{\infty }{\frac {f^{n}(0)(x-0)^{n}}{n!}}\ }
Using the function
log
(
1
+
x
)
{\displaystyle \displaystyle \ \log(1+x)\ }
we get:
f
′
(
x
)
=
1
(
x
+
1
)
,
f
″
(
x
)
=
−
1
(
x
+
1
)
2
,
f
‴
(
x
)
=
2
(
x
+
1
)
3
,
.
.
.
{\displaystyle \displaystyle \ f'(x)={\frac {1}{(x+1)}},f''(x)={\frac {-1}{(x+1)^{2}}},f'''(x)={\frac {2}{(x+1)^{3}}},...\ }
Plugging in 0, the first few terms become:
0
+
x
−
x
2
2
+
x
3
3
{\displaystyle \displaystyle \ 0+x-{\frac {x^{2}}{2}}+{\frac {x^{3}}{3}}\ }
The pattern of this expression can be represented by the Taylor series:
∑
n
=
0
∞
(
−
1
)
n
(
x
)
n
+
1
(
n
+
1
)
{\displaystyle \sum _{n=0}^{\infty }{\frac {(-1)^{n}(x)^{n+1}}{(n+1)}}}
First, the homogenous solution to the differential equation is given by:
(
λ
−
1
)
(
λ
−
2
)
=
0
{\displaystyle \displaystyle \ (\lambda -1)(\lambda -2)=0\ }
Therefore,
y
h
=
C
1
e
x
+
C
2
e
2
x
{\displaystyle \displaystyle \ y_{h}=C_{1}e^{x}+C_{2}e^{2x}\ }
for
r
n
(
x
)
{\displaystyle \displaystyle \ r_{n}(x)\ }
is given by the truncated Taylor series of 4 terms:
r
4
(
x
)
=
x
−
x
2
2
+
x
3
3
−
x
4
4
{\displaystyle \displaystyle \ r_{4}(x)=x-{\frac {x^{2}}{2}}+{\frac {x^{3}}{3}}-{\frac {x^{4}}{4}}\ }
Therefore,
y
p
4
=
c
0
+
c
1
x
+
c
2
x
2
+
c
3
x
3
+
c
4
x
4
{\displaystyle \displaystyle \ y_{p4}=c_{0}+c_{1}x+c_{2}x^{2}+c_{3}x^{3}+c_{4}x^{4}\ }
y
p
4
′
=
c
1
+
2
c
2
x
+
3
c
3
x
2
+
4
c
4
x
3
,
y
p
4
″
=
2
c
2
+
6
c
3
x
+
12
c
4
x
2
{\displaystyle \displaystyle \ y_{p4}'=c_{1}+2c_{2}x+3c_{3}x^{2}+4c_{4}x^{3},y_{p4}''=2c_{2}+6c_{3}x+12c_{4}x^{2}\ }
For this solution, with n = 4, the coefficient matrix is set up like:
A
=
[
b
a
(
n
−
3
)
(
n
−
3
)
(
n
−
2
)
b
a
(
n
−
2
)
(
n
−
1
)
(
n
−
2
)
b
a
(
n
−
1
)
n
(
n
−
1
)
b
a
n
b
]
{\displaystyle \displaystyle \ A={\begin{bmatrix}b&a(n-3)&(n-3)(n-2)&&\\&b&a(n-2)&(n-1)(n-2)&\\&&b&a(n-1)&n(n-1)\\&&&b&an\\&&&&b\end{bmatrix}}\ }
Therefore, the matrix solution with n = 4, a = -3, and b = 2 is:
A
=
[
2
−
3
2
2
−
6
6
2
−
9
12
2
−
12
2
]
[
c
0
c
1
c
2
c
3
c
4
]
=
[
0
1
−
1
2
1
3
−
1
4
]
{\displaystyle \displaystyle \ A={\begin{bmatrix}2&-3&2&&\\&2&-6&6&\\&&2&-9&12\\&&&2&-12\\&&&&2\end{bmatrix}}{\begin{bmatrix}c_{0}\\c_{1}\\c_{2}\\c_{3}\\c_{4}\end{bmatrix}}={\begin{bmatrix}0\\1\\-{\frac {1}{2}}\\{\frac {1}{3}}\\-{\frac {1}{4}}\end{bmatrix}}\ }
Solving by back substitution we get:
y
p
4
=
−
65
16
−
33
8
x
−
17
8
x
2
−
7
12
x
3
−
1
8
x
4
{\displaystyle \displaystyle \ y_{p4}=-{\frac {65}{16}}-{\frac {33}{8}}x-{\frac {17}{8}}x^{2}-{\frac {7}{12}}x^{3}-{\frac {1}{8}}x^{4}\ }
y
4
(
x
)
=
C
1
e
x
+
C
2
e
2
x
−
65
16
−
33
8
x
−
17
8
x
2
−
7
12
x
3
−
1
8
x
4
{\displaystyle \displaystyle \ y_{4}(x)=C_{1}e^{x}+C_{2}e^{2x}-{\frac {65}{16}}-{\frac {33}{8}}x-{\frac {17}{8}}x^{2}-{\frac {7}{12}}x^{3}-{\frac {1}{8}}x^{4}\ }
Plugging in the initial conditions we get:
y
4
(
x
)
=
8.90
e
x
−
5.587
e
2
x
−
65
16
−
33
8
x
−
17
8
x
2
−
7
12
x
3
−
1
8
x
4
{\displaystyle \displaystyle \ y_{4}(x)=8.90e^{x}-5.587e^{2x}-{\frac {65}{16}}-{\frac {33}{8}}x-{\frac {17}{8}}x^{2}-{\frac {7}{12}}x^{3}-{\frac {1}{8}}x^{4}\ }
for
r
n
(
x
)
{\displaystyle \displaystyle \ r_{n}(x)\ }
is given by the truncated Taylor series of 7 terms:
r
7
(
x
)
=
x
−
x
2
2
+
x
3
3
−
x
4
4
+
x
5
5
−
x
6
6
+
x
7
7
{\displaystyle \displaystyle \ r_{7}(x)=x-{\frac {x^{2}}{2}}+{\frac {x^{3}}{3}}-{\frac {x^{4}}{4}}+{\frac {x^{5}}{5}}-{\frac {x^{6}}{6}}+{\frac {x^{7}}{7}}\ }
Therefore:
y
p
7
=
c
0
+
c
1
x
+
c
2
x
2
+
c
3
x
3
+
c
4
x
4
+
c
5
x
5
+
c
6
x
6
+
c
7
x
7
{\displaystyle \displaystyle \ y_{p7}=c_{0}+c_{1}x+c_{2}x^{2}+c_{3}x^{3}+c_{4}x^{4}+c_{5}x^{5}+c_{6}x^{6}+c_{7}x^{7}\ }
y
p
7
′
=
c
1
+
2
c
2
x
+
3
c
3
x
2
+
4
c
4
x
3
+
5
c
5
x
4
+
6
c
6
x
5
+
7
c
7
x
6
{\displaystyle \displaystyle \ y_{p7}'=c_{1}+2c_{2}x+3c_{3}x^{2}+4c_{4}x^{3}+5c_{5}x^{4}+6c_{6}x^{5}+7c_{7}x^{6}\ }
y
p
7
″
=
2
c
2
+
6
c
3
x
+
12
c
4
x
2
+
20
c
5
x
3
+
30
c
6
x
4
+
42
c
7
x
5
{\displaystyle \displaystyle \ y_{p7}''=2c_{2}+6c_{3}x+12c_{4}x^{2}+20c_{5}x^{3}+30c_{6}x^{4}+42c_{7}x^{5}\ }
For this solution, with n = 7, the coefficient matrix is set up like:
A
=
[
b
a
(
n
−
6
)
(
n
−
6
)
(
n
−
5
)
b
a
(
n
−
5
)
(
n
−
5
)
(
n
−
4
)
b
a
(
n
−
4
)
(
n
−
4
)
(
n
−
3
)
b
a
(
n
−
3
)
(
n
−
3
)
(
n
−
2
)
b
a
(
n
−
2
)
(
n
−
2
)
(
n
−
1
)
b
a
(
n
−
1
)
(
n
−
1
)
(
n
)
b
a
n
b
]
{\displaystyle \displaystyle \ A={\begin{bmatrix}b&a(n-6)&(n-6)(n-5)&&&&&\\&b&a(n-5)&(n-5)(n-4)&&&&\\&&b&a(n-4)&(n-4)(n-3)&&&\\&&&b&a(n-3)&(n-3)(n-2)&&\\&&&&b&a(n-2)&(n-2)(n-1)&\\&&&&&b&a(n-1)&(n-1)(n)\\&&&&&&b&an\\&&&&&&&b\end{bmatrix}}\ }
Therefore, the matrix solution with n = 7, a = -3, and b = 2 is:
A
=
[
2
−
3
2
2
−
6
6
2
−
9
12
2
−
12
20
2
−
15
30
2
−
18
42
2
−
21
2
]
[
c
0
c
1
c
2
c
3
c
4
c
5
c
6
c
7
]
=
[
0
1
−
1
2
1
3
−
1
4
1
5
−
1
6
1
7
]
{\displaystyle \displaystyle \ A={\begin{bmatrix}2&-3&2&&&&&\\&2&-6&6&&&&\\&&2&-9&12&&&\\&&&2&-12&20&&\\&&&&2&-15&30&\\&&&&&2&-18&42\\&&&&&&2&-21\\&&&&&&&2\end{bmatrix}}{\begin{bmatrix}c_{0}\\c_{1}\\c_{2}\\c_{3}\\c_{4}\\c_{5}\\c_{6}\\c_{7}\end{bmatrix}}={\begin{bmatrix}0\\1\\-{\frac {1}{2}}\\{\frac {1}{3}}\\-{\frac {1}{4}}\\{\frac {1}{5}}\\-{\frac {1}{6}}\\{\frac {1}{7}}\end{bmatrix}}\ }
Solving by back substitution we get:
y
p
7
=
49317
80
+
24573
40
x
+
12201
40
x
2
+
1205
12
x
3
+
195
8
x
4
+
23
5
x
5
+
2
3
x
6
+
1
14
x
7
{\displaystyle \displaystyle \ y_{p7}={\frac {49317}{80}}+{\frac {24573}{40}}x+{\frac {12201}{40}}x^{2}+{\frac {1205}{12}}x^{3}+{\frac {195}{8}}x^{4}+{\frac {23}{5}}x^{5}+{\frac {2}{3}}x^{6}+{\frac {1}{14}}x^{7}\ }
Since the homogeneous solution remains the same:
y
7
(
x
)
=
C
1
e
x
+
C
2
e
2
x
+
49317
80
+
24573
40
x
+
12201
40
x
2
+
1205
12
x
3
+
195
8
x
4
+
23
5
x
5
+
2
3
x
6
+
1
14
x
7
{\displaystyle \displaystyle \ y_{7}(x)=C_{1}e^{x}+C_{2}e^{2x}+{\frac {49317}{80}}+{\frac {24573}{40}}x+{\frac {12201}{40}}x^{2}+{\frac {1205}{12}}x^{3}+{\frac {195}{8}}x^{4}+{\frac {23}{5}}x^{5}+{\frac {2}{3}}x^{6}+{\frac {1}{14}}x^{7}\ }
Plugging in the initial conditions we get:
y
7
(
x
)
=
−
613.504
e
x
−
3.868
e
2
x
+
49317
80
+
24573
40
x
+
12201
40
x
2
+
1205
12
x
3
+
195
8
x
4
+
23
5
x
5
+
2
3
x
6
+
1
14
x
7
{\displaystyle \displaystyle \ y_{7}(x)=-613.504e^{x}-3.868e^{2x}+{\frac {49317}{80}}+{\frac {24573}{40}}x+{\frac {12201}{40}}x^{2}+{\frac {1205}{12}}x^{3}+{\frac {195}{8}}x^{4}+{\frac {23}{5}}x^{5}+{\frac {2}{3}}x^{6}+{\frac {1}{14}}x^{7}\ }
The image below demonstrates the general matrix for n=11 and the matrix with values filled in:
for
r
n
(
x
)
{\displaystyle \displaystyle \ r_{n}(x)\ }
is given by the truncated Taylor series of 11 terms:
r
11
(
x
)
=
x
−
x
2
2
+
x
3
3
−
x
4
4
+
x
5
5
−
x
6
6
+
x
7
7
−
x
8
8
+
x
9
9
−
x
10
10
+
x
11
11
{\displaystyle \displaystyle \ r_{11}(x)=x-{\frac {x^{2}}{2}}+{\frac {x^{3}}{3}}-{\frac {x^{4}}{4}}+{\frac {x^{5}}{5}}-{\frac {x^{6}}{6}}+{\frac {x^{7}}{7}}-{\frac {x^{8}}{8}}+{\frac {x^{9}}{9}}-{\frac {x^{10}}{10}}+{\frac {x^{11}}{11}}\ }
Therefore,
y
p
11
=
c
0
+
c
1
x
+
c
2
x
2
+
c
3
x
3
+
c
4
x
4
+
c
5
x
5
+
c
6
x
6
+
c
7
x
7
+
c
8
x
8
+
c
9
x
9
+
c
10
x
10
+
c
11
x
11
{\displaystyle \displaystyle \ y_{p11}=c_{0}+c_{1}x+c_{2}x^{2}+c_{3}x^{3}+c_{4}x^{4}+c_{5}x^{5}+c_{6}x^{6}+c_{7}x^{7}+c_{8}x^{8}+c_{9}x^{9}+c_{10}x^{10}+c_{11}x^{11}}
Solving by back substitution we get:
y
p
11
=
3301079.406
+
3300338.812
x
+
1649428.813
x
2
+
549316.042
x
3
+
137082.188
x
4
+
27317.725
x
5
+
4520.042
x
6
{\displaystyle \ y_{p11}=3301079.406+3300338.812x+1649428.813x^{2}+549316.042x^{3}+137082.188x^{4}+27317.725x^{5}+4520.042x^{6}}
+
636.321
x
7
+
77.188
x
8
+
8.056
x
9
+
0.7
x
10
+
0.0455
x
11
{\displaystyle \ +636.321x^{7}+77.188x^{8}+8.056x^{9}+0.7x^{10}+0.0455x^{11}}
Since the homogeneous solution remains the same:
y
11
(
x
)
=
C
1
e
x
+
C
2
e
2
x
+
3301079.406
+
3300338.812
x
+
1649428.813
x
2
+
549316.042
x
3
+
137082.188
x
4
+
27317.725
x
5
+
4520.042
x
6
{\displaystyle \ y_{11}(x)=C_{1}e^{x}+C_{2}e^{2x}+3301079.406+3300338.812x+1649428.813x^{2}+549316.042x^{3}+137082.188x^{4}+27317.725x^{5}+4520.042x^{6}}
+
636.321
x
7
+
77.188
x
8
+
8.056
x
9
+
0.7
x
10
+
0.0455
x
11
{\displaystyle \ +636.321x^{7}+77.188x^{8}+8.056x^{9}+0.7x^{10}+0.0455x^{11}\ }
Plugging in the initial conditions we get:
y
11
(
x
)
=
−
3391815.1
e
x
+
734.909
e
2
x
+
3301079.406
+
3300338.812
x
+
1649428.813
x
2
+
549316.042
x
3
+
137082.188
x
4
+
27317.725
x
5
{\displaystyle \ y_{11}(x)=-3391815.1e^{x}+734.909e^{2x}+3301079.406+3300338.812x+1649428.813x^{2}+549316.042x^{3}+137082.188x^{4}+27317.725x^{5}\ }
+
4520.042
x
6
+
636.321
x
7
+
77.188
x
8
+
8.056
x
9
+
0.7
x
10
+
0.0455
x
11
{\displaystyle \ +4520.042x^{6}+636.321x^{7}+77.188x^{8}+8.056x^{9}+0.7x^{10}+0.0455x^{11}\ }
Matlab Code:
function yp = F(t,y)
yp = zeros(2,1);
yp(1) = y(2);
yp(2) = log(t+1) + 3*y(2)-2*y(1);
end
[t,y] = ode45('F',[-.75,3],[1,0]);
plot(x,y4,'g',x,y7,'r',x,y11,'y',t,y(:,1),'b')
axis([-0.75 3 -4 2])
Part 2 n=7 and n =11 were solved and uploaded by Cameron North .
Part 1 and Part 2 n = 4 was solved and uploaded by David Herrick
Find n sufficiently high so that
y
n
(
x
1
)
,
y
n
′
(
x
1
)
{\displaystyle y_{n}(x_{1}),y'_{n}(x_{1})}
do not differ from the numerical solution by more than
10
−
5
{\displaystyle 10^{-5}}
at
x
1
=
0.9
{\displaystyle x_{1}=0.9}
Develop log(1+x) in Taylor series about
x
^
=
1
{\displaystyle {\hat {x}}=1}
. Plot the results.
Find
y
n
(
x
)
{\displaystyle y_{n}(x)}
for n=4,7,11, such that
y
n
″
+
a
y
n
′
+
b
y
n
=
r
n
(
x
)
{\displaystyle y_{n}''+ay_{n}'+by_{n}=r_{n}(x)}
for x in [0.9,3] with the initial conditions found in Part 1. Plot the results.
Use the matlab command 'ode45' to integrate numerically (5) p.7b-7 with (1) p.7-28 and the initial conditions
y
n
(
x
1
)
,
y
n
′
(
x
1
)
{\displaystyle \displaystyle y_{n}(x_{1}),y'_{n}(x_{1})}
to obtain the numerical solution for
y
(
x
)
{\displaystyle \displaystyle y(x)}
.
Plot
y
(
x
)
{\displaystyle \displaystyle y(x)}
in the same figure with
y
n
(
x
)
{\displaystyle \displaystyle y_{n}(x)}
With MATLAB, a program was used to iteratively add terms into the taylor series of
l
o
g
(
1
+
x
)
{\displaystyle log(1+x)}
. Until the error between the exact answer and the series was less than
10
−
5
{\displaystyle 10^{-5}}
., more terms were added.
n
=
39
{\displaystyle n=39}
for the error to be of a magnitude of
10
−
5
{\displaystyle 10^{-5}}
. The error found:
9.7422e-005
With a very similar process for
y
n
′
(
x
1
)
{\displaystyle y'_{n}(x_{1})}
.
n
=
74
{\displaystyle n=74}
for the error to be of a magnitude of
10
−
5
{\displaystyle 10^{-5}}
. The error found:
9.3967e-005
The formula to develop the Taylor Series about
x
^
=
1
{\displaystyle {\hat {x}}=1}
is given by:
f
(
1
)
+
f
′
(
1
)
(
x
−
1
)
1
1
!
+
f
″
(
1
)
(
x
−
1
)
2
2
!
+
f
‴
(
1
)
(
x
−
1
)
3
3
!
+
.
.
.
∑
n
=
0
∞
f
n
(
1
)
(
x
−
1
)
n
n
!
{\displaystyle \displaystyle \ f(1)+{\frac {f'(1)(x-1)^{1}}{1!}}+{\frac {f''(1)(x-1)^{2}}{2!}}+{\frac {f'''(1)(x-1)^{3}}{3!}}+...\sum _{n=0}^{\infty }{\frac {f^{n}(1)(x-1)^{n}}{n!}}\ }
Using the function
log
(
1
+
x
)
{\displaystyle \displaystyle \ \log(1+x)\ }
for n=11 we get:
f
′
(
x
)
=
1
(
x
+
1
)
,
f
″
(
x
)
=
−
1
(
x
+
1
)
2
,
f
‴
(
x
)
=
2
(
x
+
1
)
3
,
f
I
V
(
x
)
=
−
6
(
x
+
1
)
4
,
{\displaystyle \displaystyle \ f'(x)={\frac {1}{(x+1)}},f''(x)={\frac {-1}{(x+1)^{2}}},f'''(x)={\frac {2}{(x+1)^{3}}},f^{IV}(x)={\frac {-6}{(x+1)^{4}}},\ }
f
V
(
x
)
=
24
(
x
+
1
)
5
,
f
V
I
(
x
)
=
−
120
(
x
+
1
)
6
,
f
V
I
I
(
x
)
=
720
(
x
+
1
)
7
,
f
V
I
I
I
(
x
)
=
−
5040
(
x
+
1
)
8
,
{\displaystyle \displaystyle \ f^{V}(x)={\frac {24}{(x+1)^{5}}},f^{VI}(x)={\frac {-120}{(x+1)^{6}}},f^{VII}(x)={\frac {720}{(x+1)^{7}}},f^{VIII}(x)={\frac {-5040}{(x+1)^{8}}},\ }
f
′
X
(
x
)
=
40320
(
x
+
1
)
9
,
f
X
(
x
)
=
−
362880
(
x
+
1
)
10
,
f
X
I
(
x
)
=
3628800
(
x
+
1
)
11
{\displaystyle \displaystyle \ f'^{X}(x)={\frac {40320}{(x+1)^{9}}},f^{X}(x)={\frac {-362880}{(x+1)^{10}}},f^{XI}(x)={\frac {3628800}{(x+1)^{11}}}\ }
Plugging in x=1 up to n=4, and using the formula for developing the Taylor Series, we get
y
n
4
{\displaystyle y_{n4}}
:
y
n
4
=
l
o
g
(
2
)
+
(
x
−
1
)
2
−
(
x
−
1
)
2
8
+
(
x
−
1
)
3
24
−
(
x
−
1
)
4
64
{\displaystyle \displaystyle \ y_{n4}=log(2)+{\frac {(x-1)}{2}}-{\frac {(x-1)^{2}}{8}}+{\frac {(x-1)^{3}}{24}}-{\frac {(x-1)^{4}}{64}}\ }
,
Then we do the same for n=7 terms to get
y
n
7
{\displaystyle y_{n7}}
:
y
n
7
=
l
o
g
(
2
)
+
(
x
−
1
)
2
−
(
x
−
1
)
2
8
+
(
x
−
1
)
3
24
−
(
x
−
1
)
4
64
+
(
x
−
1
)
5
160
−
(
x
−
1
)
6
384
+
(
x
−
1
)
7
896
{\displaystyle \displaystyle \ y_{n7}=log(2)+{\frac {(x-1)}{2}}-{\frac {(x-1)^{2}}{8}}+{\frac {(x-1)^{3}}{24}}-{\frac {(x-1)^{4}}{64}}+{\frac {(x-1)^{5}}{160}}-{\frac {(x-1)^{6}}{384}}+{\frac {(x-1)^{7}}{896}}\ }
And finally for
y
n
11
{\displaystyle y_{n11}}
:
y
n
11
=
l
o
g
(
2
)
+
(
x
−
1
)
2
−
(
x
−
1
)
2
8
+
(
x
−
1
)
3
24
−
(
x
−
1
)
4
64
+
(
x
−
1
)
5
160
−
(
x
−
1
)
6
384
+
(
x
−
1
)
7
896
−
(
x
−
1
)
8
2048
+
(
x
−
1
)
9
4608
−
(
x
−
1
)
10
10240
+
(
x
−
1
)
11
22528
{\displaystyle \displaystyle \ y_{n11}=log(2)+{\frac {(x-1)}{2}}-{\frac {(x-1)^{2}}{8}}+{\frac {(x-1)^{3}}{24}}-{\frac {(x-1)^{4}}{64}}+{\frac {(x-1)^{5}}{160}}-{\frac {(x-1)^{6}}{384}}+{\frac {(x-1)^{7}}{896}}-{\frac {(x-1)^{8}}{2048}}+{\frac {(x-1)^{9}}{4608}}-{\frac {(x-1)^{10}}{10240}}\ +{\frac {(x-1)^{11}}{22528}}}
Plotting the functions:
Matlab code:
x=-3:0.2:6;
y = log(1+x);
y4 = log(2) + (x-1)/2 - (x-1).^2/8 + (x-1).^3/24 - (x-1).^4/64;
y7 = log(2) + (x-1)/2 - (x-1).^2/8 + (x-1).^3/24 - (x-1).^4/64 + (x-1).^5/160 - (x-1).^6/384 + (x-1).^7/896;
y11 = log(2) + (x-1)/2 - (x-1).^2/8 + (x-1).^3/24 - (x-1).^4/64 + (x-1).^5/160 - (x-1).^6/384 + (x-1).^7/896 - (x-1).^8/2048 + (x-1).^9/4608 - (x-1).^(10)/10240 + (x-1).^(11)/22528;
plot(x,y, x,y4, x,y7, x,y11)
hleg1 = legend('log(1+x)','n=4','n=7','n=11');
Graph:
Convergence is in the domain [-1.5,4].
For n=4
r
x
{\displaystyle r_{x}}
is:
r
x
=
l
o
g
(
2
)
+
(
x
−
1
)
2
−
(
x
−
1
)
2
8
+
(
x
−
1
)
3
24
−
(
x
−
1
)
4
64
{\displaystyle \displaystyle \ r_{x}=log(2)+{\frac {(x-1)}{2}}-{\frac {(x-1)^{2}}{8}}+{\frac {(x-1)^{3}}{24}}-{\frac {(x-1)^{4}}{64}}\ }
y
p
4
=
c
0
+
c
1
(
x
−
1
)
−
c
2
(
x
−
1
)
2
+
c
3
(
x
−
1
)
3
−
c
4
(
x
−
1
)
4
{\displaystyle \displaystyle \ y_{p4}=c_{0}+c_{1}(x-1)-c_{2}(x-1)^{2}+c_{3}(x-1)^{3}-c_{4}(x-1)^{4}\ }
y
n
4
′
=
c
1
−
2
c
2
(
x
−
1
)
+
3
c
3
(
x
−
1
)
2
−
4
c
4
(
x
−
1
)
3
{\displaystyle \displaystyle \ y_{n4}'=c_{1}-2c_{2}(x-1)+3c_{3}(x-1)^{2}-4c_{4}(x-1)^{3}\ }
y
n
4
″
=
−
2
c
2
+
6
c
3
(
x
−
1
)
−
12
c
4
(
x
−
1
)
2
{\displaystyle \displaystyle \ y_{n4}''=-2c_{2}+6c_{3}(x-1)-12c_{4}(x-1)^{2}\ }
,
Plugging the equations into the above ODE will give matrices like the following:
[
2
0
0
0
0
−
12
2
0
0
0
12
−
9
2
0
0
0
6
−
6
2
0
0
0
2
−
3
2
]
∗
[
c
4
c
3
c
2
c
1
c
0
]
=
[
−
1
64
l
n
(
10
)
1
24
l
n
(
10
)
−
1
8
l
n
(
10
)
1
2
l
n
(
10
)
l
o
g
(
2
)
]
{\displaystyle {\begin{bmatrix}2&0&0&0&0\\-12&2&0&0&0\\12&-9&2&0&0\\0&6&-6&2&0\\0&0&2&-3&2\end{bmatrix}}*{\begin{bmatrix}c_{4}\\c_{3}\\c_{2}\\c_{1}\\c_{0}\end{bmatrix}}={\begin{bmatrix}-{\frac {1}{64ln(10)}}\\{\frac {1}{24ln(10)}}\\-{\frac {1}{8ln(10)}}\\{\frac {1}{2ln(10)}}\\log(2)\end{bmatrix}}\!}
The unknown vector
c
{\displaystyle c\!}
can be solved by forward substitution,
with MATLAB to do the calculations:
c
4
=
−
.0034
,
c
3
=
−
.0113
,
c
2
=
−
.0577
,
c
1
=
−
.1624
,
c
0
=
.1624
{\displaystyle c_{4}=-.0034,c_{3}=-.0113,c_{2}=-.0577,c_{1}=-.1624,c_{0}=.1624\!}
Particular and general solution
y
p
4
{\displaystyle y_{p4}\!}
,
y
4
{\displaystyle y_{4}\!}
:
y
p
4
=
0.1624
−
0.1624
∗
(
x
−
1
)
−
.0577
∗
(
x
−
1
)
2
−
.0113
∗
(
x
−
1
)
3
−
.0034
∗
(
x
−
1
)
4
{\displaystyle y_{p4}=0.1624-0.1624*(x-1)-.0577*(x-1)^{2}-.0113*(x-1)^{3}-.0034*(x-1)^{4}\!}
y
4
(
x
)
=
y
h
(
x
)
+
y
p
4
(
x
)
{\displaystyle y_{4}(x)=y_{h}(x)+y_{p4}(x)\!}
y
4
(
x
)
=
C
1
e
x
+
C
2
e
2
x
+
0.1624
−
0.1624
∗
(
x
−
1
)
{\displaystyle y_{4}(x)=C_{1}e^{x}+C_{2}e^{2x}+0.1624-0.1624*(x-1)\!}
−
.0577
∗
(
x
−
1
)
2
−
.0113
∗
(
x
−
1
)
3
−
.0034
∗
(
x
−
1
)
4
{\displaystyle -.0577*(x-1)^{2}-.0113*(x-1)^{3}-.0034*(x-1)^{4}\!}
Then with the Initial Conditions,
y
4
(
x
)
=
.0595
e
x
−
.0076
e
2
x
+
0.1624
−
0.1624
∗
(
x
−
1
)
{\displaystyle y_{4}(x)=.0595e^{x}-.0076e^{2x}+0.1624-0.1624*(x-1)\!}
−
.0577
∗
(
x
−
1
)
2
−
.0113
∗
(
x
−
1
)
3
−
.0034
∗
(
x
−
1
)
4
{\displaystyle -.0577*(x-1)^{2}-.0113*(x-1)^{3}-.0034*(x-1)^{4}\!}
For n=7
r
x
{\displaystyle r_{x}}
is:
r
x
=
l
o
g
(
2
)
+
(
x
−
1
)
2
−
(
x
−
1
)
2
8
+
(
x
−
1
)
3
24
−
(
x
−
1
)
4
64
+
(
x
−
1
)
5
160
−
(
x
−
1
)
6
384
+
(
x
−
1
)
7
896
{\displaystyle \displaystyle \ r_{x}=log(2)+{\frac {(x-1)}{2}}-{\frac {(x-1)^{2}}{8}}+{\frac {(x-1)^{3}}{24}}-{\frac {(x-1)^{4}}{64}}+{\frac {(x-1)^{5}}{160}}-{\frac {(x-1)^{6}}{384}}+{\frac {(x-1)^{7}}{896}}\ }
y
p
7
=
c
0
+
c
1
(
x
−
1
)
−
c
2
(
x
−
1
)
2
+
c
3
(
x
−
1
)
3
−
c
4
(
x
−
1
)
4
+
c
5
(
x
−
1
)
5
−
c
6
(
x
−
1
)
6
+
c
7
(
x
−
1
)
7
{\displaystyle \displaystyle \ y_{p7}=c_{0}+c_{1}(x-1)-c_{2}(x-1)^{2}+c_{3}(x-1)^{3}-c_{4}(x-1)^{4}+c_{5}(x-1)^{5}-c_{6}(x-1)^{6}+c_{7}(x-1)^{7}\ }
y
p
7
′
=
c
1
−
2
c
2
(
x
−
1
)
+
3
c
3
(
x
−
1
)
2
−
4
c
4
(
x
−
1
)
3
+
5
c
5
(
x
−
1
)
4
−
6
c
6
(
x
−
1
)
5
+
7
c
7
(
x
−
1
)
6
{\displaystyle \displaystyle \ y_{p7}'=c_{1}-2c_{2}(x-1)+3c_{3}(x-1)^{2}-4c_{4}(x-1)^{3}+5c_{5}(x-1)^{4}-6c_{6}(x-1)^{5}+7c_{7}(x-1)^{6}\ }
y
p
7
″
=
−
2
c
2
+
6
c
3
(
x
−
1
)
−
12
c
4
(
x
−
1
)
2
+
20
c
5
(
x
−
1
)
3
−
30
c
6
(
x
−
1
)
4
+
42
c
7
(
x
−
1
)
5
{\displaystyle \displaystyle \ y_{p7}''=-2c_{2}+6c_{3}(x-1)-12c_{4}(x-1)^{2}+20c_{5}(x-1)^{3}-30c_{6}(x-1)^{4}+42c_{7}(x-1)^{5}\ }
The same process used when solving when n=4 is used to construct a matrix equation for n=7:
[
2
0
0
0
0
0
0
0
−
21
2
0
0
0
0
0
0
42
−
18
2
0
0
0
0
0
0
30
−
15
2
0
0
0
0
0
0
20
−
12
2
0
0
0
0
0
0
12
−
9
2
0
0
0
0
0
0
6
−
6
2
0
0
0
0
0
0
2
−
3
2
]
∗
[
c
7
c
6
c
5
c
4
c
3
c
2
c
1
c
0
]
=
[
1
896
l
n
(
10
)
−
1
384
l
n
(
10
)
1
160
l
n
(
10
)
−
1
64
l
n
(
10
)
1
24
l
n
(
10
)
−
1
8
l
n
(
10
)
1
2
l
n
(
10
)
l
o
g
(
2
)
]
{\displaystyle {\begin{bmatrix}2&0&0&0&0&0&0&0\\-21&2&0&0&0&0&0&0\\42&-18&2&0&0&0&0&0\\0&30&-15&2&0&0&0&0\\0&0&20&-12&2&0&0&0\\0&0&0&12&-9&2&0&0\\0&0&0&0&6&-6&2&0\\0&0&0&0&0&2&-3&2\end{bmatrix}}*{\begin{bmatrix}c_{7}\\c_{6}\\c_{5}\\c_{4}\\c_{3}\\c_{2}\\c_{1}\\c_{0}\end{bmatrix}}={\begin{bmatrix}{\frac {1}{896ln(10)}}\\-{\frac {1}{384ln(10)}}\\{\frac {1}{160ln(10)}}\\-{\frac {1}{64ln(10)}}\\{\frac {1}{24ln(10)}}\\-{\frac {1}{8ln(10)}}\\{\frac {1}{2ln(10)}}\\log(2)\end{bmatrix}}\!}
Using MATLAB to solve for the unknown vector
c
{\displaystyle c\!}
:
c
7
=
.0002
,
c
6
=
.0020
,
c
5
=
.0141
,
c
4
=
.0725
,
c
3
=
.3034
,
c
2
=
.9029
,
c
1
=
1.9072
,
c
0
=
2.1084
{\displaystyle c_{7}=.0002,c_{6}=.0020,c_{5}=.0141,c_{4}=.0725,c_{3}=.3034,c_{2}=.9029,c_{1}=1.9072,c_{0}=2.1084\!}
Particular and general solutions
y
p
7
{\displaystyle y_{p7}\!}
,
y
7
{\displaystyle y_{7}\!}
:
y
p
7
=
2.1084
+
1.9072
∗
(
x
−
1
)
+
.9029
∗
(
x
−
1
)
2
+
.3034
∗
(
x
−
1
)
3
+
.0725
∗
(
x
−
1
)
4
+
.0141
∗
(
x
−
1
)
5
+
.0020
∗
(
x
−
1
)
6
+
.0002
∗
(
x
−
1
)
7
{\displaystyle y_{p7}=2.1084+1.9072*(x-1)+.9029*(x-1)^{2}+.3034*(x-1)^{3}+.0725*(x-1)^{4}+.0141*(x-1)^{5}+.0020*(x-1)^{6}+.0002*(x-1)^{7}\!}
y
7
(
x
)
=
y
h
(
x
)
+
y
p
7
(
x
)
{\displaystyle y_{7}(x)=y_{h}(x)+y_{p7}(x)\!}
y
7
(
x
)
=
C
1
e
x
+
C
2
e
2
x
+
2.1084
+
1.9072
∗
(
x
−
1
)
+
.9029
∗
(
x
−
1
)
2
+
.3034
∗
(
x
−
1
)
3
+
.0725
∗
(
x
−
1
)
4
+
.0141
∗
(
x
−
1
)
5
{\displaystyle y_{7}(x)=C_{1}e^{x}+C_{2}e^{2x}+2.1084+1.9072*(x-1)+.9029*(x-1)^{2}+.3034*(x-1)^{3}+.0725*(x-1)^{4}+.0141*(x-1)^{5}\!}
+
.0020
∗
(
x
−
1
)
6
+
.0002
∗
(
x
−
1
)
7
{\displaystyle +.0020*(x-1)^{6}+.0002*(x-1)^{7}\!}
With the initial conditions:
y
7
(
x
)
=
−
.7271
e
x
+
.0233
e
2
x
+
2.1084
+
1.9072
∗
(
x
−
1
)
+
.9029
∗
(
x
−
1
)
2
+
.3034
∗
(
x
−
1
)
3
+
.0725
∗
(
x
−
1
)
4
+
.0141
∗
(
x
−
1
)
5
!
{\displaystyle y_{7}(x)=-.7271e^{x}+.0233e^{2x}+2.1084+1.9072*(x-1)+.9029*(x-1)^{2}+.3034*(x-1)^{3}+.0725*(x-1)^{4}+.0141*(x-1)^{5}!}
+
.0020
∗
(
x
−
1
)
6
+
.0002
∗
(
x
−
1
)
7
{\displaystyle +.0020*(x-1)^{6}+.0002*(x-1)^{7}\!}
For n=11
r
x
{\displaystyle r_{x}}
is:
r
x
=
l
o
g
(
2
)
+
(
x
−
1
)
2
−
(
x
−
1
)
2
8
+
(
x
−
1
)
3
24
−
(
x
−
1
)
4
64
+
(
x
−
1
)
5
160
−
(
x
−
1
)
6
384
+
(
x
−
1
)
7
896
−
(
x
−
1
)
8
2048
+
(
x
−
1
)
9
4608
−
(
x
−
1
)
10
10240
+
(
x
−
1
)
11
22528
{\displaystyle \displaystyle \ r_{x}=log(2)+{\frac {(x-1)}{2}}-{\frac {(x-1)^{2}}{8}}+{\frac {(x-1)^{3}}{24}}-{\frac {(x-1)^{4}}{64}}+{\frac {(x-1)^{5}}{160}}-{\frac {(x-1)^{6}}{384}}+{\frac {(x-1)^{7}}{896}}-{\frac {(x-1)^{8}}{2048}}+{\frac {(x-1)^{9}}{4608}}-{\frac {(x-1)^{10}}{10240}}\ +{\frac {(x-1)^{11}}{22528}}\ }
y
p
11
=
c
0
+
c
1
(
x
−
1
)
−
c
2
(
x
−
1
)
2
+
c
3
(
x
−
1
)
3
−
c
4
(
x
−
1
)
4
+
c
5
(
x
−
1
)
5
−
c
6
(
x
−
1
)
6
+
c
7
(
x
−
1
)
7
−
(
x
−
1
)
8
+
(
x
−
1
)
9
−
(
x
−
1
)
10
+
(
x
−
1
)
11
{\displaystyle \displaystyle \ y_{p11}=c_{0}+c_{1}(x-1)-c_{2}(x-1)^{2}+c_{3}(x-1)^{3}-c_{4}(x-1)^{4}+c_{5}(x-1)^{5}-c_{6}(x-1)^{6}+c_{7}(x-1)^{7}-(x-1)^{8}+(x-1)^{9}-(x-1)^{10}+(x-1)^{11}\ }
y
p
11
′
=
c
1
−
2
c
2
(
x
−
1
)
+
3
c
3
(
x
−
1
)
2
−
4
c
4
(
x
−
1
)
3
+
5
c
5
(
x
−
1
)
4
−
6
c
6
(
x
−
1
)
5
+
7
c
7
(
x
−
1
)
6
{\displaystyle \displaystyle \ y_{p11}'=c_{1}-2c_{2}(x-1)+3c_{3}(x-1)^{2}-4c_{4}(x-1)^{3}+5c_{5}(x-1)^{4}-6c_{6}(x-1)^{5}+7c_{7}(x-1)^{6}\ }
−
8
c
8
(
x
−
1
)
7
+
9
c
9
(
x
−
1
)
8
−
10
c
10
(
x
−
1
)
9
+
11
c
11
(
x
−
1
)
10
{\displaystyle \displaystyle \ -8c_{8}(x-1)^{7}+9c_{9}(x-1)^{8}-10c_{10}(x-1)^{9}+11c_{11}(x-1)^{10}\ }
y
p
11
″
=
−
2
c
2
+
6
c
3
(
x
−
1
)
−
12
c
4
(
x
−
1
)
2
+
20
c
5
(
x
−
1
)
3
−
30
c
6
(
x
−
1
)
4
+
42
c
7
(
x
−
1
)
5
−
56
c
8
(
x
−
1
)
6
{\displaystyle \displaystyle \ y_{p11}''=-2c_{2}+6c_{3}(x-1)-12c_{4}(x-1)^{2}+20c_{5}(x-1)^{3}-30c_{6}(x-1)^{4}+42c_{7}(x-1)^{5}-56c_{8}(x-1)^{6}\ }
+
72
c
9
(
x
−
1
)
7
−
90
c
10
(
x
−
1
)
8
+
110
c
11
(
x
−
1
)
9
{\displaystyle \displaystyle \ +72c_{9}(x-1)^{7}-90c_{10}(x-1)^{8}+110c_{11}(x-1)^{9}\ }
Creating another matrix system and solving for the unknown vector
c
{\displaystyle c\!}
:
c
11
=
0
,
c
10
=
.0002
,
c
9
=
.0019
,
c
8
=
.0181
,
c
7
=
.15
,
c
6
=
1.0675
,
c
5
=
6.4597
,
{\displaystyle c_{11}=0,c_{10}=.0002,c_{9}=.0019,c_{8}=.0181,c_{7}=.15,c_{6}=1.0675,c_{5}=6.4597,\!}
c
4
=
32.4318
,
c
3
=
130.0033
,
c
2
=
390.3968
,
c
1
=
781.289
,
c
0
=
781.6873
{\displaystyle c_{4}=32.4318,c_{3}=130.0033,c_{2}=390.3968,c_{1}=781.289,c_{0}=781.6873\!}
Particular and general solutions
y
p
11
{\displaystyle y_{p11}\!}
,
y
1
1
(
x
)
{\displaystyle y_{1}1(x)\!}
:
y
p
11
=
781.6873
+
781.289
∗
(
x
−
1
)
+
390.3968
∗
(
x
−
1
)
2
+
130.0033
∗
(
x
−
1
)
3
+
32.4318
∗
(
x
−
1
)
4
+
{\displaystyle y_{p11}=781.6873+781.289*(x-1)+390.3968*(x-1)^{2}+130.0033*(x-1)^{3}+32.4318*(x-1)^{4}+\!}
6.4597
∗
(
x
−
1
)
5
+
1.0675
∗
(
x
−
1
)
6
+
.15
∗
(
x
−
1
)
7
+
.0181
∗
(
x
−
1
)
8
+
.0019
∗
(
x
−
1
)
9
+
.0002
∗
(
x
−
1
)
10
{\displaystyle 6.4597*(x-1)^{5}+1.0675*(x-1)^{6}+.15*(x-1)^{7}+.0181*(x-1)^{8}+.0019*(x-1)^{9}+.0002*(x-1)^{10}\!}
y
11
(
x
)
=
y
h
(
x
)
+
y
p
11
(
x
)
{\displaystyle y_{11}(x)=y_{h}(x)+y_{p11}(x)\!}
y
11
(
x
)
=
C
1
e
x
+
C
2
e
2
x
+
781.6873
+
781.289
∗
(
x
−
1
)
{\displaystyle y_{11}(x)=C_{1}e^{x}+C_{2}e^{2x}+781.6873+781.289*(x-1)\!}
+
390.3968
∗
(
x
−
1
)
2
+
130.0033
∗
(
x
−
1
)
3
+
32.4318
∗
(
x
−
1
)
4
{\displaystyle +390.3968*(x-1)^{2}+130.0033*(x-1)^{3}+32.4318*(x-1)^{4}\!}
6.4597
∗
(
x
−
1
)
5
+
1.0675
∗
(
x
−
1
)
6
+
.15
∗
(
x
−
1
)
7
+
.0181
∗
(
x
−
1
)
8
+
.0019
∗
(
x
−
1
)
9
+
.0002
∗
(
x
−
1
)
10
{\displaystyle 6.4597*(x-1)^{5}+1.0675*(x-1)^{6}+.15*(x-1)^{7}+.0181*(x-1)^{8}+.0019*(x-1)^{9}+.0002*(x-1)^{10}\!}
With initial conditions:
y
11
(
x
)
=
−
287.5907
e
x
+
.05
e
2
x
+
781.6873
+
781.289
∗
(
x
−
1
)
+
390.3968
∗
(
x
−
1
)
2
+
130.0033
∗
(
x
−
1
)
3
+
32.4318
∗
(
x
−
1
)
4
{\displaystyle y_{11}(x)=-287.5907e^{x}+.05e^{2x}+781.6873+781.289*(x-1)+390.3968*(x-1)^{2}+130.0033*(x-1)^{3}+32.4318*(x-1)^{4}\!}
6.4597
∗
(
x
−
1
)
5
+
1.0675
∗
(
x
−
1
)
6
+
.15
∗
(
x
−
1
)
7
+
.0181
∗
(
x
−
1
)
8
+
.0019
∗
(
x
−
1
)
9
+
.0002
∗
(
x
−
1
)
10
{\displaystyle 6.4597*(x-1)^{5}+1.0675*(x-1)^{6}+.15*(x-1)^{7}+.0181*(x-1)^{8}+.0019*(x-1)^{9}+.0002*(x-1)^{10}\!}
plot:
The initial condition equation is:
y
″
−
3
y
′
+
2
y
=
l
n
(
1
+
x
)
{\displaystyle \displaystyle y''-3y'+2y=ln(1+x)}
The initial conditions are:
y
(
0
)
=
39
,
y
′
(
0
)
=
74
{\displaystyle \displaystyle y(0)=39,y'(0)=74}
To solve the problem, we first convert the 2nd order differential equation into two 1st order differential equations. The initial 2nd order then turns into these two equations:
y
1
=
y
,
y
2
=
y
′
{\displaystyle \displaystyle y_{1}=y,y_{2}=y'}
Taking the derivatives, we find that:
y
1
′
=
y
2
,
y
2
′
=
−
2
y
1
−
3
y
2
+
l
n
(
1
+
x
)
{\displaystyle \displaystyle y'_{1}=y_{2},y'_{2}=-2y_{1}-3y_{2}+ln(1+x)}
with the new initial conditions as:
y
1
(
t
0
)
=
1
,
y
2
(
t
0
)
=
0
,
t
0
=
−
3
4
{\displaystyle \displaystyle y_{1}(t_{0})=1,y_{2}(t_{0})=0,t_{0}={\frac {-3}{4}}}
Now, we create a MATLAB function, "F", that will return a vector-valued function. We do this with the following function:
function yp=F(x,y)
yp=zeros(2,1);
yp(1)=y(2);
yp(2)=-2*y(1)-3*y(2)+log(1+x);
We now incorporate the function into a simple MATLAB program which will calculate the results:
EDU>> [x,y]=ode45('F',[0,5],[39,74]);
EDU>> plot(y(:,1),y(:,2))
This generates the following graph of
y
n
(
x
)
{\displaystyle \displaystyle y_{n}(x)}
:
Now we solve the initial value problem by hand to find y(x):
y
″
−
3
y
′
+
2
y
=
l
n
(
1
+
x
)
{\displaystyle \displaystyle y''-3y'+2y=ln(1+x)}
First, convert to the characteristic equation:
λ
2
−
3
λ
+
2
=
0
{\displaystyle \displaystyle \lambda ^{2}-3\lambda +2=0}
λ
1
=
2
,
λ
2
=
1
{\displaystyle \displaystyle \lambda _{1}=2,\lambda _{2}=1}
y
h
(
x
)
=
C
1
e
x
+
C
2
e
2
x
{\displaystyle \displaystyle y_{h}(x)=C_{1}e^{x}+C_{2}e^{2}x}
The excitation factor of ln(1+x) does not yield any useful value for
y
p
(
x
)
{\displaystyle \displaystyle y_{p}(x)}
since the integral is nonelementary. Therefore, the final solution for y(x) with what is know is simply:
y
(
x
)
=
C
1
e
x
+
C
2
e
2
x
,
y
′
(
x
)
=
C
1
e
x
+
2
C
2
e
2
x
{\displaystyle \displaystyle y(x)=C_{1}e^{x}+C_{2}e^{2}x,y'(x)=C_{1}e^{x}+2C_{2}e^{2}x}
y
(
0
)
=
39
,
C
1
+
C
2
=
39
{\displaystyle \displaystyle y(0)=39,C_{1}+C_{2}=39}
y
′
(
0
)
=
74
,
C
1
+
2
C
2
=
74
{\displaystyle \displaystyle y'(0)=74,C_{1}+2C_{2}=74}
C
1
=
4
,
C
2
=
35
{\displaystyle \displaystyle C_{1}=4,C_{2}=35}
y
(
x
)
=
4
e
x
+
35
e
2
x
{\displaystyle \displaystyle y(x)=4e^{x}+35e^{2x}}
Graphing both solutions on the same graph yields the following:
MATLAB code: EDU>> z = 4*exp(x) + 25*exp(2*x)
plot(y(:,1),y(:,2),y(:,1),z)
Contribution Summary
edit
Problem 1 was solved and uploaded by Joshua House 15:34, 13 March 2012 (UTC)
Problem 2 was solved by Mike Wallace
Problem 3 part 2 was solved by John North and parts 1 and 3 were solved by David Herrick
Problem 4 part 1 and part of part3 were solved and uploaded by Derik Bell , parts 2 and 3 were solved by Radina Dikova, and part 4 was solved by William Knapper