---
title: Power series and analytic functions
heading: Where a Taylor series converges, and whether it converges to the function
eyebrow: A14 · Lesson 27 · Power series and analytic functions
xp: 40
---

::: hook
$\frac{1}{1 + x^2}$ is perfectly smooth on the whole real line, yet its Taylor series at 0 converges only for $\lvert x\rvert < 1$. On the real line nothing happens at ±1; the reason is in the complex plane, where the function blows up at ±j (A12). And $e^{-1/x^2}$ (with value 0 at 0) has every derivative zero at 0, so its Taylor series is identically zero, though the function isn't. Power series are the most useful approximations in analysis, but knowing *where* and *whether* they represent a function takes the theory in this lesson.
:::

::: play
- The solid curve is $\frac{1}{1 + x^2}$; the dashed one is its Taylor polynomial $1 - x^2 + x^4 - \cdots \pm x^{2N}$.
- Inside $\lvert x\rvert < 1$ the partial sums close in as N grows; the readout gives the error at $x_0$, $\frac{\lvert x_0\rvert^{2N+2}}{1 + x_0^2}$.
- Outside, they swing wildly, worse with every term, though the function itself is tame there. The radius of convergence is 1, the distance from 0 to the complex singularities at ±j.
:::
:::

```sim plot
view: graph
x: x = -1.5..1.5
y: y = -1..2
slider: N = 1..30 step 1 = 6
slider: x0 = -1.4..1.4 step 0.05 = 0.8
plot: 1/(1 + x^2) | label: 1/(1 + x²)
plot: (1 - (-x^2)^(N + 1))/(1 + x^2) | samples: 1000 | dashed | label: partial sum to x²ᴺ
marker: x = x0 | label: x₀
readout: error at x₀ = abs(x0)^(2*N + 2)/(1 + x0^2)
```

::: predict
## What's the radius of convergence of the Taylor series of $\frac{1}{4 + x^2}$ about 0?

- [ ] 1
- [x] 2
- [ ] 4
- [ ] ∞, since the function is smooth everywhere on ℝ

::: reveal
2: the function blows up at $x = \pm 2j$ in the complex plane, and a power series converges in the largest disk around its center that avoids every singularity. On the real line alone you'd never guess it.
:::
:::

::: nameit
## Radius of convergence

For $\sum a_kx^k$ there's an $R \in [0, \infty]$ such that the series converges absolutely for $\lvert x\rvert < R$ and diverges for $\lvert x\rvert > R$:

$$\frac1R = \limsup_{k\to\infty}\lvert a_k\rvert^{1/k}, \quad\text{or}\quad R = \lim\left\lvert\frac{a_k}{a_{k+1}}\right\rvert \text{ when that limit exists}$$

At $\lvert x\rvert = R$ anything can happen: $\sum\frac{x^k}{k}$ converges at x = −1 and diverges at x = 1.

## Inside the radius

On every [−r, r] with r < R the series converges uniformly, so (lesson 26) its sum is continuous and can be integrated and differentiated term by term, with the same R.

## Analytic functions

f is **real-analytic** at a if its Taylor series there has a positive radius and converges to f nearby. Polynomials, exp, sin, cos and rational functions (away from their poles) are analytic. For a rational function, or anything built from analytic pieces, R is the distance from the center to the nearest complex singularity.

Not every smooth function is analytic: $f(x) = e^{-1/x^2}$ (f(0) = 0) has $f^{(k)}(0) = 0$ for every k, so its Taylor series is 0, which equals f only at x = 0.

## Taylor remainder and convergence

The Taylor series converges to f exactly when the remainder $R_n(x) \to 0$. Bounding the remainder with lesson 16 is how you prove it, as for $e^x$, whose remainder is at most $\frac{e^{\lvert x\rvert}\lvert x\rvert^{n+1}}{(n + 1)!} \to 0$ for every x.
:::

