Finding solutions to a non homogeneous differential equation knowing the solutions of its homogenous counterpart 
Let $f(x)$ and $xf(x)$ be the particular solutions of a differential
  equation $$y''+R(x)y'+S(x)y=0$$ Find the solution of the differential
  equation $$y''+R(x)y'+S(x)y=f(x)$$ in terms of $f(x)$.

I was trying to find a solution if the form $(ax^2+bx+c)f(x)$. Now as $(bx+c)f(x)$ is a solution to the homogeneous equation, I just need to assume that $ax^2f(x)$ is a particular solution of the non homogeneous equation, and find the suitable value of $a$. But I am getting stuck. Please help.
 A: Let $y_1=f$ and $y_2=xf$ be solutions to the homogeneous equation with the Wronskian $W(y_1, y_2)=f^2\neq 0$. Let us use variation of parameters. Set $y_p=v_1y_1+v_2y_2=v_1f+v_2xf$, where $v_1=-\int\frac{y_2f}{W(y_1, y_2)}dx=-\int\frac{xf^2}{f^2}dx=-\int xdx=-(1/2)x^2$. Similarly, we can compute $v_2=\int\frac{y_1f}{W(y_1, y_2)}dx=\int\frac{f^2}{f^2}dx=x$ and hence substituting these in $y_p$, we get $y_p=(1/2)x^2f(x)$ as the particular solution to the inhomogeneous equation. You can combine with the complementary function of the homogeneous eqution to write the general solution.
A: If $y(x) = u(x) f(x)$ is a solution of the non-homogeneous DE, substituting that in should give you 
$$ u''(x) f(x) + u'(x) (2 f'(x) + R(x) f(x)) + u(x) (f''(x) + R(x) f'(x) + S(x) f(x)) = f(x) $$
From the fact that $y=f(x)$ and $y=x f(x)$ are solutions, you should get that the coefficients of $u(x)$ and $u'(x)$ are $0$.
A: Once you found two linearly independent solution of the homogeneous equation  say $y_1$ and $y_2$, the particular solution is $$ y_p= u_1y_1+u_2 y_2$$Substitute in your inhomogeneous equation and solve for $u_1$ and $u_2.$ You may study the method of varion of constant for specific examples. 
