Differential equation.. Y "+ y = cosx for general solution

Differential equation.. Y "+ y = cosx for general solution


The characteristic equation λ ^ 2 + 1 = 0 is solved to λ = I or λ = - I. We can see that the general solution of the corresponding homogeneous linear differential equation is y = C1 cosx + C2 SiNx. The function f (x) = cosx at the right end belongs to type II, and I is a multiple root of the characteristic equation. Let y * = x (acosx + bsinx) be substituted into the non-homogeneous equation



General solution of differential equation y "+ y = e ^ x + cosx


y=A*cosx+B*sinx+0.5e^x+0.5x*sinx



The general solution of the differential equation y '' + y '= e of X degree + cosx,


It is easy to get the general solution of homogeneous equation as
C1e^(-x)+C2
Another special solution
Let y = AE ^ x + bcosx + csinx
y'=Ae^x-Bsinx+Ccosx
y''=Ae^x-Bcosx-Csinx
Substituting into the original equation
y''+y'=2Ae^x+(C-B)cosx-(B+C)sinx=e^x+cosx
Contrast coefficient
A=1/2,B=-1/2,C=1/2
In conclusion, the general solution of the equation is obtained
y=C1e^(-x)+C2+e^x/2-cosx/2+sinx/2