::: example
## Find the radius of convergence of $\sum\frac{k^2x^k}{3^k}$.

::: solution
1. **Ratio of coefficients.**
   $$\begin{aligned} \left\lvert\frac{a_k}{a_{k+1}}\right\rvert &= \frac{k^2/3^k}{(k + 1)^2/3^{k+1}} \\ &= 3\left(\frac{k}{k + 1}\right)^2 \\ &\to 3 \end{aligned}$$
2. **Read off R.** So R = 3: the polynomial factor doesn't change the radius.

**Answer:** R = 3.
:::
:::

::: example
## The series for $\frac{1}{1 + x^2}$ stops at $x^{2N}$. How large must N be for an error below $10^{-6}$ at x = 0.9?

::: solution
1. **The error.** After the $x^{2N}$ term it is
   $$\frac{0.9^{2N+2}}{1 + 0.81}$$
2. **Set it below $10^{-6}$.** That needs
   $$(2N + 2)\ln 0.9 < \ln(1.81 \times 10^{-6})$$
3. **Solve for N.** That is
   $$2N + 2 > 125.5$$
   so N = 62.
4. **Why so many.** Near the edge of the radius, convergence is slow.

**Answer:** N = 62.
:::
:::

::: example
## Find the radius of convergence of $\sum_k(2^k + 3^k)x^k$.

::: solution
1. **Root test.**
   $$\begin{aligned} \left(2^k + 3^k\right)^{1/k} &= 3\left(1 + (2/3)^k\right)^{1/k} \\ &\to 3 \end{aligned}$$
   So the radius is $R = \frac13$.
2. **Why the larger rate sets it.** The series is the sum of $\sum(2x)^k$ (radius ½) and $\sum(3x)^k$ (radius ⅓), and the sum converges only where both do.
3. **Check inside, at $x = \frac16$.**
   $$\frac{1}{1 - 1/3} + \frac{1}{1 - 1/2} = 3.5$$

**Answer:** $R = \frac13$.
:::
:::

::: check
given: c = 2 | 5 | 0.5; m = 1 | 3
answer: c
tolerance: 0.01%

## What's the radius of convergence of $\sum\frac{k^{\given{m}}x^k}{(\given{c})^k}$?

::: right
Right. R = {answer}: the ratio test gives $c\left(\frac{k}{k + 1}\right)^m \to c$.
:::

::: misses
- [1/c] Invert: R is the limit of $\lvert a_k/a_{k+1}\rvert$.
- [any] Not yet. Ratio test on the coefficients.
:::
:::

::: check
given: a = 2 | 3 | 0.5
answer: a
tolerance: 0.01%

## What's the radius of convergence of the Taylor series of $\frac{1}{\given{a}^2 + x^2}$ about 0?

::: right
Right. The poles are at $\pm ja$, a distance {answer} from 0.
:::

::: misses
- [a^2] It's the distance to the poles, $\lvert ja\rvert = a$.
- [any] Not yet. Find the complex singularities.
:::
:::

::: check
given: b = 3 | 5; c = 1 | -2
answer: abs(b - c)
tolerance: 0.01%

## What's the radius of convergence of the Taylor series of $\frac{1}{x - \given{b}}$ about x = {c}?

::: right
Right. The distance to the pole: {answer}.
:::

::: misses
- [b] That's the distance from 0; the series is centered at {c}.
- [any] Not yet. $\lvert b - c\rvert$.
:::
:::

::: check
given: x = 0.5 | 0.9 | -0.7; N = 5 | 20
answer: abs(x)^(2*N + 2)/(1 + x^2)
tolerance: 0.5%

## The series of $\frac{1}{1 + x^2}$ is cut after the $x^{2N}$ term with N = {N}. What's the error at x = {x}?

::: right
Right. $\frac{\lvert x\rvert^{2N+2}}{1 + x^2}$ = {answer}.
:::

