# Faster way to find Taylor series

I'm trying to figure out if there is a better way to teach the following Taylor series problem. I can do the problem myself, but my solution doesn't seem very nice!

Let's say I want to find the first $n$ terms (small $n$ - say 3 or 4) in the Taylor series for

$$f(z) = \frac{1}{1+z^2}$$

around $z_0 = 2$ (or more generally around any $z_0\neq 0$, to make it interesting!) Obviously, two methods that come to mind are 1) computing the derivatives $f^{(n)}(z_0)$, which quickly turns into a bit of a mess, and 2) making a change of variables $w = z-z_0$, then computing the power series expansion for

$$g(w) = \frac{1}{1+(w+z_0)^2}$$ and trying to simplify it, which also turns into a bit of a mess. Neither approach seems particularly rapid or elegant. Any thoughts?

• I assume you know $\displaystyle \frac{1}{1+z}= \sum_{n=0}^{\infty} (-1)^n z^n$ already, no? Can you adjust it for your case? Commented Jul 7, 2016 at 21:29
• @Tolaso that's what I meant by "making the substitution $w = z-2$". It can be done, it's just messy. Commented Jul 7, 2016 at 21:32
• Another trick involves noting that this function is the derivative of $\arctan(z)$, and then assuming that series expansions of common functions like $\arctan$ are known. Commented Jul 8, 2016 at 6:06
• @asmeurer: But how do you find the series expansion of $\arctan z$? Surely the easiest way is by integrating the series expansion for $\frac{1}{1+z^2}$? Commented Sep 19, 2016 at 3:03
• @PeteL.Clark I usually find it by looking it up on Wikipedia. Commented Sep 19, 2016 at 3:05

Let $g(w) = \sum_{n=0}^{\infty} a_n w^n$.

Then $(w^2+4w+5) \; g(w) = 1$ implies \begin{align} 5 a_0 &= 1 \\ 4 a_0 + 5 a_1 &= 0 \\ a_0 + 4 a_1 + 5 a_2 &= 0 \\ a_1 + 4 a_2 + 5 a_3 &= 0 \\ \text{etc.} \end{align}

which you can then solve for the $a_n$'s in a stepwise fashion.

• Very slick. These equations come from differentiating both sides of $(w^2+4w+5)g(w) = 1$, correct? Commented Jul 7, 2016 at 21:59
• @icurays1 I think you can get these equations by multiplying out the left side term-by-term; this seems simpler than my approach. Commented Jul 7, 2016 at 22:04
• @icurays1, differentation is not involved. The first equation results from looking at the coefficient of $1$ (the constant term) on both sides of the equation, the second from looking at the coefficient of $w$, the third from $w^2$, etc. Commented Jul 7, 2016 at 22:23
• Got it, Robert Israel's answer (now deleted) goes through this in more detail. Commented Jul 7, 2016 at 22:27

Here is one way to find the first few terms for $z_0=2$, using your idea of letting $w=z-2$:

$\displaystyle\frac{1}{1+z^2}=\frac{1}{1+(w+2)^2}=\frac{1}{5+w^2+4w}=\frac{\frac{1}{5}}{1-(-\frac{w^2+4w}{5})}$

$\displaystyle\frac{1}{5}\left(1-\frac{w^2+4w}{5}+\frac{(w^2+4w)^2}{5^2}-\frac{(w^2+4w)^3}{5^3}+\cdots\right)$

$\displaystyle=\frac{1}{5}\left(1-\frac{w^2+4w}{5}+\frac{w^2(w+4)^2}{25}-\frac{w^3(w+4)^3}{125}+\cdots\right)$

$\displaystyle=\frac{1}{5}-\frac{4}{25}w+\frac{11}{125}w^2-\frac{24}{625}w^3+\cdots$

• Oh hey, that's way better than what I was doing. Still a bit of arithmetic to do, but probably about as good as it gets. Commented Jul 7, 2016 at 21:48

For this particular problem, try a different substitution: $x=z^2$.

Then $$\frac1{1+x} = \sum (-1)^nx^n$$ so $$\frac1{1+z^2} = \sum (-1)^nz^{2n}$$

The probelm of finding a closed form is not always easy. If you can find a closed form for the coefficient of $z^k$ in $$\frac{1}{(1-z)(1-z^2)(1-z^3)(1-z^4)\cdots}$$ tell me about it so I can steal your result, publish it, and become famous. (LOL - this will be a closed form for the partition number of $k$)

• Is this around $z_0=2$, though? Commented Jul 7, 2016 at 21:31
• Note that I'm trying to get the series around some $z_0\neq 0$. You're right though, there probably isn't a nice solution! (And if I did find that closed form, you can have it - I'll take 2nd author ;) ) Commented Jul 7, 2016 at 21:34
• That is the generating function for partitions. See this: en.wikipedia.org/wiki/Partition_(number_theory) Commented Jul 7, 2016 at 22:39
• The asymptotic formula for the coefficient of $z^n$ is $p(n) \sim \dfrac1{4n\sqrt{3}} \exp(\pi\sqrt{\dfrac{2n}{3}})$. Commented Jul 7, 2016 at 22:43