How to find general solution of a nonhomogeneous linear differential equation given a solution to the homogeneous equation The function $y_1 = x^2$ is a solution of 
$x^2y'' − 3xy' + 4y = 0$.
Find the general solution of the nonhomogeneous linear differential equation
$x^2y'' − 3xy' + 4y = x^2$
I know the equation $x^2y'' − 3xy' + 4y = 0$ is a Euler-Cauchy equation but I'm not sure how to proceed with this question; any help is appreciated
 A: General way :
Working over the homogeneous equation :
$$x^2y'' − 3xy' + 4y = 0$$
Since this is an Euler-Cauchy equation, assume that a solution will be proportional to $x^\lambda$ for some constant $\lambda$. Thus, this means that :
$$x^2 \cdot (x^\lambda)'' - 3x \cdot (x^\lambda)' + 4x^\lambda = 0 \implies (\lambda -2)^2 = 0 \Rightarrow \lambda =2$$
Take note that the root $\lambda = 2$ is of multiplicity $2$, thus the general solution is :
$$y_c(x) = c_1x^2 +  c_2x^2\ln(x)$$
Given the fact that $y_1(x) = x^2$ is a solution to this problem from the beginning, you can simply note that $y_2(x) = x^2\ln(x)$ is also a solution and thus the basis solutions in $y_c(x)$ are $y_1$ and $y_2$.
To finally yield the solution for the non-homogeneous equation, calculate the Wronskian of $y_1$ and $y_2$ :
$$\mathcal{W}(x) = \begin{vmatrix} x^2 & x^2\ln(x) \\ 2x &  x + 2x\ln(x) \end{vmatrix} = x^3 $$
Divide the equation by the leading term's coefficient $x^2$ :
$$y'' - \frac{3y'}{x} + \frac{4y}{x^2} = 1$$
Let $f(x)=1$ and $v_1(x), v_2(x)$ such that :
$$v_1(x) =  - \int \frac{f(x)y_2(x)}{\mathcal{W}(x)}\mathrm{d}x, \quad v_2(x) = \int \frac{f(x)y_1(x)}{\mathcal{W}(x)}\mathrm{d}x$$
Then, the particular solution will be :
$$y_p(x) = v_1(x)y_1(x) + v_2(x)y_2(x) $$
and finally the general solution :
$$y(x) = y_c(x) + y_p(x)$$
I will leave the final calculations up to you.
You should come to the result : 
$$\boxed{y(x) = c_1x^2 + c_2x^2\ln(x) + \frac{1}{2}x^2\ln^2(x)}$$
For some better feeling over the solution, I'll add some graphs that sample initial values for $y(1)$ and a general sample plot :


A: $x^2$ is a known solution to the homogeneous equation
Let's consider $y_p=x^2v$ as a general solution to the original equation. Then
$$
y_p=x^2v \implies 
\begin{cases}
y'_p=2xv+x^2v' \\
y_p''=2v+4xv'+x^2v''
\end{cases}
$$
The equation becomes
$$x^2v''+xv'=1 \implies xv''+v'=\frac 1x$$
$$(xv')'=\frac 1x \implies xv'=\ln|x|+K_1$$
$$v'=\frac {\ln|x|}x+\frac {K_1}x$$
Therefore after integration we have that
$$v=K_1\ln|x|+K_2+\frac 12 {\ln^2|x|}$$
And since $y_p=x^2v$
$$\boxed{y_p(x)=x^{2}\frac {\ln^2|x|}2+K_1x^{2}\ln|x|+K_2x^2}$$
