I have the following differential equation to solve:
$$x^2y''-2y=x^3e^x$$
I've identified the homogeneous equation as an Euler-Cauchy equation, and I've managed to obtain the complementary solution, being:
$$y_c=c_1\frac{1}{x}+c_2x^2$$
But I have no idea how to obtain the particular solution. How can I do it?
Best Answer
Let me change your notation and put $y_h(x)$ as the solution you have obtained. Then:
$$y(x) = c_1 y_1(x) + c_2 y_2(x) + y_p(x),$$
where $y_p(x)$ is the particular solution of your ode. Then make use of variation of parameters and try solutions $y(x) = C(x) y_1(x)$ (for example; you could have chosen $y = C y_2$). Substitute back in the ode and you will have:
$$x^2 (C''y_1 + 2 C' y_1' + C y_1'') - 2 C y_1 = C'' x^2 + C'(2y_1' x^2/y_1) + C(x^2 y''_1 - 2 y_1) =x^3 e^x,$$
the coefficient in $C$ must vanish since $y_1$ is a solution of the homogenous part of the equation. Simplify a bit and obtain a "false" second order differential equation for $C(x)$:
$$ C'' + C' 2y'_1/y_1 = x e^x/y_1,$$
which can be solved in terms of an integrating factor, $u = e^{\int 2y'_1/y_1 \,dx} = y_1^2$, as follows:
$$\frac{d}{dx}\left( C' u\right) = u x e^x/y_1 = y_1 x e^x \Leftrightarrow C' = \frac{1}{y_1^2} \int y_1 x e^x \, dx + \frac{A}{y_1^2},$$
and hence the solution for $C$:
$$C = B + A \int\frac{dx}{y_1^2} + \int\left(\frac{1}{y_1^2} \int y_1 x e^x \, dx\right) \, dx,$$
where $A$ and $B$ are constants of integration. This readily leads you to the solution, $y(x) = C(x) y_1$:
$$y(x) =\frac{A x^2}{3}+\frac{B}{x}+\frac{2 e^x}{x}+e^x( x -2 ),$$
where you can make $c_1 = \frac{A}{3}$ (and $c_2 = B$).
I hope this may be useful to you.
Cheers!