2

I am trying to write the Fourier series of $(1-x)$ in $[0,1]$ in two different ways:

$$f(x) = \frac{a_0}{2}+\sum_{n=1}^\infty (a_n\cos(\pi nx/L)+b_n\sin(\pi n x/L)),$$

$$f(x)=\frac{a_0}{2}+\sum_{n=1}^\infty (a_n\cos(2\pi nx/L)+b_n\sin(2\pi n x/L)),$$

If I use the first one to write the Fourier series of $(1-x)$ in the interval $[0,1]$, I get $$f(x)=1/2+\sum_{n=0}^\infty \left\{\frac{2(1-(-1)^n)}{n^2\pi^2}\cos(n\pi x)+\frac{2}{n\pi}\sin(n\pi x)\right\}.$$

If I use the second one, however, I get

$$f(x) = 1/2+\sum_{n=0}^\infty \frac{\sin(2\pi nx)}{\pi n}.$$

Shouldn't they result in the same series?

How I calculated the coefficients in the first case:

$$b_n=2\int_0^1(1-x)\sin(n\pi x)dx$$

$$a_n=2\int_0^1(1-x)\cos(n\pi x)dx$$

For the second case:

$$b_n=2\int_0^1(1-x)\sin(2\pi nx)dx$$

$$a_n=2\int_0^1(1-x)\cos(2\pi nx)dx$$

Anne Bauval
  • 34,650
sodiumnitrate
  • 623
  • 1
  • 5
  • 16
  • If you are calculating the series over the same period, yes. What values did you use for $L$ in the two series? – user164587 Sep 18 '14 at 02:10
  • It would be helpful if you shared some details of how you computed the coefficients. For instance how did you compute the constant terms? Since these only involve integrating your function over the interval I am mystified that you got a different result in both cases. – Spencer Sep 18 '14 at 02:15
  • See the edited version. I also discovered a mistake in the second series, but my question is still valid. – sodiumnitrate Sep 18 '14 at 02:42
  • I guess my question is how I'm supposed to get cosines in the second series. – sodiumnitrate Sep 18 '14 at 02:44

1 Answers1

0

Your second calculation is correct and corresponds to the function $f$ with period $1$ such that $\forall x\in(0,1),f(x)=1-x$.

Your first calculation, where $$g(x)=\frac{a_0}{2}+\sum_{n=1}^\infty \left(a_n\cos(\pi nx)+b_n\sin(\pi n x)\right)$$ and the real coefficients $a_n,b_n$ are given by $$a_n+ib_n=2\int_0^1(1-x)e^{i\pi nx}dx,$$ corresponds to the function $g$ with period $2$ such that $\forall x\in(0,1),g(x)=1-x$ and $\forall x\in(1,2),g(x)=0$.

Anne Bauval
  • 34,650