Gibbs Phenomenon

Author

Eric W. Weisstein
August 21, 2011

This notebook downloaded from http://mathworld.wolfram.com/notebooks/Calculus/GibbsPhenomenon.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/GibbsPhenomenon.html.

©2011 Wolfram Research, Inc. except for portions noted otherwise

Plot

(series=Rest[FoldList[Plus,0,Table[Sin[n Pi x]/n,{n,1,9,2}]]]4/Pi)//ColumnForm//TraditionalForm

V5

<<Graphics`Colors`

Plot[Evaluate[{
2UnitStep[x]-2UnitStep[x-1]+2UnitStep[x-2]-1,
Sequence@@series
}],{x,-.02,2.02},
PlotStyle->{Thickness[.01],Red,Yellow,Green,Blue,Violet},
PlotRange->All,AxesLabel->TraditionalForm/@{x,f[x]}]

V6

Get["Graphics`Colors`"]//Quiet

Plot[Evaluate[{
2UnitStep[x]-2UnitStep[x-1]+2UnitStep[x-2]-1,
Sequence@@series
}],{x,-.02,2.02},
PlotStyle->{{Black,Thickness[.01]},Red,Yellow,Green,Blue,Violet},
Exclusions->None,AxesLabel->{x,f[x]}]