Cauchy-Euler ODE How can I resolve this ODE :
$$x^2 \frac{d^2y}{dx} + 3x \frac{dy}{dx} + 2y = x$$

I tried by substituting $x \to e^t$ without results.
Do you have any idea? 
 A: Elaborating on my comment, start by trying to solve the homogeneous equation. Try $y=x^r$, $y'=rx^{r-1}$, $y'' = r(r-1)x^{r-2}$.
Plug these in and we get:
$$x^2r(r-1)x^{r-2} + 3xrx^{r-1}+2x^r = 0$$
This yields
$$r^2x^r-rx^r+3rx^r+2x^r = (r^2+2r+2)x^r = 0$$
We are trying to solve this for $x > 0$, so it must be true that $r^2+2r+2 = 0$. This will give you two (complex values) for $r$, which give rise to 2 distinct solutions $y_1$, $y_2$, and the homogeneous solution will be of the form $y_h = C_1 y_1 + C_2 y_2$.
See if you can take it from here on the homogeneous equation. (I can give more hints if needed).
For the particular solution, try something of the form $y_p = Ax+B$, $y_p' = A$, $y_p''=0$. Plugging this in yields:
$$x^2*0 + 3*A + 2*(Ax+B) = 2Ax + (3A+2B) = x$$
Two polynomials are equal if and only if their coefficients are equal. See if you can take it from here.
To finish the problem, the general solution is $y = y_h + y_p$.

The substitution $y = e^{rt}$ is great for finding the homogeneous solution to constant-coefficient linear ODE's, but doesn't work in this case, because the coefficients aren't constant. This equation is of a type called Cauchy-Euler, and its homogeneous solution is found by trying solutions of the form $y = x^r$. 
An alternative approach (which converts a homogeneous Cauchy-Euler equation to a constant-coefficient homogeneous equation) is to try to find solutions of the form $y = e^{r\ln(x)}$.

One more clarification on the homogeneous equation we are looking at, and why we can't just try $y = e^{rx}$. When you differentiate $y = e^{rx}$, an $r$ comes out front, but the function $e^{rx}$ doesn't change. The only way to solve an equation of the form $x^2y'' + axy' + by = 0$ is to try a test function that drops a power of $x$ with each time differentiating it. The functions we know of that do this are functions of the form $y=x^r$, or functions of the form $y = x^{a}\cos(b\ln(x))$, $y=x^a\sin(b\ln(x))$. These functions all have the required property, and while it may seem we need to try all 3 possibilities separately, by the derivation below, it suffices to try solutions of the form $y = x^r$ for Cauchy-Euler equations.

Clarification in response to the comment:
It won't be quite as nice as $y_h = c_1\cos(x) + c_2\sin(x)$. First, what are the two roots? Well, we have $r^2+2r+2=(r+1)^2+1$, and so we have two roots, $r_1 = -1+i$ and $r_2 = -1-i$. Now use the fact that $x^r = e^{r\ln(x)}$, and use Euler's Formula:
$$e^{i\alpha} = \cos(\alpha) + i\sin(\alpha)$$
We see that:
\begin{align}
c_1y_1 + c_2y_2 &= c_1 x^{-1+i} + c_2 x^{-1-i}\\
&= c_1 e^{(-1+i)\ln(x)} + c_2e^{(-1-i)\ln(x)}\\
&= c_1 e^{-\ln(x)}e^{i\ln(x)} + c_2 e^{-\ln(x)}e^{-i\ln(x)}\\
&= c_1 x^{-1}\left(\cos(\ln(x)) + i\sin(\ln(x)\right)+c_2 x^{-1}\left(\cos(\ln(x)) - i\sin(\ln(x)\right)\\
&= (c_1+c_2)x^{-1}\cos(\ln(x)) + i(c_1-c_2)x^{-1}\sin(\ln(x))
\end{align}
Our equation requires us to have only real functions as solutions (the $i$ means we no longer have a real solution here). But one thing we can do is notice that in order for this function to be a solution, both the real part (without the $i$) and the imaginary part (with the $i$) must be solutions, hence we have:
$$y_1 = x^{-1}\cos(\ln(x)),\quad y_2 = x^{-1}\sin(\ln(x))$$
And with these worked out, we now have our homogeneous solution $$y_h = C_1 y_1 + C_2 y_2$$
A: This is Euler's differential equation, and the substitution that makes it fly is $x=e^u$. Then $u=\ln x$ and
$$\frac{dy}{dx}=\frac{dy}{du}\frac{du}{dx}=\frac1x\frac{dy}{du}$$
$$\frac{d^2y}{dx^2}=-\frac1{x^2}\frac{dy}{du}+\frac1{x^2}\frac{d^2y}{du^2}$$
Substituting into the original differential equation,
$$\frac{d^2y}{du^2}+2\frac{dy}{du}+2y=e^u$$
Start with the homogeneous equation
$$\frac{d^2y_h}{du^2}+2\frac{dy_h}{du}+2y_h=0$$
Trial function is $e^{ru}$. This leads to the characteristic equation
$$r^2+2r+2=(r+1)^2+1^2=0$$
So $r=-1\pm i$ which means our homogeneous equation has the general solution
$$y_h=c_1e^u\cos u+c_2e^2\sin u$$
Since the nonautonomous part is not a solution to the homogeneous equation, we try a particular solution
$$y_p=Ae^u$$
Substituting into the transformed differential equation, we find that $5A=1$, so our general solution is
$$y=\frac15e^u+c_1e^u\cos u+c_2e^2\sin u=\frac15x+c_1x\cos\ln x+c_2x\sin\ln x$$
