# Solving a linear ODE

## Homework Statement

Solve 2*dy/dx - y = e^x at y(0) = 0

## The Attempt at a Solution

So the integrating factor is e^-x

Multiplying through by e^-x:

2e^-x(dy/dx) - ye^-x = 1

Now this is where I'm having a slight problem, isn't the left hand side meant to contract via the product rule to d/dx(...) ?

Except that the derivative of 2e^-x is not -e^-x

What have I done wrong?

Related Calculus and Beyond Homework Help News on Phys.org
Hootenanny
Staff Emeritus
Gold Member

## Homework Statement

Solve 2*dy/dx - y = e^x at y(0) = 0

## The Attempt at a Solution

So the integrating factor is e^-x

Multiplying through by e^-x:

2e^-x(dy/dx) - ye^-x = 1

Now this is where I'm having a slight problem, isn't the left hand side meant to contract via the product rule to d/dx(...) ?

Except that the derivative of 2e^-x is not -e^-x

What have I done wrong?
You might want to check your integrating factor

dynamicsolo
Homework Helper
The form of the differential equation needed before computing an integrating factor is
y' + P(x)y = Q(x). This is done so the Product Rule can be applied: you are looking for a function I(x) such that

$$I(x) \frac{dy}{dx} + I(x)P(x)y = I(x)Q(x) \Rightarrow \frac{d}{dx}[I(x)y(x)] = I(x)Q(x) ,$$

that is, so you will be able to re-make the left-hand side of the differential equation into the derivative of a simple product. After integration, you will have $I(x)y(x) = \int I(x)Q(x)$, after which you can simply divide I(x) back out again to obtain an expression for y (one that has a "closed form" if I(x)Q(x) can be integrated).

HallsofIvy
Homework Helper

## Homework Statement

Solve 2*dy/dx - y = e^x at y(0) = 0

## The Attempt at a Solution

So the integrating factor is e^-x

Multiplying through by e^-x:

2e^-x(dy/dx) - ye^-x = 1

Now this is where I'm having a slight problem, isn't the left hand side meant to contract via the product rule to d/dx(...) ?

Except that the derivative of 2e^-x is not -e^-x
Then you must have the wrong integrating factor since this is exactly how "integrating factor" is defined!

What have I done wrong?

Ah...I see now, I should divide the equation through by 2 first, therefore the integrating factor becomes e^-1/2x

and the equation eventually becomes y = e^x + e^-1/2x

Thanks guys =)

dynamicsolo
Homework Helper
...
and the equation eventually becomes y = e^x + e^-1/2x
Not quite: check what you did when you divided e-(1/2)x back out. Your solution doesn't work in the original DE...

Last edited: