# Homework Help: Taylor series

1. Mar 29, 2013

### Zondrina

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

Calculate the Taylor series expansion about x=0 as far as the term in $x^2$ for the function :

$f(x) = \frac{x-sinx}{e^{-x} - 1 + ln(x+1)}$ when $x≠0$
$f(x) = 1$ when $x=0$

2. Relevant equations

Some common Taylor expansions.

3. The attempt at a solution

So I'm getting a bit confused with this one, things don't seem to be happening like they usually do.

First off ill note that :

$x - sinx = \frac{x^3}{3!} - \frac{x^5}{5!} + \frac{x^7}{7!} - ...$

Also :

$e^{-x} - 1 + ln(x+1) = \frac{x^3}{3!} - \frac{5x^4}{4!} + \frac{23x^5}{5!} - ...$

So I after factoring $\frac{x^3}{3!}$ out of the numerator and denominator of f(x), I get :

$\frac{1 - \frac{x^2}{20} + \frac{x^4}{840} - ...}{1 - \frac{5x}{4} + \frac{23x^2}{20} - ...}$

Now here's my problem. When I start doing the long division needed to find the Taylor series up to $x^2$, the long division doesn't work like it should. Perhaps I made a small mistake somewhere, but I can't seem to see it.

If anyone has some insight it would be appreciated.

2. Mar 29, 2013

### stevenb

It's not clear why you should have trouble doing that. Perhaps if you post your work, we can see your error?

EDIT: aside from that difficulty, I don't think the expansion of the denominator is correct.
EDIT AGAIN: it checks out now, sorry.

Last edited: Mar 29, 2013
3. Mar 29, 2013

### Zondrina

Well, 1 goes into 1 one time. So i multiply each member of my divisor by one and subtract it from my numerator.

1 - 1 = 0 This works out like it should.

$- \frac{x^2}{20} + \frac{5x}{4} =$ something that doesn't comply

$\frac{x^4}{840} - \frac{23x^2}{20} =$ once again no dice.

So I can't continue the division.

4. Mar 29, 2013

### stevenb

You can continue. The remainder is terms of different powers, so just write them out and continue dividing to get the series expansion.

Correction, to my edit above. It should work out, now that I've checked it.

5. Mar 29, 2013

### vela

Staff Emeritus
I'd avoid doing long division. You have
$$\frac{1 - \frac{x^2}{20} + \frac{x^4}{840} - ...}{1 - \left(\frac{5x}{4} - \frac{23x^2}{20} + \cdots\right)}.$$ Now use the expansion $\frac{1}{1-z} = 1+z+z^2+z^3+\cdots$ to convert the fraction into a product of two series. You only have to keep track of a few terms. The rest you can ignore because they will only contribute to higher orders.

6. Mar 29, 2013

### stevenb

Vela,

Is that really easier? I haven't tried it, but it looks at least a little more time consuming than direct division. It seems you need the first two terms from the numerator, so you'll need to apply that expansion twice (once for each term), and then after working each term (which includes multiplications), you'll have to add the terms.

Or, maybe I'm missing a shortcut you have in mind?

Division is completed in about 30 seconds directly, since we're only going up to second order terms. I think the issue here is that the OP is not confident about the rules for division of power series, which should be learned.

7. Mar 29, 2013

### Zondrina

I don't quite have $\frac{1}{1-z}$ going on? Not quite seeing what you're saying to do here.

8. Mar 29, 2013

### vela

Staff Emeritus
You'll end up with
$$\left(1 - \frac{x^2}{20}\right)(1+\text{a few terms up to order }x^2).$$ Then you just multiply it out.

9. Mar 29, 2013

### stevenb

I see it now. Nice trick! ... but still about the same amount of work as division.

10. Mar 29, 2013

### Zondrina

I'd love to see how vela's trick worked after I figure out this division.

I gave it a try not caring that things didn't cancel out like they usually do.

At the end, I got $1 + \frac{5x}{4} + \frac{29x^2}{80} + ...$

Does that match up with what you got steven? It seems unlikely.

Last edited: Mar 29, 2013
11. Mar 29, 2013

### stevenb

That matches what I got and seems reasonable.

12. Mar 29, 2013

### Zondrina

Yeah, what threw me off was after the first run through of the division, I had to simplify what I got before I could continue. It just seemed a little weird at first.

I noticed the question also asked me to find f''(0) just now.

So f''(0) = 58/80 = 29/40.

Thanks for your help in confirming. It makes me feel better when someone else gets the same answer as well.

13. Mar 29, 2013

### stevenb

That makes sense. The first derivative f'(0) is 5/4. Hence, the Taylor series found by the expansion around zero, in terms of derivatives yields the same answer. 1+f'(0) x + f''(0) x^2/2 ... = 1+5x/4 + 29x/80 ...

Looks like you are ok. vela's approach works too because you get (1-x^2/20 ...)(1+5x/4 +33x^2/80 ...) which gives the same.

14. Mar 29, 2013

### Zondrina

Ohhhhh I see that now. That's actually a pretty dirty trick. It seemed really far out there when he first said it, but I can see after using the expansion I get the same thing.

Just more tools for the toolkit right?

15. Mar 29, 2013

### Stimpon

Plough it into your brain. I remember being sat in an exam, being faced with a similar problem and completely blanking on how to do it. It was very fustrating.