# Solving an ODE: The Pwer Series and Seperation of Variables

1. Nov 30, 2008

### TFM

1. The problem statement, all variables and given/known data

Solve the following equation by a power series and also by separation of variables. Check that the two agree.

2. Relevant equations

N/A

3. The attempt at a solution

Power Series:

$$(1+x) \frac{dy}{dx} = y$$

$$(1+x) \frac{1}{dx} = y \frac{1}{dy}$$

The power series is:

$$(1+x) \equiv 1+x+0x^2+0x^x$$ ...

Thus

$$\frac{1 + x}{dx} = \frac{y}{dy}$$

Separation by Variables:

$$(1+x) y' = y$$

$$y' = \frac{1}{((1+x)} y$$

$$x'=g(t)h(x)$$

$$H(x) = G(t) + C$$

$$H=\int \frac{dx}{h(x)} ; G=\int g(t)dt$$

$$H=\int \frac{dy}{y} \equiv \int \frac{1}{y} dy = ln y$$

$$G = \int \frac{1}{1+x} dx = ln(1 + x)$$

$$ln y = ln (1+x) + c$$

$$y = 1 + x + c$$

These two methods haven't agreed for this question. i think the problem lays in my Power Series.

Anyone got any idesa?

TFM

2. Nov 30, 2008

### CompuChip

Your second solution looks right, up to
ln(y) = ln(1 + x) + c
But if you exponentiate that, you won't get
y = 1 + x + c,
do that step again.

As for your real question, I suppose that they mean: plug in a solution
$$y(x) = \sum_{n = 0}^\infty a_n x^n$$
and determine the coefficients $a_n$ from the differential equation.
Note that you can differentiate by terms, so
$$\frac{dy}{dx} = \sum_{n = 0}^\infty n a_n x^{n - 1}$$
etc.

3. Nov 30, 2008

### TFM

Indeed it won't:

ln(y) = ln(1 + x) + c

take exponentials of both sides leaves:

$$y = 1 + x + e^c$$

Okay so for the power series:

$$y(x) = \sum_{n = 0}^\infty a_n x^n$$

so would the coeffieients coming from here:

$$(1+x) \frac{1}{dx} = y \frac{1}{dy}$$

be 1 and 1, since you have x^0 has a coefficient of 1, and x has a coefficent of 1 also?

TFM

4. Nov 30, 2008

### CompuChip

No,
e^(ln(1 + x) + c) = e^ln(1+x) * e^c = ...

And what do you mean by: "the coefficients being 1 and 1"? You have infinitely many of them! Start by plugging the sum into
$$(1+x) \frac{dy}{dx} = y$$
- what do you get?

5. Nov 30, 2008

### TFM

Since e^c is another constant, wouldn't it not be:

= k + kx

???

So I should have:

$$(1+x) \frac{dy}{dx} = \sum_{n = 0}^\infty a_n x^n$$

???

TFM

6. Nov 30, 2008

### gabbagabbahey

Yes, that would be fine.

Well, that is a true statement, but not very useful to you in that form. If $$y(x)= \sum_{n = 0}^\infty a_n x^n$$...what is $$\frac{dy}{dx}$$?

7. Dec 1, 2008

### TFM

Would this be:

$$y(x)= \sum_{n = 0}^\infty a_n x^n$$

$$\frac{dy}{dx} = \sum_{n = 0}^\infty a_n(n - 1) x^{n-1}$$

Does this look right???

TFM

8. Dec 1, 2008

### CompuChip

Almost; is $2 x^2$ the derivative of $x^3$?

Now write down your complete differential equation.

9. Dec 1, 2008

### TFM

Okay so:

x^3 differentiates to 3x^2

$$\frac{dy}{dx} = \sum_{n = 0}^\infty a_n(n) x^{n-1}$$

so would this be:

$$\frac{dy}{dx} = \sum_{n = 0}^\infty a_n(n) x^{n-1} + a_{n-1}(n+1) x^{n} + a_{n-2}(n+2) x^{n + 1} + ...$$

???

TFM