0

I am wondering how to find a closed-form expression for the fourier coefficients $a_n=\frac{(-1)^n}{n}$, i.e. I am looking for a function $f$ on $(-\pi,\pi)$ that generates the fourier series

$$f(x)=\sum_n \frac{(-1)^n}{n} \cos(nx)$$

What I know from this source is the fact that the function

  • should be even
  • should be linear because the Fourier coefficients of $x^k$ involve $\frac{1}{n^k}$.

But if $f$ is even and should be linear, it can only be a constant function. So I am not sure if it is not possible or I made a mistake.

The graph looks like a half-circle and diverges for $x = \pm \pi$ because $f(\pm \pi)=\sum_n \frac{(-1)^n}{n}$

A similar post is this.

garondal
  • 1,254
  • 1
    Some ideas: $f$ is the real part of $$F(x)=\sum \frac{(-1)^n}{n}e^{inx}=\sum\frac1ne^{i(x+\pi)n}.$$ So you only need to compute $\sum\frac1nz^n$, which can be viewed as the anti-derivative of a geometric series. Maybe some more work should be done to make things rigorous. – Feng Sep 05 '23 at 10:42
  • The function is not linear. Examine the reasons you thought it is. – GEdgar Sep 05 '23 at 10:55
  • for me the graph looks more like $\frac{1}{sin^2(x/3-\pi/2)-c}$ not like a circle – trula Sep 05 '23 at 11:02
  • Using @Feng's comment I've got something like $f(x)=\frac{1}{(\cos(x+\pi)-x)^2}$ which has a similar shape but is not correct. – garondal Sep 05 '23 at 11:07
  • 1
    This is $-\ln\big(2\cos\frac{x}{2}\big)$ – GEdgar Sep 05 '23 at 11:11
  • 1
    I think you mean $f(\pm\pi) = \sum_n 1/n$ for the divergent sum. – eyeballfrog Sep 05 '23 at 12:02
  • 1
    The polynomial argument from the linked post is missing a condition. Namely, that odd $k$ are coefficients of $\sin(n x)$ and even $k$ are coefficients of $\cos(n x)$. Here you have odd $k$ on $\cos(n x)$ terms, so it doesn't work. If your function was instead $\sum_n (-1)^n/n \sin(n x)$, you would indeed get a linear function. – eyeballfrog Sep 05 '23 at 12:10

1 Answers1

2

Just for the sake of completness:

We have $$f(x)=\sum_{n=1}^\infty \frac{(-1)^n}{n} \cos(nx)=\Re\left(\sum_{n=1}^\infty \frac{1}{n}e^{i\pi n}e^{ixn}\right)=\Re\left(\sum_{n=1}^\infty \frac{1}{n}e^{i(x+\pi)n}\right)=\Re\left(\sum_{n=1}^\infty \frac{1}{n}z^n\right)$$ with $z=e^{i(x+\pi)}$.

If we take the derivative, we get a geometric series $$f'(x)=\Re\left(\sum_{n=1}^\infty z^{n}\right)=\Re\left(\frac{1}{1-z}\right).$$

So we get $f$ by integrating $$f(x)=\Re\left(-\ln(1-z)\right)+c.$$ Since $f(0)=\sum_{i=0}^\infty \frac{(-1)^n}{n}=-\ln(2)$ we can conclude that $c=0$. So we are left with $$f(x)=-\Re\left(\ln(1-z)\right)=-\Re\left(\ln(1-e^{i(x+\pi)})\right)=-\Re\left(\ln(1+e^{ix})\right).$$ Using this post with $x=1+\cos(x)$ and $y=\sin(x)$ we can rewrite the $\ln$-expression: $\ln(1+e^{ix})=\ln(\sqrt{2\cos(x)+2})+i\theta$ and we get the final result $$f(x)=-\frac{1}{2} \ln\left(2(\cos(x)+1)\right)=-\ln(2\cos(\frac{x}{2})).$$

garondal
  • 1,254