Ode Q&a
Ode Q&a
and Solutions
and
f 00 (x) + g 0 (x) = 0,
and
4
g(0) = .
3
Solution.
(a) Let us introduce a notation for the Laplace transform of the function y(x):
Z
y(x)epx dx
Y = L[y] =
0
0
00
and
Laplace transform is a linear operator. Hence, after applying to both parts of the
differential equation, we obtain an algebraic equation
L[y 00 +4y 0 +4y] = L[y 00 ]+4L[y 0 ]+4L[y] = y 0 (0)py(0)+p2 Y +4 (y(0) + pY )+4Y = L[e2x ].
Calculate the Laplace transform in the right hand side:
Z
1
1
2x
(p+2)x
2x
L[e ] =
e
dx =
e
=
.
(p + 2)
p+2
0
0
Taking into account the boundary conditions, the algebraic equation becomes
4 4p + p2 Y 16 + 4pY + 4Y = (p2 + 4p + 4)Y 4p 20 =
1
1
.
p+2
Hence,
1
+ 4p + 20
p+2
and, after dividing both parts by (p + 2)2 ,
1
4p
20
Y =
+
+
.
3
2
(p + 2)
(p + 2)
(p + 2)2
(p + 2)2 Y =
=
=
=
2
2
2
2
(p + 2)
(p + 2)
(p + 2)
(p + 2)
p + 2 (p + 2)2
and substitute this into the expression for Y . Thus,
8
12
1
4
20
1
4
+
Y =
+
+
=
+
.
(p + 2)3 p + 2 (p + 2)2 (p + 2)2
(p + 2)3 p + 2 (p + 2)2
Refer to the table of Laplace transforms:
L [xn eax ] =
n!
.
(s a)n+1
4
0!
=4
p+2
(p (2))0+1
12
1!
=
12
(p + 2)2
(p (2))1+1
1
1
2!
=
L[y3 ] =
3
(p + 2)
2 (p (2))2+1
L[y2 ] =
y1 (x) = 4e2x
y2 (x) = 12xe2x
1
y3 (x) = x2 e2x .
2
Thus,
1
y(x) = y1 (x) + y2 (x) + y3 (x) = x2 e2x + 12xe2x + 4e2x = e2x
2
x2
+ 12x + 4 .
2
2x
2x
2x
x2
2
(b) Perform the Laplace transform of both equations. Use (see the lecture notes)
L[f 0 ] = f (0) + pL[f ]
and
Let us introduce notations for the Laplace transforms of the functions f (x) and
g(x):
Z
f (t)ept dt
F = L[f ] =
Z0
g(t)ept dt
G = L[g] =
0
In these notations, the Laplace transforms of the two given equations are:
f (0) + pF g(0) + pG 3G = 0
and
f 0 (0) pf (0) + p2 F g(0) + pG = 0.
Taking into account the boundary conditions, obtain a system of two algebraic
equations:
4
4
pF + pG 3G =
and
p2 F + pG = .
3
3
By equating the left hand sides we find
pF + pG 3G = p2 F + pG
(p2 F pF ) = 3G
G = 13 p(p 1)F
Substitute G into the 2nd algebraic equation:
4
3
= p2 F 31 p2 (p 1)F
= F (p2 31 p3 + 13 p2 ) = F ( 43 p2 31 p3 )
= 13 p2 (p 4)F.
Hence
4
4 p1
and
G=
.
4)
3 p(p 4)
Represent F as a sum of simple fractions (review PHAS1245):
F =
p2 (p
4
A
Bp + C
Ap2 + Bp2 + Cp 4Bp 4C
=
.
=
+
p2 (p 4)
p4
p2
p2 (p 4)
From this:
1
1
C=1
B=
A=
4
4
and, therefore,
4
1
1
1
F = 2
=
+
+ 2.
p (p 4)
4(p 4) 4p p
Similarly, for G
1
1
4(p 1)
=
+ .
3p(p 4)
p 4 3p
Use the table of Laplace transform to find functions f (x) and g(x):
G=
1
1
f (x) = e4x + + x
4
4
and
1
g(x) = e4x + .
3
To check the correctness of the solutions, calculate derivatives of f (x) and g(x)
f 0 (x) = e4x + 1
f 00 (x) = 4e4x
g 0 (x) = 4e4x ,
f 0 (0) = 0
4
g(0) = ,
3
where the functions k1 (x) and k2 (x) are subject to the conditions (see the lecture
notes)
k10 cos x + k20 sin x = 0
(k10 sin x + k20 cos x) = sin x.
From the first condition we have
sin x
k10 = k20
.
cos x
Thus, the second condition gives:
2
sin x
1
0
k2
+ cos x = k20
= sin x.
cos x
cos x
Hence,
k20 =
cos x sin x
and
k10 =
sin2 x
.
2
2
4
Z
1
1
k2 (x) =
sin x cos x dx =
sin2 x + c2 .
2 2
Thus, a particular solution of the ODE can be written as
1
1
1
yp (x) = x + 2 sin 2x cos x + 2 sin3 x.
2
4
2
This expression for yp (x) can be simplified using trigonometric relations
sin 2x = 2 sin x cos x
sin2 x + cos2 x = 1.
1
1
1
1
(x cos x + sin x) .
yp (x) = x cos x+ 2 sin x cos2 x+ 2 sin3 x =
2
2
2
2 2
Therefore, the general solution is
1
y(x) =
(x cos x + sin x) + A cos x + B sin x
2 2
and its first derivative is
1
cos x + 2 x sin x + cos x A sin x + B cos x,
y 0 (x) =
2
2
where A and B are constants to be determined using the boundary conditions.
From y(0) = 0 we find that A = 0 and from y 0 (0) = 0 we find that B = 0. Thus,
the solution is
1
y(x) =
(x cos x + sin x) .
2 2
(b) Check that y1 (x) = x and y2 (x) = x2 are solutions of the homogeneous
equation:
x2 y100 2xy10 + 2y1 = 0 2x + 2x = 0
x2 y200 2xy20 + 2y2 = 2x2 4x2 + 2x2 = 0
ln x
.
x
Thus,
k20 =
Integrate k10 :
ln x
x2
Z
k1 =
and
ln x
dx =
x
Z
ln x d(ln x) =
k10 =
ln x
.
x
1 2
ln x + c1 .
2
Integrate k20 :
Z
Z
1
1
1
1
1
1
k2 =
ln x dx = ln x +
dx = ln x + c2 = (ln x + 1) + c2
2
2
x
x
x
x
x
x
Thus, a particular solution of the non-homogeneous ODE is
x
x
yp (x) = k1 x + k2 x2 = ln2 x x(ln x + 1) = ln2 x x ln x x
2
2
and the general solution is (use the fact that x is a solution of the homogeneous
ODE)
x
y(x) = ln2 x x ln x + Ax + Bx2 ,
2
where A and B are arbitrary constants.
(b) Generalised function (x) is equal to zero for x < a and 1 for x a, where
a > 0. Express the first derivative of the function using the Dirac function.
(c) Show that for m n (m and n are non-negative and integer), the generalised
function xm (n) (x), where (n) (x) is the nth derivative of the function satisfy
xm (n) (x) = (1)m
Solution.
(a)
Z 3
Z
(5x 2) (2 x) dx =
0
n!
(nm) (x).
(n m)!
f (x) (2 x) dx = f (2) = 5 2 2 = 8
(b) Consider integral of the first derivative of the function (x) with the test
function f (x) and integrate it by parts:
Z +
Z +
Z +
0
+
0
f 0 (x) dx = f (x)|
f (x) (x) dx = f (x)(x)|
f (x) (x) dx = (00)
a = f (a).
(c) We need to demonstrate that for any well-behaved (see lecture notes) test
function f (x) the following relation holds
Z b
Z b
n!
m (n)
m
f (x)x (x) dx = (1)
f (x) (nm) (x) dx,
(n
m)!
a
a
where lower and upper limits a and b are such that the test function and all of its
derivatives are zero at least at these points and everywhere outside domain (a, b).
a
th
[g(x)]
= [x f (x)]
k=n
X
k=0
n!
[xm ](k) [f (x)](nk)
k!(n k)!
and evaluate its value at the point x = 0 for each of the terms of this sum. Consider
three cases:
1) Terms with k < m have a factor of xmk , which turns to zero when x = 0.
2) The only term with k = m is
n!
[xm ](m) [f (x)](nm) .
m!(n m)!
Since
[xm ](m) = m[xm1 ](m1) = m(m1)[xm2 ](m2) = ... = m(m1)(m2)...21 = m!,
we have
n!
n!
[xm ](m) [f (x)](nm) =
[f (x)](nm)
m!(n m)!
(n m)!
3) Terms with k > m turn to zero by the differentiation rule of xm .
Thus, at x = 0
n!
g (n) (0) =
f (nm) (0).
(n m)!
Finally, compare the LHS and RHS of the original equality:
Z b
n!
LHS =
f (x)xm (n) (x) dx = (1)n g (n) (0) = (1)n
f (nm) (0)
(n
m)!
a
Z b
n!
n!
m
RHS = (1)
f (x) (nm) (x) dx = (1)m
(1)nm f (nm) (0)
(n m)! a
(n m)!
and find LHS=RHS.
(4) ODE: Greens functions. Use the method of the Greens function to solve
(a) the non-homogeneous equation
y 00 (x) + 2 y(x) = ex
and
y 0 (0) = 0
G(0, t) = 0
and
G0 (0, t) = 0.
are satisfied if
Hence
Gx<t (0, t) = A 1 + B 0 = 0
and
G0x<t (0, t) = A 0 + B 1 = 0,
sin t
.
cos t
10
Thus,
sin t
cos t
and
C=
0
0
D=
0
0
0
0
The integrals on the left and one the right are identical, hence, we can write
Z x
1
1
1
1
cos t et dt = ex sin x 2 ex cos x + 2 ,
1+ 2
0
which gives
Z
cos t et dt =
1
x
x
e
sin
x
e
cos
x
+
1
.
2 + 1
1 1
sin x (ex sin x ex cos x + 1)
2 +1
1 21+1 cos x (ex cos x ex sin x +
11
where function G(x, t) has the form of f (t)y1 (x) + g(t)y2 (x). For this, let
Gx<t (x, t) = A(t)x + B(t)(1 x2 )
Gx>t (x, t) = C(t)x + D(t)(1 x2 )
and find coefficients A(t), B(t), C(t), D(t) using the boundary conditions and the
continuity/discontinuity conditions.
From the boundary conditions we obtain:
Gx<t (x = 0, t) = A 0 + B 1 = 0
Gx>t (x = 1, t) = C 1 + D 0 = 0.
Hence, B = C = 0.
From the continuity condition for G(x, t) at x = t:
Gx>t (x = t, t) Gx<t (x = t, t) = D(1 t2 ) At = 0.
Hence,
1 t2
.
t
From the discontinuity condition for G(x, t) at x = t:
A=D
1
.
t2 + 1
t
(t2 + 1)2
and, therefore,
A=
t2 1
.
(t2 + 1)2
(t2
for x < t
t
(x2 1)
2
+ 1)
for x > t.
12
where f (t) is the right hand side of the original non-homogeneous equation. Thus,
Z 1 2
Z x
t 1 2
t
2
2
2
(t + 1) dt + x
(t + 1)2 dt,
y(x) = (x 1)
2
2
2 + 1)2
(t
+
1)
(t
x
0
which simplifies into
x
1
Z x
Z 1
Z 1
1 3
1 2
2
2
2
+ x t
[xt]1x ,
y(x) = (x 1)
t dt + x
t dt x
dt = (x 1) t
2
3
0
x
x
0
x
and gives
x4 x2 x x4
1
1
2
y(x) =
+
x + x2 = x4 + x2 x.
2
2
3
3
6
2
3