# Separation of variables

• January 11th 2008, 06:14 AM
olip
Separation of variables
Hi,

Need to solve the following equation, but i can't seem to separate the variables correctly so i can integrate through.

dx/dt = t - x

cheers

Oli
• January 11th 2008, 06:19 AM
colby2152
Quote:

Originally Posted by olip
Hi,

Need to solve the following equation, but i can't seem to separate the variables correctly so i can integrate through.

dx/dt = t - x

cheers

Oli

This is a non-homogeneous differential equation.

$x'+x-t=0$

You have to guess an initial solution for $x$. Check this out: Method of undetermined coefficients - Wikipedia, the free encyclopedia
• January 11th 2008, 06:33 AM
Krizalid
Quote:

Originally Posted by olip
dx/dt = t - x

As colby2152 wrote $x'+x=t,$ multiply by $e^t,$

$x' + x = t \implies e^t x' + e^t x = te^t \,\therefore \,\left( {xe^t } \right)' = te^t .$

By integrating both sides

$xe^t = \int {te^t \,dt},$ where the last integral is fairly straightforward via integration by parts.
• January 11th 2008, 06:25 PM
mr fantastic
Quote:

Originally Posted by olip
Hi,

Need to solve the following equation, but i can't seem to separate the variables correctly so i can integrate through.

dx/dt = t - x

cheers

Oli

dx/dt = t - x

=> dx/dt + x = t

is solved using the integrating factor method (as has been implied by Krizalid).
• January 12th 2008, 06:16 AM
olip
Hi,

thanks for all help so far, that working makes sense to me Krizalid, but on integrating $\int {te^t \,dt}$ i get $e^t(t-1)$ i.e. $xe^t = e^t(t-1)$, or $x = t-1$, which doesnt seem right to me.

I should give more information. This was just part of some dynamics book and i couldn't figure out how they got the solution. Their solution was

$x(t) = t-1 + exp(-t) (x_0 + 1)$

where $x_0$ is the solution at t=0

thanks again,

Oli
• January 12th 2008, 01:47 PM
olip
Hi again,

realised i made a lazy mistake there, forgot to add in the constant of integration, so the solution actually becomes $t-1 + Cexp(-t)$

When i substitute this back in to the original equation $x' + x = t$ it works, which is good, however it is different than the solution given in the book:
$t-1 + exp(-t)(C + 1)$ which doesn't give the right answer when substituted back into the equation. Is the one in the book wrong?? I am confused!

cheers,

Oli
• January 12th 2008, 06:09 PM
mr fantastic
Quote:

Originally Posted by olip
[snip]
the solution actually becomes $t-1 + Cexp(-t)$
[snip]
however it is different than the solution given in the book:
$t-1 + exp(-t)(C + 1)$ which doesn't give the right answer when substituted back into the equation. Is the one in the book wrong?? I am confused!

cheers,

Oli

The books solution does give the correct answer and is in fact equivalent to your solution. Since C is an arbitrary constant, C + 1 is also arbitrary ..... Re=brand C + 1 as K ...... $x = t-1 + K exp(-t)$.