Question
Solve the linear differential equation:
dxdy+x2y=x2,x>0
Find the particular solution that passes through (1,1).
Solution — Step by Step
This is a first-order linear ODE in standard form dxdy+P(x)y=Q(x) with:
P(x)=x2,Q(x)=x2
μ(x)=e∫Pdx=e∫(2/x)dx=e2lnx=x2
x2dxdy+2xy=x4
The left side is the derivative of a product:
dxd(x2y)=x4
x2y=∫x4dx=5x5+C
y=5x3+x2C
1=51+C⟹C=54
Particular solution: y=5x3+5x24.
Why This Works
The integrating factor μ=e∫Pdx is engineered so that multiplying through converts the left side into the derivative of a product. That step is the entire trick of linear ODEs — once the left becomes dxd(μy), integration finishes the job.
The general solution has two parts: the particular solution x3/5 that responds to the forcing x2, and the homogeneous solution C/x2 that solves dy/dx+2y/x=0. Initial conditions fix the constant C.
Alternative Method
Recognise that the homogeneous part dy/dx=−2y/x is separable: ln∣y∣=−2ln∣x∣+c, giving yh=C/x2. Then guess yp=Ax3 as a particular solution and find A=1/5 by substituting. The general solution is the sum.
Common Mistake
Students forget the absolute value in ln∣x∣ when computing ∫1/xdx. For x>0, this is harmless, but for ODEs involving x<0 the sign matters. Always note the domain.