Consider the equation, where P,Q are functions of x alone, and which has 2
fundamental solutions y1,y2:
y′′+Py′+Qy=f(x)
The general solution of the equation is:
yg=c1y1+c2y2
Now replacing c1,c2 with u(x),v(x) will give yp=uy1+vy2, which can
be found using the method of variation of parameters.
u=−∫W(x)y2fdx∧v=∫W(x)y1fdx
Proof
yp=uy1+vy2
yp′=u′y1+uy1′+v′y2+vy2′
Set u′y1+v′y2=0(1) to simplify further equations. That implies
yp′=uy1′+vy2′.
yp′′=uy1′′+u′y1′+vy2′′+v′y2
Substituting yp′′,yp′,yp to the differential equation:
yp′′+Pyp′+Qyp=u′y1′+v′y2′
This implies u′y1′+v′y2′=f(x)(2).
From equations (1) and (2), where W(x) is the wronskian of y1,y2:
u′=−W(x)y2f∧v′=W(x)y1f
u=−∫W(x)y2fdx∧v=∫W(x)y1fdx
yp can be found now using u,v,y1,y2