ASSIGNMENT 03
DUE 2025
,Solution to Question 1
Problem Statement
Determine the solution y(x) for each of the following initial value problems:
(1.1) y ′ − yx cos x = 0, with y(π) = 1.
y
(1.2) 2y ′ + x = 0, with y(1) = π.
Solution to Part (1.1)
Step 1: Rewrite the Differential Equation
The differential equation is:
y ′ − yx cos x = 0 =⇒ y ′ = yx cos x.
This is a first-order differential equation that can be recognized as separable, since it can be written as:
dy
= x cos x dx.
y
Alternatively, it can be treated as a linear differential equation of the form y ′ + P (x)y = Q(x), where:
P (x) = −x cos x, Q(x) = 0.
The separable form is simpler, so we proceed with separation of variables.
Step 2: Integrate Both Sides Separate and integrate:
Z Z
dy
= x cos x dx.
y
Left-hand side: Z
dy
= ln |y| + C1 .
y
Right-hand side requires integration by parts. Let u = x, dv = cos x dx:
Z Z
v = sin x, x cos x dx = x sin x − sin x dx = x sin x + cos x + C2 .
Thus:
ln |y| = x sin x + cos x + C, C = C2 − C1 .
Exponentiate to solve for y:
|y| = ex sin x+cos x+C = eC ex sin x+cos x =⇒ y = ±eC ex sin x+cos x .
Let A = ±eC , where A is a constant (positive or negative), so the general solution is:
y(x) = Aex sin x+cos x .
1
, Step 3: Apply the Initial Condition Use the initial condition y(π) = 1:
y(π) = Aeπ sin π+cos π = Ae0−1 = Ae−1 = 1.
Solve for A:
Ae−1 = 1 =⇒ A = e.
Thus, the particular solution is:
y(x) = e · ex sin x+cos x = ex sin x+cos x+1 .
Step 4: Verify the Solution To ensure correctness, differentiate y(x) = ex sin x+cos x+1 :
d
y ′ = ex sin x+cos x+1 · (x sin x + cos x + 1) = ex sin x+cos x+1 (sin x + x cos x − sin x) = ex sin x+cos x+1 · x cos x.
dx
Check the differential equation:
y ′ = x cos x · ex sin x+cos x+1 = x cos x · y.
This satisfies y ′ = yx cos x. Check the initial condition:
y(π) = eπ sin π+cos π+1 = e0−1+1 = e0 = 1.
Both are satisfied, confirming the solution.
Final Answer The solution to y ′ − yx cos x = 0, with y(π) = 1, is:
y(x) = ex sin x+cos x+1 .
2