Given ODE is: $$y''+Py'+Qy=0$$ It has two solutions $f(x)$ and $xf(x)$.
I need to find the solution to the following non-homogeneous ODE: $$y''+Py'+Qy=f(x)$$ where $f(x)$ on the RHS is the solution of the first ODE.
I need to find its solution. I tried to apply variation of parameters method, but failed to proceed and also found this question similar. But being a beginner who's self-learning ODE, I am stuck. An elaboration of its solution would really help me to understand the working of such questions.
EDIT I reconsidered the variation of parameter method and seemed to find a legit solution! $$y=f(x)\left(\int \frac{-xf(x).f(x) dx}{f(x)^2} +c_1\right) + xf(x)\left( \int \frac{f(x). f(x) dx}{f(x)^2} +c_2\right)$$ P.S. The denominator is the wronskian of $f(x)$ and $xf(x)$ which gives $f(x)^2$
On solving, it gives: $$y=f(x) \cdot \left(\frac {x^2}{2}+c_2 x+ c_1\right)$$ Thanks for the valuable comment!