Answer - No! The method you're trying is the method of undetermined coefficients. In this method we "guess" the form of . In your case since the RHS is quadratic try a general quadratic.
Question: solve: 2x^2y'' + 5xy' + y = x^2 - x
My attempt so far: y'' + (5y'/2x) + (y/x^2) = 1/2 - 1/(2x)
yh: λ^2 + (5/2)λ +1 = 0
(2λ+1)(λ+2) = 0
λ = -1/2, -2
yh= c1e^(-1/2x) + c2e^(-2x)
Try yp = Ae^(-1/2x) + Bxe^(-1/2x) + C, but e^(-1/2x) is part of yh.
yp= Axe^(-1/2x) + Bx^2e^(-1/2x) + C
is this correct so far?
Did you do what topsquark suggested? You can NOT find the solution to the homogenous solution the way you did, because it only works for constant coefficients.
You need to first make the substitution x = e^t --> t = ln(x).
So dy/dx = (dy/dt)(dt/dx) = (dy/dt)(1/x) = e^(-t)(dy/dt).
Get a similar expression for the second derivative, substitute and go from there.
so y'' = [(e^-t)(dy/dt) + (e^-t)(d^2y/dt^2)](e^-t)
y''= (e^-2t)(dy/dt) + (e^-2t)(d^2y/dt^2)
y' = e^(-t)(dy/dt)
y= ?
2e^(2t)[(e^-2t)(dy/dt) + (e^-2t)(d^2y/dt^2)] + 5e^t[e^(-t)(dy/dt)] + y = e^2t - e^t
2dy/dt + 2(d^2y/dt^2) + 5(dy/dt) + y = e^2t - e^t
how do i get rid of y?
Close. y'' = -e^{-2t}(dy/dt) + e^{-2t}(d^2y/dt^2)
I eventually get
2(d^2y/dt^2) + 3(dy/dt) + y = e^{2t} - e^t
Now you can solve the homogeneous equation. I get
yh(t) = Ae^{-t/2} + Be^{-t}
so your particular solution is going to be of the form
yp(t) = Ce^{2t} + De^t
-Dan