# Math Help - FP1 first order differential help please

1. ## FP1 first order differential help please

find y in terms of x given that x(dy/dx)+3y=e^x

And that when y=1 x=1

2. Originally Posted by Bryn
find y in terms of x given that x(dy/dx)+3y=e^x

And that when y=1 x=1
$x\frac{dy}{dx}+3y=e^x$

$\frac{dy}{dx}+3\frac{y}{x}=\frac{e^x}{x}$

Now multiply by the integrating factor $e^{\int \frac3{x} \, dx} = x^3$.

$\frac{d(yx^3)}{dx}=x^2 e^x$

$\int d(yx^3)=\int x^2 e^x \, dx$

$yx^3=(x^2 - 2x + 2)e^x + C$

3. ## I have this exam next monday too.

Originally Posted by Bryn
find y in terms of x given that x(dy/dx)+3y=e^x

And that when y=1 x=1
$x\frac{dy}{dx} + 3y = e^x$
$\frac{dy}{dx} + \frac{3}{x}y = \frac{e^x}{x}$
Integrating factor = $e^{\int \frac{3}{x}\, dx}=e^{ln x^3} = x^3$
Multiply through $x^3$, giving $x^3\frac{dy}{dx} + 3x^2y = e^xx^2$
So $x^3 y = \int x^2e^x\, dx$

I would $\int x^2 e^x \, dx$ by parts:
$u=x^2, \frac{du}{dx} = 2x, \frac{dv}{dx} = e^x, v = e^x$

so $x^3y = e^xx^2 - \int 2xe^x\, dx$
$u=2x, \frac{du}{dx}=2, \frac{dv}{dx}=e^x, v=e^x$
$x^3y = e^xx^2 - 2xe^x + \int 2e^x \,dx = (x^2-2x+2)e^x + C$

To get $C$, substitute $y=1, x=1$ into $x^3y = (x^2-2x+2)e^x + C$

So $1=(1-2+2)e + C => C = 1-e$

$x^3y=(x^2-2x+2)e^x + 1-e$