# Having problems with a linear 1st order ODE

• Jun 14th 2011, 01:12 PM
Lancet
Having problems with a linear 1st order ODE
I've got a linear 1st order ODE, which I'm trying to solve via integrating factors:

$\displaystyle \frac{dy}{dx} = 3 - 6x + y - 2xy$

$\displaystyle y = -3 + ce^{x^2 - x}$

So, from here, this is what I start out with:

$\displaystyle \frac{dy}{dx} + y(-1 + 2x) = 3 - 6x$

$\displaystyle P(t) = 2x -1$

$\displaystyle U = e^{\int 2x - 1 dx} = e^{x^2 - x}$

$\displaystyle \int \frac{d}{dx}[ye^{x^2 - x}] = \int 3e^{x^2 - x} - 6xe^{x^2 - x} dx$

But working from here would seem to require integrating $\displaystyle e^{x^2 - x}$, which I didn't think was trivially doable.

Where am I going wrong?
• Jun 14th 2011, 01:46 PM
Also sprach Zarathustra
Re: Having problems with a linear 1st order ODE
Quote:

Originally Posted by Lancet
I've got a linear 1st order ODE, which I'm trying to solve via integrating factors:

$\displaystyle \frac{dy}{dx} = 3 - 6x + y - 2xy$

$\displaystyle y = -3 + ce^{x^2 - x}$

So, from here, this is what I start out with:

$\displaystyle \frac{dy}{dx} + y(-1 + 2x) = 3 - 6x$

$\displaystyle P(t) = 2x -1$

$\displaystyle U = e^{\int 2x - 1 dx} = e^{x^2 - x}$

$\displaystyle \int \frac{d}{dx}[ye^{x^2 - x}] = \int 3e^{x^2 - x} - 6xe^{x^2 - x} dx$

But working from here would seem to require integrating $\displaystyle e^{x^2 - x}$, which I didn't think was trivially doable.

Where am I going wrong?

Put x=x'+2, dx=dx' in the ODE.

Edit: will not work!
• Jun 14th 2011, 01:54 PM
Lancet
Re: Having problems with a linear 1st order ODE
Quote:

Originally Posted by Also sprach Zarathustra
Put x=x'+2, dx=dx' in the ODE.

I don't understand. I also don't get why this can be done...

Can you clarify, please?
• Jun 14th 2011, 02:48 PM
Jester
Re: Having problems with a linear 1st order ODE
Quote:

Originally Posted by Lancet
I've got a linear 1st order ODE, which I'm trying to solve via integrating factors:

$\displaystyle \frac{dy}{dx} = 3 - 6x + y - 2xy$

$\displaystyle y = -3 + ce^{x^2 - x}$

So, from here, this is what I start out with:

$\displaystyle \frac{dy}{dx} + y(-1 + 2x) = 3 - 6x$

$\displaystyle P(t) = 2x -1$

$\displaystyle U = e^{\int 2x - 1 dx} = e^{x^2 - x}$

$\displaystyle \int \frac{d}{dx}[ye^{x^2 - x}] = \int 3e^{x^2 - x} - 6xe^{x^2 - x} dx$

But working from here would seem to require integrating $\displaystyle e^{x^2 - x}$, which I didn't think was trivially doable.

Where am I going wrong?

If you split up your integral you will have problems. Consider your integral (I have factored out a 3)

$\displaystyle \int 3(1-2x)e^{x^2-x}dx$

and try the substitution $\displaystyle u = x^2-x$.

BTW, your initial ODE is separable

$\displaystyle \dfrac{dy}{dx} = 3 - 6x + y - 2xy = (y+3)(1-2x)$
• Jun 14th 2011, 03:03 PM
Also sprach Zarathustra
Re: Having problems with a linear 1st order ODE
Quote:

Originally Posted by Danny
If you split up your integral you will have problems. Consider your integral (I have factored out a 3)

$\displaystyle \int 3(1-2x)e^{x^2-x}dx$

and try the substitution $\displaystyle u = x^2-x$.

BTW, your initial ODE is separable

$\displaystyle \dfrac{dy}{dx} = 3 - 6x + y - 2xy = (y+3)(1-2x)$

How I didn't see that?! (Headbang)
• Jun 14th 2011, 03:10 PM
Lancet
Re: Having problems with a linear 1st order ODE
Quote:

Originally Posted by Danny

If you split up your integral you will have problems. Consider your integral (I have factored out a 3)

Wow, that's a nasty integration example, simple though it is. Thank you for showing that to me!

Quote:

Originally Posted by Danny

BTW, your initial ODE is separable

Well, that would have made things considerably easier, had I seen that. Of course, I would have lost out on the integration lesson, so I'm happy with how things turned out.

Incidentally, is there a trick to spotting what something like this separates out into? Or is it just trial and error?
• Jun 14th 2011, 03:11 PM
Lancet
Re: Having problems with a linear 1st order ODE
Quote:

Originally Posted by Also sprach Zarathustra
How I didn't see that?! (Headbang)

I had the same reaction. :)