% A function with a period of pi that can be integrated
% analytically, and has an infinite Fourier series. The
% function and its first and second derivatives are
% continuous at 0 and pi.
% It is normalized so that the integral from 0 to pi is 1.
function result = periodic3(x)
normalization = 30/(pi^3);
result = normalization .* ( x .* (1 - x./pi) ).^2;