Bug introduced in 7.0.1 or earlier and persisting through 11.1

I am using version 10.0 with Apple OS X. Consider the following.


enter image description here

Below FourierSeries retruns the wrong series.

PlotLabel->Style["The Wrong Truncated Fourier Series",14,Bold]]

enter image description here

Does Version 11 also have this problem?


I can derive the right series using a combination of FourierCosSeries and FourierSinSeries.

PlotLegends->{"g[t]","Truncated Fourier Series"}]

enter image description here

  • $\begingroup$ Hi; I run 11.0 on linux and I get that too. $\endgroup$ – bobbym Mar 11 '17 at 19:24
  • $\begingroup$ Same with 11.0 on Windows. Image $\endgroup$ – jjc385 Mar 11 '17 at 19:28
  • 1
    $\begingroup$ Sadly, the same bug even with version 7.0.1 on Win7x64. $\endgroup$ – innaiz Mar 13 '17 at 22:08
  • $\begingroup$ I can confirm that the bug is present in MMA 11.1.0. $\endgroup$ – user58955 Mar 23 '17 at 17:48
  • $\begingroup$ The same issue in version 12.1 on Linux. $\endgroup$ – user64494 May 19 at 5:19

This is a bug in FourierSeries, and appears to be caused by the default setting GenerateConditions -> False which is used while computing the underlying integrals.

A workaround for the problem is to use GenerateConditions -> True, as shown below.

f[t_] := 1/(1 + 25.0 * (t - 0.3)^2);
FSeries[t_] = Chop @ Expand @ ExpToTrig @ FourierSeries[f[t], t, 4,
    FourierParameters -> {1, Pi}, GenerateConditions -> True];


Thank your for reporting this issue, and sorry for the inconvenience.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.