I'll just try to expand on the comments.
These two equations are linear ODEs, the first one being homogeneous.
To solve the first one, guess the solution ofthe form $y = e^{ax}$ and solve for $a$. You should get two values of $a$, say $a_1$ and $a_2$, hence two solutions: $e^{a_1x}$ and $e^{a_2x}$. The theory of ODEs will tell you that for $x \in \mathbb R$, there are at most $2$ linearly independent solutions, so you know that $c_1 e^{a_1 x} + c_2 e^{a_2 x}$ is your complete solution. Well, you must know that $e^{a_1 x}$ and $e^{a_2 x}$ are linearly independent before making the last conclusion. This is always the case when $a_1 \ne a_2$ (which is true here).
To solve the second one, first solve its homogeneous version: $x^2 \frac{d^2 y}{dx^2} + 4x \frac{dy}{dx} + 2y = 0$. This can be solved by first guessing the form of solution $y = x^a$ and solving for $a$. (This is equivalent to setting $x = e^t$ in Robert's comment.) You'll get two values for $a$, say $a_1$ and $a_2$, hence two solutions $x^{a_1}$ and $x^{a_2}$. The theory of ODEs, again, tells you that for $x > 0$, $y = c_1 x^{a_1} + c_2 x^{a_2}$ is the complete solution to the homogeneous equation. To deal with the non-homogeneous term, use variation of parameters: Assume $y = u_1(x)x^{a_1} + u_2(x)x^{a_2}$. Solve the system
$ \begin{pmatrix} x^{a_1} & x^{a_2} \\ a_1 x^{a_1 - 1} & a_2 x^{a_2 - 1} \end{pmatrix} \begin{pmatrix} u_1'(x) \\ u_2'(x) \end{pmatrix} = \begin{pmatrix} 0 \\ 1/x^3 \end{pmatrix} $ for $u_1'$ and $u_2'$, then integrate to get $u_1$ and $u_2$ (keep the two constants that appear). Substitute back into $y = u_1(x)x^{a_1} + u_2(x)x^{a_2}$ to get your final answer.