Victor B. answered 12/04/21
PhD candidate in Mathematics with 10+ years of teaching experience
First, solve the homogenous equation y'' -2y' + 5y = 0, which has constant coefficients, so finding its solutions reduces to finding the roots of the quadratic polynomial r2-2r+5=0. Using the quadratic formula we get roots 1±2i, so the homogeneous solution is: yh= C1ex cos(2x) + C2ex sin(2x).
Now, to find a particular solution, we can use the method of undetermined coefficients. That is, we seek one of the form yp= Ax2+ Bx + C, because the right-hand-side of the equation is quadratic (and also the homogeneous solution does not have this form). The derivatives of yp are
yp' = 2Ax + B, and yp'' = 2A. Plug them into the original equation and get:
2A -2(2Ax + B) +5(Ax2+ Bx + C) = x2+1, or equivalently
5A x2 + (-4A + 5B)x + 2A - 2B + 5C = x2+1
Equating the coefficients we get equations
5A = 1 → A = 1/5
-4A + 5B = 0 → B = 4A/5 = 4/25
2A - 2B + 5C = 1 → C = (1-2A + 2B)/5 = (1-2/5 + 8/25)/5 = 23/125
so yp = x2/5 + 4x/25 + 23/125
Altogether, the general solution is y = C1ex cos(2x) + C2ex sin(2x) + x2/5 + 4x/25 + 23/125