To find the solution to a non-homogenous, find the complementary function $ {y_c} $ to the homogenous solution. Then find a particular solution to find a general solution.

The method of variation of parameters can, in principle, always be used to find a particular solution for a non-homogenous equation. 


Given the nonhomogeneous equation $ {y''+p(x)y'+q(x)y = f(x)} $, that has the complementary solution $ {c_1y_1+c_2y_2} $ the particular solution can be constructed by

$ {y_p = -y_1 \int \frac{y_2f(x)}{W(x)}dx + y2 \int \frac{y_1f(x)}{W(x)}dx} $

where $ {W(x)} $ is the Wronskian of $ {y_1, y_2} $.