Triangular wave (source code)

= Triangular wave
{title2=$P(s+2\pi)=P(s)$}

A triangular wave is a continuous piecewise linear <periodic function> whose slope alternates between two values. The even $2\pi$-periodic extension of $bx$ from $[0,\pi]$ is $P(s)=b|s-2k\pi|$ for $(2k-1)\pi\le s\le(2k+1)\pi$. Its <Fourier cosine series> contains a constant term and odd modes with coefficients proportional to the inverse square of the mode number. Such extensions describe reflection under <Neumann boundary conditions>.