% A function with a period of pi that can be integrated
% analytically, and has an infinite Fourier series.
% It is normalized so that the integral from 0 to pi is 1.
function result = periodic2(x)
normalization = sqrt(3)/(pi);
result = normalization ./ ( 2 + cos(2.*x));


% Question: How do I know the Fourier series is infinite?

% Answer: Consider expanding the fraction as a power series in cos(2x)...