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
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 :