The corresponding homogeneous differential equation is
y′′+y=0Characteristic (auxiliary) equation
r2+1=0r=±iThe general solution of the homogeneous differential equation is
yh=c1cosx+c2sinxy′=c1′cosx−c1sinx+c2′sinx+c2cosxIf
c1′cosx+c2′sinx=0,then
y′′=−c1′sinx−c1cosx+c2′cosx−c2sinxSubstitute
−c1′sinx−c1cosx+c2′cosx−c2sinx+c1cosx+c2sinx=cosx1We have
c1′cosx+c2′sinx=0,−c1′sinx+c2′cosx=cosx1
c1′=−cosxsinxc2′cosxsin2xc2′+c2′cosx=cosx1
c1′=−cosxsinxc2′=1Integrate
c1=−∫cosxsinxdx=ln(∣cosx∣)+C1c2=∫dx=x+C2The general solution of the non-homogeneous differential equation is
yh=ln(∣cosx∣)cosx+xsinx+C1cosx+C2sinx
Comments