Solve Linear ODE Using Integrating Factor

  • Thread starter 1s1
  • Start date
  • #1
1s1
20
0

Homework Statement



Solve the initial value problem:
$$sin(x)y' + ycos(x) = xsin(x), y(2)= \pi/2$$


Homework Equations





The Attempt at a Solution



Recognizing it as a Linear First-Order Equation:$$\frac{dy}{dx}+y\frac{cosx}{sinx}=x$$
$$P(x)=\frac{cosx}{sinx}$$
Integrating factor: $$e^{\int \frac{cosx}{sinx}dx}=sinx$$

Multiplying the ODE by the integrating factor:
$$\frac{d}{dx}[ysinx] = xsinx$$

Integrating both sides: $$ysinx = \int xsinx dx$$
$$y=1-\frac{xcosx}{sinx}+C$$
Solving for C: $$C=1$$
$$y=2-\frac{xcosx}{sinx}$$

Apparently this solution is incorrect, but I can't figure out why?
 

Answers and Replies

  • #2
rock.freak667
Homework Helper
6,230
31
From this line

ysinx=∫xsinxdx

you should get

ysinx = sinx - xcosx +C

then divide by sinx.
 
  • #3
1s1
20
0
Thanks! When I divided through by ##sin(x)## from the step you suggested, I had forgotten to divide ##C## by ##sin(x)##. I tend to ignore the constants which is a big mistake. Thanks for the help!
 
  • #4
epenguin
Homework Helper
Gold Member
3,825
855
maybe you have missed out some steps of what you did, it is not evident that you have worked out your integration factor or multiplied by it.

You don't need an integration factor and can go straight from line 1 to line 5.
 

Related Threads on Solve Linear ODE Using Integrating Factor

Replies
2
Views
4K
Replies
4
Views
921
Replies
10
Views
2K
Replies
5
Views
612
  • Last Post
Replies
4
Views
776
Replies
3
Views
2K
Replies
2
Views
922
Replies
14
Views
786
  • Last Post
Replies
5
Views
890
  • Last Post
Replies
1
Views
984
Top