1

The Fourier series is

enter image description here

How can I expand the Fourier coefficient $a_n$ and $b_n$ to the n order? $x\in [-Pi,Pi]$,$n \gt 0$.

Jone Will
  • 107

1 Answers1

5

Sadly there isn't a FourierTrigCoefficient built in Mathematica up to now, but you can use my easyFourierTrigSeries for the task.

Let me illustrate the solving process with

$$f(x)=e^{-x}$$

If we need to find the general term of $a_n$ and $b_n$ for $x\in(-1,1)$, just write

Clear@f
f[x_] = Exp[-x];
series = easyFourierTrigSeries[f[x], {x, -1, 1}]

Mathematica graphics

The formula of $a_n$ and $b_n$ is already clear at this stage, simply copy them manually from the output isn't a bad idea, still, we can extract them progammatically in the following way:

Cases[series, a_ Cos[_] + b_ Sin[_] :> {a, b}, Infinity]

Mathematica graphics

xzczd
  • 447
  • Thanks a lot,it's really a good idea to build easyFourierTrigSeries. – Jone Will Jul 03 '17 at 06:21
  • 1
    ……同学,你问题下面的评论你应该也看到了。你最好在问题里再多写几句,不然再这么下去这问题可能要被关掉了…… – xzczd Jul 03 '17 at 06:23