DGS Studio

Sigma / Σ Summation

Fourier Series

A square wave from the odd-harmonic Fourier series through n = 15.

y = (4/pi)*sum(sin((2*n+1)*x)/(2*n+1), (n, 0, 15)) is a square-wave Fourier series. The index starts at 0, so the first term is sin(x), then sin(3x)/3, through sin(31x)/31.

The factor 4/π sets the wave height near ±1 between the jumps. Sixteen odd harmonics sharpen the corners. The result is still one explicit function of x.

Equation

y = (4/pi)*sum(sin((2*n+1)*x)/(2*n+1), (n, 0, 15))

How an explicit graph works

An explicit graph gives y directly from x. Every vertical line meets the curve once, except where the expression is undefined. DGS draws it on the 2D board and, for an ordinary function, can mark intercepts, extrema, and asymptotes without changing the equation you typed.

Domain matters. Square roots and logarithms stop where their inputs are invalid, and rational functions and tangent open a gap at a pole. A slider letter such as a, b, or c is not a second curve. In DGS the lowercase names a, b, and c start at 4, 3, and 5 unless the input assigns them.

Reading the input

Try a change

Generate Graph posts the expression to the studio graph engine and draws the result on the homepage. The editable field is the entire input, including every line.

Edit and generate

Generate Graph 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