Physics Forums (http://www.physicsforums.com/index.php)
-   Differential Equations (http://www.physicsforums.com/forumdisplay.php?f=74)
-   -   1st order non homogenous DE problem solving (http://www.physicsforums.com/showthread.php?t=251792)

 Somefantastik Aug24-08 03:06 PM

1st order non homogenous DE problem solving

In my notes, the prof wrote x' = x + sin(t), x(0) = x0

He did not go through the solution, only wrote that the solution is

x(t,x0) = x0et + et/2 - 1/2(sin(t) + cos(t))

I verified this is correct by substituting.

So when I try to solve this DE, here's what happens:

$${\frac{dx}{dy} \ - \ x = \ sin(t)$$

integrating factor is e-t

$$\int \frac{d}{dt} \ (e^{-t}x) = \int e^{-t} \ sin(t) \ dt =>$$

$$e^{-t} \ x \ = \ \int e^{-t} \ sin(t) \ dt \ = \ -e^{-t} \ cos(t) \ - \ \int cos(t) \ e^{-t} \ dt \ = \ -e^{-t} \ cos(t) - \left( -e^{-t} \ + \int sin(t) \ e^{-t} \ dt \right)$$

...

$$x = -(1/2)cos(t) + (1/2)sin(t)$$

So I'm close, but where did I lose my e-t's ?

 Ygggdrasil Aug24-08 03:39 PM

Re: 1st order non homogenous DE problem solving

The solution to a non-homogeneous ODE is in the following form:

x = XH + Xsp

Where XH is the general solution to the corresponding homogeneous equation and Xsp is a specific solution to the given non-homogeneous ODE. You have found a specific solution, and you just need to solve the homogeneous equation dx/dt - x = 0 to obtain the XH.

 HallsofIvy Aug24-08 03:44 PM

Re: 1st order non homogenous DE problem solving

Quote:
 Quote by Somefantastik (Post 1846716) In my notes, the prof wrote x' = x + sin(t), x(0) = x0 He did not go through the solution, only wrote that the solution is x(t,x0) = x0et + et/2 - 1/2(sin(t) + cos(t)) I verified this is correct by substituting. So when I try to solve this DE, here's what happens: $${\frac{dx}{dy} \ - \ x = \ sin(t)$$ integrating factor is e-t $$\int \frac{d}{dt} \ (e^{-t}x) = \int e^{-t} \ sin(t) \ dt =>$$ $$e^{-t} \ x \ = \ \int e^{-t} \ sin(t) \ dt \ = \ -e^{-t} \ cos(t) \ - \ \int cos(t) \ e^{-t} \ dt \ = \ -e^{-t} \ cos(t) - \left( -e^{-t} \ + \int sin(t) \ e^{-t} \ dt \right)$$ ... $$x = -(1/2)cos(t) + (1/2)sin(t)$$ So I'm close, but where did I lose my e-t's ?
You have e-x on both sides of the equation and they cancel out. Specifically, you get e-tx= -(1/2)e-t(cos(t)- sin(t)) by integration, then the "e-t" on each side cancel.

 Somefantastik Aug24-08 03:53 PM

Re: 1st order non homogenous DE problem solving

I understand they cancel; my question referred to the fact that the prof's answer included e to the POSITIVE t and my answer included no e^t's at all.

 Somefantastik Aug24-08 03:58 PM

Re: 1st order non homogenous DE problem solving

Quote:
 Quote by Ygggdrasil (Post 1846744) You have found a specific solution, and you just need to solve the homogeneous equation dx/dt - x = 0 to obtain the XH.
so I would solve dx/dt - x = 0 the same way that I solved dx/dt = x + sin(t), and then I should add that result with the particular solution and that is my general solution?

 Ygggdrasil Aug24-08 03:59 PM

Re: 1st order non homogenous DE problem solving

Yes. Then you can apply your boundary conditions to get the final solution.

 Somefantastik Aug24-08 04:14 PM

Re: 1st order non homogenous DE problem solving

Ok so x' = x would have to be x = et.

That gives me x = et - 1/2(sin(t) + cos(t)). It still does not match his final solution of

x(t,x0) = x0et + (1/2)et - 1/2(sin(t) + cos(t))

Any thoughts? I bet that I am misunderstand how to apply x(0) = x0

 Somefantastik Aug24-08 04:25 PM

Re: 1st order non homogenous DE problem solving

For one thing I've been forgetting those constants from indefinite integration. I think my specific solution should look more like
$$x = -(1/2)cos(t) + (1/2)sin(t) + c(1/2) e^{t}$$

so I guess all that's left if helping me figure out how the x0et term got into the final solution:
x(t,x0) = x0et + (1/2)et - 1/2(sin(t) + cos(t))

 Ygggdrasil Aug24-08 06:07 PM

Re: 1st order non homogenous DE problem solving

You forgot the constant in the solution to the homogeneous equation:
XH = Aet

Therefore the general solution to the non-homogeneous ODE is:
x(t) = Aet + (1/2)(sin(t)-cos(t))

To find the value for A, you should use the boundary condition x(0) = x0. (You should find that A = x0 + 1/2).

Alternatively, you could carry the constant through your original solution and solve for C using the boundary condition.

 Somefantastik Aug25-08 08:28 AM

Re: 1st order non homogenous DE problem solving

Ok, I got it. Thanks for helping.

 All times are GMT -5. The time now is 01:12 PM.