Formulating a Solution for a First Order ODE with Trigonometric Functions

In summary, Dick found a solution to the homework statement as follows: y' = -y + sin(t) and y(t) = \dfrac{3}{2}e^{-t}+\dfrac{1}{2}\left({sin(t)-cos(t)}\right)
  • #1
bsodmike
82
0

Homework Statement



[tex]y' = -y + sin(t)[/tex]

Homework Equations



[tex]y' = \dfrac{dy}{dt} = f(t,y)[/tex]

The Attempt at a Solution



The solution should be, according to my textbook, as follows,
[tex]y(t)= \dfrac{3}{2}e^{-t}+\dfrac{1}{2}\left({sin(t)-cos(t)}\right)[/tex]

I have looked at the various 'typical' forms of ODEs and cannot seem to find one for this particular case. My problem here is in recognising the ODE form, even if I put it as:

[tex]\dfrac{dy}{dt}+y= sin(t)[/tex]

would I have to use something like,

[tex]y(t)=e^{-t}\left[Ae^{it}+Be^{-it}\right][/tex]

I am quite rusty with ODEs and would greatly appreciate anyone willing to walk me through this one.

This question was also posted https://www.physicsforums.com/showthread.php?t=276427", but I thought I'd shift it to the right place, especially since I am quite stuck on this one.

Thanks
Mike
 
Last edited by a moderator:
Physics news on Phys.org
  • #2
Try writing sin(t) in its exponential form...ie Sin(t)= [e^(it) - e(-it)]/2i
 
  • #3
[tex]\dfrac{dy}{dt}+y=\dfrac{1}{2i}\left(e^{it}-e^{-it}\right)[/tex]

Should I use an Integrating Factor to solve the Linear ODE?, i.e.

[tex]y'+p(t)y=q(t)[/tex]

and use an integrating factor [tex]\mu(t)=e^{\int{p(t)dt}}[/tex]

[tex]\mu(t)\left[y'+p(t)y\right]=\mu(t)q(t)[/tex]

[tex]\left(\mu(t)y\right)'=\mu(t)q(t)[/tex]

[tex]\mu(t)y=\int{\mu(t)q(t)dt+C}[/tex]

...and divide through by [tex]\mu(t)[/tex] ?

Going back to the beginning,
[tex]\dfrac{dy}{dt}+y=sin(t)[/tex]

In this case, [tex]p(t)=1[/tex] and [tex]q(t)=sin(t)[/tex],

Therefore, [tex]\mu(t)=e^t[/tex]

and,

[tex]e^ty=\int{e^tsin^tdt+C}[/tex] would be the solution? [tex]sin(t)[/tex] can be further substituted with it's exponential form if needed?
 
Last edited:
  • #4
That's one way to do it. The other way is to solve the homogeneous problem dy/dt+y=0 and note that the solutions are C*exp(-t). You now want a solution to the inhomogeneous problem (a particular solution). Substitute a trial solution of A(t)*exp(-t) into the ODE and integrate the result to find A(t). This is called variation of parameters. But you'll get an expression much like the one you've already got. You are actually almost done. Now you just have to integrate e^t*sin(t).
 
  • #5
Dick said:
You are actually almost done. Now you just have to integrate e^t*sin(t).

Thanks Dick :) I take it this would be a simple matter of integration by parts, i.e.
[tex]\int{u}\,dv=uv-\int{v}\,du[/tex]

I seem to be getting a run away expansion going on here:
[tex]\int{e^tsin(t)\,dt}=\int{f(t)g(t)dt}[/tex]

Let,
[tex]\begin{cases} u=g(t) = sin(t)\\
dv=f(x)\,dx=e^t
\end{cases}[/tex]

Hence,
[tex]\begin{cases} du=g'(t) = cos(t)\\
v=\int{f(x)\,dx}=e^t
\end{cases}[/tex]

Therefore,
[tex]\int{e^tsin(t)\,dt}=e^tsin(t)-\int{e^tcos(t)\,dt} + C[/tex]

The second integral goes onto become,
[tex]\int{e^tcos(t)\,dt}=e^tcos(t)+\int{e^tsin(t)\,dt} + C[/tex]

Any ideas?
 
Last edited:
  • #6
