It is time to continue our quest to prove that the sum of the reciprocals of the primes diverges. We have one more ingredient to put into place. I am referring to the notion of a Taylor series. The idea is this: Some functions, like those from trigonometry, are difficult to evaluate precisely. It would be nice to be able to approximate them via some other, more manageable, function. And since polynomials are the most manageable functions there are, why not try one of them?

So, let *f(x)* be a smooth function we wish to approximate. For simplicity, let us assume that we seek a polynomial that approximates the function in a neighborhood around the point *x = 0*). For further simplicity, let us see how far we can get with a linear polynomial.

Recall that any straight line has an equation of the form

\[

y=mx+b,

\]

where *m* is the slope and *b* is the *y*-intercept (that is, the value of the function at *x = 0*. It follows that a straight line can encode two pieces of information: a point and a slope.

Since we want this line to approximate *f(x)* at *x = 0* we shall choose

\[

b=f(0) \phantom{xxx} \textrm{and} \phantom{xxx} m=f'(0).

\]

This is a fancy way of saying we want the straight line and the function to pass through the same point, and have the same slope, when *x=0*. Of course, this is the definition of the tangent line of the function at that point.

Using a quadratic polynomial would permit a better approximation, since we would now be able to encode three pieces of information. Specifically, we could make our polynomial have the same *y*-coordinate as the function at *x = 0*, and also have the same values for its first two derivatives. If we write

\[

f(x) \approx c+bx+ax^2

\]

then we have *f(0) = c*. Evaluating the first derivative gives us

\[

f'(x)=2ax+b.

\]

Evaluating both sides at zero now gives us *f'(0) = b*. Finally, evaluating second derivatives now gives us

\[

f”(x)=2a \phantom{xxx} \textrm{and} \phantom{xxx} \frac{f”(0)}{2}=a.

\]

Putting everything together gives us

\[

f(x) \approx f(0)+f'(0)x+\frac{f”(0)}{2}x^2.

\]

This is a formula for the best quadratic approximation to our function. Of course, the more terms we add to our polynomial, the better an approximation we will get. The basic pattern we have seen thus far continues, leading to the general formula

\[

f(x) = \sum_{n=0}^\infty \frac{f^{(n)}(0)}{n!}x^n,

\]

where $f^{(n)}(0)$ refers to the *n*-th derivative of the function at zero.

The wavy equal sign has been turned into the real thing because, when all goes well, the infinite sum on the right converges to the value of the function on the left for any value of *x*. Sadly, things often do not go well, and determining precisely which infinitely differentiable functions can be expressed as a Taylor series is a difficult problem. (For real-valued functions, at any rate. It turns out that complex, differentiable functions are far better behaved in this regard, but that is a different post.) Happily, for many of the most common functions this procedure works very well.

I should also mention that by restricting our attention to the case *x = 0* we are actually considering a special case of a Taylor series known as a Maclaurin series. That will be sufficient for our purposes.

Working out Taylor series directly from the formula is one of those amusing little exercises with which we torment students in second semester calculus classes. (Not too mention the subsequent torment for the people tasked with grading such things.) It is tedious in the extreme to work out all of those derivatives. In some cases, however, a little cleverness can get you the series by other means.

For example, if you remember the basic facts about geometric series then you know that we can write

\[

\frac{1}{1+x}=1-x+x^2-x^3+x^4-x^5+\dots

\]

If we now integrate both sides we obtain

\[

\ln (1+x) = x -\frac{x^2}{2}+\frac{x^3}{3}-\frac{x^4}{4}+\frac{x^5}{5}-\frac{x^6}{6}+\dots

\]

Of course, as always I am ignoring some technical details here. It is not immediately obvious that you really can integrate infinite series in this way, and we ought to give some thought to the fact that an indefinite integral is only defined up to an arbitrary constant. Suffice it to say that it is, indeed, acceptable to integrate in this way, and it is easy to show that the constant is zero in this case.

Now evaluate both sides at *x = 1* to obtain

\[

\ln 2 = 1 – \frac{1}{2} + \frac{1}{3} -\frac{1}{4}+\frac{1}{5}-\dots.

\]

On the right we have the alternating harmonic series, and this proves a formula I originally mentioned in this post.

As it happens, the Taylor series for the natural logarithm function is precisely the ingredient we need to complete our proof that the sum of the reciprocals of the primes diverges. Stay tuned for the big finale of this series, coming next week!