::: misses
- [abs(x)^(2*N + 2)] That's the next term; the whole tail is that divided by $1 + x^2$.
- [any] Not yet. The partial sum is $\frac{1 - (-x^2)^{N+1}}{1 + x^2}$.
:::
:::

::: check
given: e = 0.000001 | 0.001; x = 0.9 | 0.5
answer: ceil((ln(e*(1 + x^2))/ln(x) - 2)/2)
tolerance: 0

## Smallest N for which cutting that series after $x^{2N}$ leaves an error below {e} at x = {x}?

::: right
Right. N = {answer}.
:::

::: misses
- [any] Not yet. Solve $\frac{x^{2N+2}}{1 + x^2} < \varepsilon$ for the smallest whole N.
:::
:::

::: check
kind: choice

## $f(x) = e^{-1/x^2}$ for x ≠ 0, f(0) = 0. What's true of its Taylor series at 0?

- [ ] It converges to f everywhere
- [x] It's identically 0, so it equals f only at x = 0
- [ ] It has radius 0
- [ ] It doesn't exist, since f isn't differentiable at 0

::: misses
- [1] Every coefficient is 0, but f isn't.
- [3] It converges everywhere, to the wrong function.
- [4] f has derivatives of every order at 0, all equal to 0.
:::
:::

::: check
kind: parts
given: a = 1 | 2; b = 3 | 5

## $\sum_k(\given{a}^k + \given{b}^k)x^k$.

::: part
answer: 1/b
tolerance: 0.5%

### What is its radius of convergence?

::: misses
- [1/a] The faster-growing coefficients set the radius.
- [1/(a + b)] The root test gives $\lim(a^k + b^k)^{1/k} = b$.
:::
:::

::: part
answer: 1/(1 - a/(2*b)) + 2
tolerance: 0.5%

### What is its sum at $x = \frac{1}{2b}$?

::: misses
- [any] Sum the two geometric series separately.
:::
:::
:::

::: check
kind: derivation
vars: x = -0.9..0.9

## Differentiate and multiply the geometric series.

::: step
answer: 1/(1 - x)^2

### What is $\sum_{k\ge1}kx^{k-1}$?
:::

::: step
answer: x*(1 + x)/(1 - x)^3

### What is $\sum_{k\ge1}k^2x^k$?
:::

::: right
Right. Differentiating inside the radius keeps the radius and gives these closed forms.
:::
:::

::: explain
## Why does the Taylor series of $\frac{1}{1 + x^2}$ stop converging at $\lvert x\rvert = 1$, when the function is smooth for every real x?

::: model
A power series converges in a disk in the complex plane: if it converges at some point, it converges at every point closer to the center, in every direction. $\frac{1}{1 + z^2}$ blows up at $z = \pm j$, a distance 1 from the origin, so the series can't converge on any disk larger than radius 1. That limit applies along the real axis too, even though nothing unusual happens there. The real line only shows a slice of the function; the series' behavior is decided by the whole complex picture, which is why the radius equals the distance to the nearest complex singularity.
:::
:::

::: practice

::: check
given: c = 4 | 0.2; m = 2 | 5
answer: c
tolerance: 0.01%

## Radius of $\sum\frac{k^{\given{m}}x^k}{(\given{c})^k}$?

::: misses
- [any] R = c.
:::
:::

::: check
given: a = 0.5 | 1 | 1.5 | 3 | 5 | 7
answer: a
tolerance: 0.01%

## Radius of the series of $\frac{1}{\given{a}^2 + x^2}$ about 0?

::: misses
- [any] Distance to $\pm ja$.
:::
:::

::: check
given: x = 0.3 | 0.95; N = 3 | 40
answer: abs(x)^(2*N + 2)/(1 + x^2)
tolerance: 0.5%

## Error of the $1/(1 + x^2)$ series through $x^{2N}$, N = {N}, at {x}?

::: misses
- [any] $\frac{\lvert x\rvert^{2N+2}}{1 + x^2}$.
:::
:::
:::
