Skip to main content
added 363 characters in body
Source Link
user36273
user36273

You are right István Sikari-Nágl, it is not as easy at all as it looks.

f[x_] = Piecewise[{{x + π, -π < x < 0}, {x - π, 0 < x < π}}]; g = FourierSeries[f[x], x, 2] // ExpToTrig (* -2 Sin[x] - Sin[2 x] *) 

Edit

Now I build the periodic function.

Column[{ Plot[ Plot[f[Mod[x,-2 Pi]], {gx,-3 f[Mod[xPi, 3 Pi}, Exclusions -> None, ImageSize -> 250], Plot[f[Mod[x, 2 π]]Pi]], {x,-3 Pi, 3 Pi}, Exclusions -> None, ImageSize -> 250], Plot[f[Mod[x,-2 Pi]] + f[Mod[x, 2 π]]}Pi]], {x,-3 Pi, 3 Pi},Exclusions -> None, ImageSize -> 250], Plot[{g, f[Mod[x, 2 Pi,-Pi]]}, {x,-3 πPi, 3 πPi}, Exclusions -> None]None, ImageSize -> 250]  }] 

enter image description hereenter image description here

You are right István Sikari-Nágl, it is not as easy at all as it looks.

f[x_] = Piecewise[{{x + π, -π < x < 0}, {x - π, 0 < x < π}}]; g = FourierSeries[f[x], x, 2] // ExpToTrig (* -2 Sin[x] - Sin[2 x] *) Plot[{g, f[Mod[x, -2 π]] + f[Mod[x, 2 π]]}, {x, -3 π, 3 π}, Exclusions -> None] 

enter image description here

You are right István Sikari-Nágl, it is not as easy at all as it looks.

f[x_] = Piecewise[{{x + π, -π < x < 0}, {x - π, 0 < x < π}}]; g = FourierSeries[f[x], x, 2] // ExpToTrig (* -2 Sin[x] - Sin[2 x] *) 

Edit

Now I build the periodic function.

Column[{  Plot[f[Mod[x,-2 Pi]], {x,-3 Pi, 3 Pi}, Exclusions -> None, ImageSize -> 250], Plot[f[Mod[x, 2 Pi]], {x,-3 Pi, 3 Pi}, Exclusions -> None, ImageSize -> 250], Plot[f[Mod[x,-2 Pi]] + f[Mod[x, 2 Pi]], {x,-3 Pi, 3 Pi},Exclusions -> None, ImageSize -> 250], Plot[{g, f[Mod[x, 2 Pi,-Pi]]}, {x,-3 Pi, 3 Pi}, Exclusions -> None, ImageSize -> 250]  }] 

enter image description here

deleted 22 characters in body
Source Link

You are right István Sikari-Nágl, it is not as easy at all as it looks.

f[x_] = Piecewise[{{x + Piπ, -Piπ < x < 0}, {x - Piπ, 0 < x < Piπ}}]; g = FourierSeries[f[x], x, 2] // ExpToTrig (* -2 Sin[x] - Sin[2 x] *) Plot[{g, f[Mod[x, -2 \[Pi]]]π]] + f[Mod[x, 2 \[Pi]]]π]]}, {x, -3 \[Pi]π, 3 \[Pi]π}, Exclusions -> None] 

enter image description here

You are right István Sikari-Nágl, it is not as easy at all as it looks.

f[x_] = Piecewise[{{x + Pi, -Pi < x < 0}, {x - Pi, 0 < x < Pi}}]; g = FourierSeries[f[x], x, 2] // ExpToTrig (* -2 Sin[x] - Sin[2 x] *) Plot[{g, f[Mod[x, -2 \[Pi]]] + f[Mod[x, 2 \[Pi]]]}, {x, -3 \[Pi], 3 \[Pi]}, Exclusions -> None] 

enter image description here

You are right István Sikari-Nágl, it is not as easy at all as it looks.

f[x_] = Piecewise[{{x + π, -π < x < 0}, {x - π, 0 < x < π}}]; g = FourierSeries[f[x], x, 2] // ExpToTrig (* -2 Sin[x] - Sin[2 x] *) Plot[{g, f[Mod[x, -2 π]] + f[Mod[x, 2 π]]}, {x, -3 π, 3 π}, Exclusions -> None] 

enter image description here

Source Link
user36273
user36273

You are right István Sikari-Nágl, it is not as easy at all as it looks.

f[x_] = Piecewise[{{x + Pi, -Pi < x < 0}, {x - Pi, 0 < x < Pi}}]; g = FourierSeries[f[x], x, 2] // ExpToTrig (* -2 Sin[x] - Sin[2 x] *) Plot[{g, f[Mod[x, -2 \[Pi]]] + f[Mod[x, 2 \[Pi]]]}, {x, -3 \[Pi], 3 \[Pi]}, Exclusions -> None] 

enter image description here