ASSIGNMENT 04
DUE 2025
, Question 1: Differential Equation and Plot (25 Marks)
Problem Statement: Given the differential equation
x2 y ′′ (x) + x2 y ′ (x) + xy(x) = 0,
with initial conditions y(1) = 1 and y ′ (1) = 1. Produce a plot demonstrating the be-
haviour of y(x) in the interval [1, 50].
Solution
1. Step 1: Analyze the Differential Equation
The given equation is
x2 y ′′ + x2 y ′ + xy = 0.
This is a second-order linear differential equation with variable coefficients. To
simplify, divide through by x2 :
1
y ′′ + y ′ + y = 0.
x
This resembles a Cauchy-Euler equation but with a non-standard x1 y term, suggest-
ing a complex analytical solution. Let’s attempt a substitution y = √ux . Compute
the derivatives:
y = ux−1/2 ,
1
y ′ = u′ x−1/2 − ux−3/2 ,
2
3
y ′′ = u′′ x−1/2 − u′ x−3/2 + ux−5/2 .
4
Substitute into the simplified equation:
′′ −1/2 ′ −3/2 3 −5/2 ′ −1/2 1 −3/2 1
ux−1/2 = 0.
u x −ux + ux + ux − ux +
4 2 x
Multiply by x3/2 to clear denominators:
′′ ′ 1 3
xu + (x − 1)u + + u = 0.
2 4x
This equation is still complex, indicating that numerical methods may be more
practical given the requirement to plot over [1, 50].
2. Step 2: Numerical Solution
Convert the second-order ODE to a system of first-order ODEs. Let z1 = y, z2 = y ′ .
Then:
z1′ = z2 ,
1 1 1 1
z2′ = y ′′ = − y ′ − 2 y = − z2 − 2 z1 .
x x x x
The system is: (
z1′ = z2 ,
z2′ = − x1 z2 − x12 z1 ,
1