If
is a piecewise-defined polynomial
function on
then the Fourier series
converges. In addition to computing the coefficients
sage: f1 = lambda x: -1 sage: f2 = lambda x: 2 sage: f = Piecewise([[(0,pi/2),f1],[(pi/2,pi),f2]]) sage: f.fourier_series_cosine_coefficient(5,pi) -3/(5*pi) sage: f.fourier_series_sine_coefficient(2,pi) -3/pi sage: f.fourier_series_partial_sum(3,pi) -3*sin(2*x)/pi + sin(x)/pi - 3*cos(x)/pi + 1/4
show(f.plot_fourier_series_partial_sum(15,pi,-5,5))
and
show(f.plot_fourier_series_partial_sum_cesaro(15,pi,-5,5))
(and be patient) to view the partial sums.
See About this document... for information on suggesting changes.