The key point point about these differential equations is that the coefficient of each derivative of order $n$ is $x^n$. I know that the second order ODE the you wrote is named Euler differential equation. You can use the special property I mentioned to find the general solution of the corresponding homogeneous ODE namely ${y_h}$ and then find a particular solution ${y_p}$ for the non-homogeneous ODE. Finally, summing the two solutions ${y_h} + {y_p}$ will give you the general solution of the ODE. I will work out the first example, leaving the second for you. we have
$${x^2}y'' - xy' - 3y = x$$
fist consider the corresponding homogeneous ODE
$${x^2}y'' - xy' - 3y = 0$$
Now we guess that $y(x) = {x^r}$ can be a solution. This is motivated by the special property of this ODE that was pointed out. Now put it into the homogeneous ODE to get
$$\left( {{r^2} - r - 3} \right){x^r} = 0$$
so $x^r$ can be a solution if and only if
$${r^2} - r - 3 = 0\,\,\,\,\,\, \to \,\,\,\,\,\,\,{r_{1,2}} = {{1 \pm \sqrt {13} } \over 2}$$
so we have
$${y_h} = {c_1}{x^{{r_1}}} + {c_2}{x^{{r_2}}}$$
for finding a particular solution since the RHS is a polynomial we consider
$${y_p} = Ax + B$$
putting into the non-homogeneous ODE leads to
$$0 - Ax - 3\left( {Ax + B} \right) = - 4Ax - 3B = x\,\,\,\,\,\,\, \to \,\,\,\,\,\,\left\{ \matrix{
- 4A = 1 \hfill \cr
- 3B = 0 \hfill \cr} \right.\,\,\,\,\, \to \,\,\,\,\,\,\left\{ \matrix{
A = - {1 \over 4} \hfill \cr
B = 0 \hfill \cr} \right.$$
and hence
$${y_p} = - {1 \over 4}x$$
and the general solution of the whole problem will be
$$y = {y_h} + {y_p} = {c_1}{x^{{r_1}}} + {c_2}{x^{{r_2}}} - {1 \over 4}x$$