フーリエ級数

周期2πを持つ関数のフーリエ級数展開

k = 100;
f[
          x_] := (π/4) + (∑_(n = 1)^k)(-((1 + (((-1))^(n - 1)))/((n^2) π)) 
                  Cos[n x] + ((((-1))^(n - 1))/n) 
                  Sin[n x]);
Plot[f[x], {x, -4 Pi, 4  Pi}, AspectRatio -> Automatic, 
      Axes -> Automatic, ImageSize -> {440, Automatic}, 
      PlotRange -> {{-4 Pi, 4  Pi}, {-1, 3.5}}, 
      Ticks -> {{-4 Pi, -3 Pi, -2 Pi,  -Pi, 0, Pi, 
            2  Pi, 3  Pi, 4  Pi}, {-Pi, 0, Pi}}]

\(\(\( (*\ 不連続点のチェック\ *) \)\(
\)\(f[Pi]\  // \ N

    π/2\  // N\)\)\)

周期2πを持つ偶関数のフーリエ級数展開

k = 100;
f[
          x_] := (π/2) + (∑_(n = 1)^k)(-2 ((1 + (((-1))^(n - 1)))/((n^2) π)) Cos[n x]);
Plot[f[x], {x, -4 Pi, 4  Pi}, AspectRatio -> Automatic, 
      Axes -> Automatic, ImageSize -> {440, Automatic}, 
      PlotRange -> {{-4 Pi, 4  Pi}, {-1, 3.5}}, 
      Ticks -> {{-4 Pi, -3 Pi, -2 Pi,  -Pi, 0, Pi, 
            2  Pi, 3  Pi, 4  Pi}, {-Pi, 0, Pi}}]

周期2πを持つ奇関数のフーリエ級数展開

k = 100;
f[
          x_] := (∑_(n = 1)^k)(2 ((((-1))^(n - 1))/n) 
              Sin[n x]);
Plot[f[x], {x, -4 Pi, 4  Pi}, AspectRatio -> Automatic, 
      Axes -> Automatic, ImageSize -> {440, Automatic}, 
      PlotRange -> {{-4 Pi, 4  Pi}, {-3.5, 3.5}}, 
      Ticks -> {{-4 Pi, -3 Pi, -2 Pi,  -Pi, 0, Pi, 
            2  Pi, 3  Pi, 4  Pi}, {-Pi, 0, Pi}}]

\(\(\( (*\ 不連続点のチェック\ *) \)\(
\)\(f[π]\  // N

    0\  // N\)\)\)

周期2Lを持つ関数のフーリエ級数展開

k = 100;
f[x_] := 
        (1/2) + (∑_(n = 1)^k)(((1 - (((-1))^n))/(n π)) Sin[n π x]);
Plot[f[x], {x, -4, 4}, AspectRatio -> Automatic, 
      Axes -> Automatic, ImageSize -> {440, Automatic}, 
      PlotRange -> {{-4, 4}, {-1.3, 1.3}}, 
      Ticks -> {{-4, -3, -2, -1, 0, 1, 2, 3, 
            4}, {-1, 0, 1}}]

周期2Lを持つ偶関数のフーリエ級数展開

k = 100;
f[x_] := 1;
Plot[f[x], {x, -4, 4}, AspectRatio -> Automatic, 
      Axes -> Automatic, ImageSize -> {440, Automatic}, 
      PlotRange -> {{-4, 4}, {-1.3, 1.3}}, 
      Ticks -> {{-4, -3, -2, -1, 0, 1, 2, 3, 
            4}, {-1, 0, 1}}]

周期2Lを持つ奇関数のフーリエ級数展開

k = 100;
f[
          x_] := (∑_(n = 1)^k)(((4 (1 - (((-1))^n)))/(n π)) Sin[((n π)/2) x]);
Plot[f[x], {x, -8, 8}, AspectRatio -> Automatic, 
      Axes -> Automatic, ImageSize -> {440, Automatic}, 
      PlotRange -> {{-8, 8}, {-2.5, 2.5}}, 
      Ticks -> {{-8, -6, -4, -2, 0, 2, 4, 6, 
            8}, {-2, 0, 2}}]

周期2lを持つ関数のフーリエ級数展開（標準プログラム）

l = 4;
k = 100;
f[
          x_] := (∑_(n = 1)^k)(((4 (1 - (((-1))^n)))/(n π)) Sin[((n π)/2) x]);
Plot[f[x], {x, -4 l, 4 l}, AspectRatio -> Automatic, 
      ImageSize -> {600, Automatic}]