For the corresponding homogeneous equation,
![x^2y''+xy'+y=0](https://img.qammunity.org/2020/formulas/mathematics/college/bfll6e8xg592sr05v7rjx2rzlvjm7diezb.png)
we can look for a solution of the form
, with derivatives
and
. Substituting these into the ODE gives
![m(m-1)x^m+mx^m+x^m=0\implies m^2+1=0\implies m=\pm i](https://img.qammunity.org/2020/formulas/mathematics/college/madgi3iyykq7rheln6j30kyo9k9b3jcthb.png)
which admits two solutions,
and
, which we can write as
![x^i=e^(\ln x^i)=e^(i\ln x)=\cos(\ln x)+i\sin(\ln x)](https://img.qammunity.org/2020/formulas/mathematics/college/8qm8dalymdo41jisrba5l7yrcokygomvnb.png)
and by the same token,
![x^(-i)=\cos(\ln x)-i\sin(\ln x)](https://img.qammunity.org/2020/formulas/mathematics/college/vh90k20ujeyvllxso054bsi3wmxvwuuwfv.png)
so we see two independent solutions that make up the characteristic solution,
![y_c=C_1\cos(\ln x)+C_2\sin(\ln x)](https://img.qammunity.org/2020/formulas/mathematics/college/gv74wwzu4xiqrmueq3xew5xjdh0s8c1rj9.png)
For the non-homogeneous ODE, we make the substitution
![x=e^t\iff t=\ln x](https://img.qammunity.org/2020/formulas/mathematics/college/dni0unwub6opqwqluh0chovukso4718tof.png)
so that by the chain rule, the first derivative becomes
![(\mathrm dy)/(\mathrm dx)=(\mathrm dy)/(\mathrm dt)(\mathrm dt)/(\mathrm dx)=(\mathrm dy)/(\mathrm dt)\frac1x](https://img.qammunity.org/2020/formulas/mathematics/college/2nfyll6kmj4mskm4baqva3snp7fydcbclz.png)
![(\mathrm dy)/(\mathrm dx)=e^(-t)(\mathrm dy)/(\mathrm dt)](https://img.qammunity.org/2020/formulas/mathematics/college/bx6xcfy7nwp5mitmb1844x787dby6j35lm.png)
Let
. Then the second derivative becomes
![(\mathrm d^2y)/(\mathrm dx^2)=(\mathrm df)/(\mathrm dx)=(\mathrm df)/(\mathrm dt)(\mathrm dt)/(\mathrm dx)=\left(-e^(-t)(\mathrm dy)/(\mathrm dt)+e^(-t)(\mathrm d^2y)/(\mathrm dt^2)\right)\frac1x](https://img.qammunity.org/2020/formulas/mathematics/college/pkb2fgwegwbbr0xh38wc3zvez024f7cu88.png)
![(\mathrm d^2y)/(\mathrm dx^2)=e^(-2t)\left((\mathrm d^2y)/(\mathrm dt^2)-(\mathrm dy)/(\mathrm dt)\right)](https://img.qammunity.org/2020/formulas/mathematics/college/r0il064fvdrurxprmjeza3w3n61zi1pxjb.png)
Substituting these into the ODE gives
![e^(2t)\left(e^(-2t)\left((\mathrm d^2y)/(\mathrm dt^2)-(\mathrm dy)/(\mathrm dt)\right)\right)+e^t\left(e^(-t)(\mathrm dy)/(\mathrm dt)\right)+y=t^2+2e^t](https://img.qammunity.org/2020/formulas/mathematics/college/e1lhfw27c099csruo34ftoel2cy67op708.png)
![y''+y=t^2+2e^t](https://img.qammunity.org/2020/formulas/mathematics/college/20ylop47tjrcusnawas0epi481t4qc597l.png)
Look for a particular solution
, which has second derivative
. Substituting these into the ODE gives
![(2a_2+be^t)+(a_0+a_1t+a_2t^2+be^t)=t^2+2e^t](https://img.qammunity.org/2020/formulas/mathematics/college/i6voavmsqzxv565idcat088r79rj5n1x66.png)
![(2a_2+a_0)+a_1t+a_2t^2+2be^t=t^2+2e^t](https://img.qammunity.org/2020/formulas/mathematics/college/id2tzmt8phn2c5c51mtnf43s80a1yjhzwx.png)
![\implies a_0=-2,a_1=0,a_2=1,b=1](https://img.qammunity.org/2020/formulas/mathematics/college/vzm85ka74mj9lrwddhx3f2j81loqhz6fhk.png)
so that the particular solution is
![y_p=t^2-2+e^t](https://img.qammunity.org/2020/formulas/mathematics/college/5hwswmdaulfu7qyibomqsk0665efzpmkqz.png)
Solving in terms of
gives the solution
![y_p=(\ln x)^2-2+x](https://img.qammunity.org/2020/formulas/mathematics/college/207cmo9cdeu5wqkmkgcz283mkek54rx90j.png)
and the overall general solution is
![y=y_c+y_p](https://img.qammunity.org/2020/formulas/mathematics/high-school/kuedg8vb7zumkda863frqw6b6ln58spulk.png)
![\boxed{y=C_1\cos(\ln x)+C_2\sin(\ln x)+(\ln x)^2-2+x}](https://img.qammunity.org/2020/formulas/mathematics/college/g007919eitoebf6biyjwfp2a3erk6zdpok.png)