How Can I Solve This Differential Equation Involving Trigonometric Functions?

Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
5 replies · 2K views
jasonbot
Messages
16
Reaction score
0

Homework Statement



Hi, I'm struggling with a differential equations:


y'=(1-y)cosx

Homework Equations





The Attempt at a Solution




y'=cosx-ycosx

p(x)=e^(∫-cosxdx)
=e^-sinx

y'e^-sinx=e^(-sinx)cosx-e^(-sinx)ycosx

then I get confused because of the derivative.

I thought it could be
y'e^(-sinx)=d/dx(e^(-sinx)y) but that clearly doesn't work...
 
Physics news on Phys.org
Separation of variables might be a good approach here... you can show that the solution is given by

[tex]\int \frac{1}{1 - y} \, dy = \int \cos(x) \, dx[/tex]

and both of the integrals are well calculable.
 
If you want to use an integrating factor, you need to move the y's to the same side.

[tex]y'+(\cos x)y = \cos x[/tex]

When you multiply through by the integrating factor p(x), the LHS becomes the derivative of p(x)y(x).

[tex]\mbox{LHS} = p(x)y'(x)+p'(x)y(x) = [p(x)y(x)]'[/tex]

That's where the y' term goes.
 
Gah! My bad :( I feel quite stupid now... The exercise is on integrating factors and I didn't see that O_o
Thanks vela for clearing up integrating factors for me :D

so to continue...

∫1/(1-y)dy=∫cosxdx

-ln(1-y)=sinx+c

1-y=Ae^(-sinx), A=e^c

-y=Ae^(-sinx)-1
y=-Ae^(-sinx)+1

which according to the solution is correct. Thanks guys! It's actually an IVP but I'll just leave that out since it's easy.
 
I did note that, it's just easier this way. Thanks CompuChip