Solving a differential equation

  • Thread starter hardatwork
  • Start date
  • #1

Homework Statement


Find the particular solution of the differential equation
[tex]\frac{dy}{dx}[/tex]+ycos(x)=3cos(x)


Homework Equations



y(0)=5

The Attempt at a Solution


[tex]\frac{dy}{dx}[/tex]=3cos(x)-ycos(x)
[tex]\frac{dy}{dx}[/tex]=(cos(x))(3-y)
[tex]\int \frac{dy}{3-y}[/tex]=[tex]\int cos(x) dx[/tex]
-ln|3-y|=sin(x)+C
ln|3-y|=-sin(x)-C

to find C, I did
ln|3-5|=-sin(0)-C
ln|-2|=-C
C=-ln|2|
So the equation is
3-y=e(-sin(x)+ln|2|)
-y=e(-sin(x)+ln|2|)-3
y=-e(-sin(x)+ln|2|)+3
But this is incorrect. I'm not sure if my setup is right or if I made a mistake. I would greatly appreciate if someone could see were I went wrong.
 

Answers and Replies

  • #2
1,015
70
Your steps and your solution have no flaws. However, you can simplify your solution further. Also, it is not necessary to continue using the absolute value signs when the argument is positive.
 
  • #3
How would I simplify futher?
 
  • #4
1,015
70
How would I simplify futher?

Remember that [itex]a^{b+c} = a^ba^c[/itex] and that the exponential function is the inverse function of the natural logarithm.
 
  • #5
Oh! Okay that makes. Thank You so much!
 

Related Threads on Solving a differential equation

  • Last Post
Replies
2
Views
527
  • Last Post
Replies
1
Views
887
  • Last Post
Replies
1
Views
626
  • Last Post
Replies
4
Views
2K
  • Last Post
Replies
3
Views
819
  • Last Post
Replies
9
Views
769
  • Last Post
Replies
7
Views
1K
  • Last Post
Replies
9
Views
1K
  • Last Post
Replies
3
Views
2K
Replies
5
Views
1K
Top