DGS Studio

Fourier Series

Fourier Coefficients

Exact cosine coefficients of x^2 on [-pi, pi]. The function is even, so every sine coefficient is 0.

fourier_coefficients(x^2, x, pi) computes the textbook coefficients of x^2 on an interval of half-period pi. The constant a0 is 2*pi^2/3, an is 4*(-1)^n/n^2, and every bn is 0 because x^2 is even.

Solve Equation shows the integral formulas, the substitution of x^2, the simplified coefficients, the trigonometric series, the complex coefficients cn = an/2, and the partial sum S_N(x).

Equation

fourier_coefficients(x^2, x, pi)

How a Fourier series is built

A Fourier series analyzer starts from a periodic function and builds the coefficients, rather than asking you to type the series yourself. On an interval of length 2L the constant is a0/2, with an cosine terms and bn sine terms at frequency nπ/L. The complex coefficients are c0 = a0/2, cn = (an − i bn)/2, and c−n = (an + i bn)/2. Even functions on a symmetric interval have bn = 0. Odd functions have a0 = 0 and an = 0.

Exact integrals are kept as symbolic formulas, including the Bessel factor in the semicircle cosine coefficients. When a closed form is not returned, adaptive quadrature supplies the numbers and the steps say so. The graph draws the original periodic function and the partial sum SN together. The N slider recomputes SN in the browser from those coefficients. At a jump the series meets the average of the one-sided limits, and the partial sums overshoot that jump by about nine percent of its height. That Gibbs overshoot moves toward the discontinuity as N grows and does not disappear.

Reading the input

Try a change

Solve Equation opens the original input in the equation workspace and displays its symbolic results, conditions, and solution steps.

Edit and generate

Solve Equation opens the studio homepage and runs this field. Open in DGS Studio loads the same text and waits for you to generate it. The equation is sent once, as a query parameter.

Related examples