How to find exact solution of y′+y=x+cosx?
I am doing Euler method but could not find a method to find exact solution of above problem? Please explain with steps it is first order differential equation. Please note that I have find y using Euler method.
Solution.
Using the Euler method, we could not find an exact solution. We find the solution with some error.
Use an integrating factor for solving our ODE. We have ODE in the form
y′+P(x)⋅y=Q(x)
and the integrating factor
μ(x)=exp(∫0xP(x′)dx′)
Solve our linear equation
y′+y=x+cosx
Let
μ(x)=exp(∫0x1⋅dx)=ex
Multiply both sides by μ(x):
exy′+(ex)′y=−(ex(−x−cosx))
Apply the product rule gf′+fg′=(fg)′ to the left-hand side:
(exy)′=−(ex(−x−cosx))
Integrate both sides with respect to x:
∫dxd(exy)dx=∫[−(ex(−x−cosx))]dx
Evaluate the integrals:
exy(x)=21ex(2x+cosx+sinx−2)+C,
where C is an arbitrary constant.
Divide both sides by μ(x)=ex:
y(x)=21(2x+cosx+sinx+ex2C−2)
Answer:
y(x)=x+2cosx+2sinx+exC−1
Comments