# What function has fourier series the harmonic series?

I know that this is on the boundaries of what's allowed, but hopefully someone'll answer before it gets closed!

What (periodic) function has Fourier series the harmonic series? I really want the even (cosine) terms to be the harmonic series and no odd terms.

Edit: so that the record is perfectly clear, what I wanted was a function with Fourier series

$$\sum_{n \ge 1} \frac{1}{n} \cos(n \pi t)$$

-
I wouldn't vote to delete the questions. It's not one of your best, but it's perfectly reasonable. –  Ben Webster Nov 4 '09 at 20:09
I'm curious now, which is my best? You've only got 4 to choose from! Anyway, I wanted this for a lecture tomorrow so was hoping to save myself some time and I did. –  Loop Space Nov 4 '09 at 20:12
(I've edited this question and its answers to clean up the mathematical rendering. Please don't bother to vote on it, either up or down. But if you do vote down, please explain your vote otherwise it's quite pointless.) –  Loop Space Jul 5 '13 at 9:38

It's a standard series computation to show that

$$\sum_{n \ge 1} \frac{x^n}{n} = \log \frac{1}{1 - x}$$

Now substitute $x = e^{i t}$ and take the real part.

(As an aside, the reason I write the identity this way is that this is the version which is combinatorially significant.)

-

Qiaochu Yuan's original answer was very helpful, but working through it left me with a question or two. I couldn't put the workings in a comment so I put them here. It turned out that there was a misunderstanding as to exactly what coefficients I wanted. Once that was resolved, his original answer sufficed. However, just in case someone else ponders this question, I'll leave my workings here to save them the effort.

Following the hint from Qiaochu, we start from

$$\sum_{n=0} x^n = (1 - x)^{-1}$$

and integrate term-by-term to get

$$\sum_{n=1} \frac{1}{n} x^n = -\log(1 - x)$$

now we substitute in $x = e^{\pi i t}$ to get

$$\sum_{n=1} \frac{1}{n} e^{n \pi it} = -\log(1 - e^{\pi i t})$$

of which we then take the real part:

$$\sum_{n=1} \frac{1}{n} \cos(n \pi t) = -\Re\log(1 - e^{\pi i t})$$

Excluding the case where $t=0$, we can use the standard branch of the logarithm and so use the identity $\log(r e^{i\theta}) = \log(r) + i\theta$ to deduce that we want the logarithm of the absolute value of $1 - e^{\pi i t}$. Since squaring is easily taken care of, we are lead to consider:

$$|1 - e^{\pi i t}|^2 = (1 - e^{\pi i t})(1 - e^{-\pi it}) = 1 - e^{\pi i t} - e^{-\pi it} + 1 = 2 - 2 \cos(\pi t)$$

and thus conclude that

$$\sum_{n=1} \frac{1}{n} \cos(n \pi t) = - \frac{1}{2} \log 2(1 - \cos(\pi t))$$

-
The (1-x)^{-1} is because Qiaochu interpreted Harmonic series as meaning "the series of Harmonic numbers" en.wikipedia.org/wiki/Harmonic_number . You seem to have meant the sum cos(n theta)/n, not sum cos(n theta)(1+1/2+...+1/n), so you don't need the (1-x)^{-1} term. –  David Speyer Nov 4 '09 at 19:26
This looks correct. Some people like to think of evaluating \zeta(2) in terms of computing the l^2 norm of this function (or one closely related to it) and it looks familiar from that computation. –  Qiaochu Yuan Nov 4 '09 at 19:46
I can see how this could be misconstrued from my last sentence, though I thought that "Fourier series is the harmonic series" was clear enough. Qiaochu, if you edit your answer accordingly then I'll accept it (and make my original question even clearer). –  Loop Space Nov 4 '09 at 20:07
Anyone reading these comments should be aware that they refer to the *uneditted version of Qiaochu's and my answers. –  Loop Space Nov 4 '09 at 20:25
@AndrewStacey I did not try this time. But when trying it in other posts I got messages like “you should change at least $X$ characters” where $X>2$. –  The User Jul 5 '13 at 15:39

To add to Qiaochu's answer: Of course, that sum does not converge for any real $t$. But I believe that it should Cesaro converge for all $t$ not in $2\pi \mathbb{Z}$, because sum $e^{n i t}/n$ converges for all such $t$.

-
For the record: This refers to Qiaochu's original answer. –  Loop Space Nov 4 '09 at 21:46