Sure! Substitute the second expression for the integral of e^t*cos(t) into the first. Now you have two integrals of e^t*sin(t). Move them to the same side of the equation and solve.
 
  • #7
Dick said:
Move them to the same side of the equation and solve.

bsodmike said:
How come the [tex]\dfrac{3}{2}e^{-t}[/tex] is missing?!? Constant of integration or some initial values?

Thanks a lot Dick for all your help, this has been bugging me quite a bit :p (I hate giving up...)

This is the second integral (as obtained previously),
[tex]\int{e^tcos(t)\,dt}=e^tcos(t)+\int{e^tsin(t)\,dt} + C[/tex]

Substitute it into the first integral obtained by the integration by parts, for
[tex]\int{e^tsin(t)\,dt}=e^tsin(t)-\left[e^tcos(t)+\int{e^tsin(t)\,dt} + C\right] + C[/tex]

Further simplification yields,
[tex]\int{e^tsin(t)\,dt}=\dfrac{1}{2}e^t\left(sin(t)-cos(t)\right)+C[/tex]

Substituting back, gives,
[tex]e^ty=\dfrac{1}{2}e^t\left(sin(t)-cos(t)\right)+C[/tex]

[tex]y=\dfrac{1}{2}\left(sin(t)-cos(t)\right)+\dfrac{C}{e^t}=\dfrac{1}{2}\left(sin(t)-cos(t)\right)+Ce^{-t}[/tex]
 
Last edited:
  • #8
The correct general solution is y(t)=(1/2)*(sin(t)-cos(t))+C*e^(-t). That's what happens to the C in your solution. If they gave an answer where C=(3/2) then they must have given you an initial value.
 
  • #9
Dick, I just figured it out! Am updating my tex solutions to include Ce^(-t)...thanks!
 
  • #10
[tex]y=\dfrac{1}{2}\left(sin(t)-cos(t)\right)+Ce^{-t}[/tex]

The initial value is y(0) = 1, therefore,

[tex]1=\dfrac{1}{2}\left(0-1\right)+C\cdot1[/tex]

[tex]C=1+\dfrac{1}{2}=\dfrac{3}{2}[/tex]

Hence, we finally arrive at the solution,
[tex]y=\dfrac{3}{2}e^{-t}+\dfrac{1}{2}\left(sin(t)-cos(t)\right)[/tex]
 
  • #11
Well done.
 
  • #12
Thanks a lot Dick. I have completed my Masters (technically), although I was ill for about two months as I contracted an inner ear infection. Short version: I was granted a replacement exam for one that was missed in January ~ Adv. Numerical Methods.

This question was really good practice for 'remembering' to solve ODEs analytically rather than completely being 'spoilt' by MATLAB/SIMULINK.

All the best,
Mike
 
  • #13
Good luck. I think you'll have it. You are actually pretty good at this stuff.
 

FAQ: Formulating a Solution for a First Order ODE with Trigonometric Functions

What is a First Order ODE?

A First Order ODE (Ordinary Differential Equation) is a mathematical equation that relates the values of an unknown function to its derivatives. It involves only one independent variable and its derivatives up to the first order.

What is the difference between a First Order ODE and a Second Order ODE?

The main difference between a First Order ODE and a Second Order ODE is that a First Order ODE involves only one derivative of the unknown function, while a Second Order ODE involves two derivatives. This means that a First Order ODE can be solved using only one initial condition, while a Second Order ODE requires two initial conditions.

How do you solve a First Order ODE?

First Order ODEs can be solved using various methods, such as separation of variables, substitution, or integrating factors. The specific method used depends on the form of the equation. In general, the solution involves finding an integrating factor and then integrating both sides of the equation to obtain the solution.

What is the importance of First Order ODEs in science?

First Order ODEs are important in science as they are used to model many physical phenomena, such as population growth, chemical reactions, and electrical circuits. They also serve as building blocks for more complex differential equations used to describe more complex systems.

Can First Order ODEs have multiple solutions?

Yes, First Order ODEs can have multiple solutions. This is because the solution to a First Order ODE usually involves an arbitrary constant, which can take on different values and result in different solutions. The number of solutions depends on the number of initial conditions given.

Similar threads

Back
Top