y=arcsin(sinx)y = \arcsin(\sin x)

Graph of the Triangle Wave y=arcsin(sinx)y = \arcsin(\sin x)

y=arcsin(sinx)y = \arcsin(\sin x) applies the sine and then the inverse sine1. The two are inverse operations, so one might expect xx back, but the range of arcsin\arcsin is confined to [π2,π2]\left[ -\dfrac{\pi}{2}, \dfrac{\pi}{2} \right], and whatever falls outside is folded back, producing a triangle wave.

The formula piece by piece

IntervalFormulaSlope
π2xπ2-\dfrac{\pi}{2} \leq x \leq \dfrac{\pi}{2}y=xy = x11
π2x3π2\dfrac{\pi}{2} \leq x \leq \dfrac{3\pi}{2}y=πxy = \pi - x1-1

On the first interval sin\sin and arcsin\arcsin cancel exactly. On the next the slope turns to 1-1, and the pattern repeats every 2π2\pi.

Domain and range

  • The domain is all real numbers
  • The range is π2yπ2-\dfrac{\pi}{2} \leq y \leq \dfrac{\pi}{2}
  • The period is 2π2\pi
  • It is an odd function

Both sin\sin and arcsin\arcsin are odd, so their composition is odd too and the graph has point symmetry about the origin.

The corners

The graph is a polyline joining segments of slope 11 and 1-1 alternately. The vertices sit at x=π2+nπx = \dfrac{\pi}{2} + n\pi, where the value is ±π2\pm\dfrac{\pi}{2}. There the slopes from the two sides are 11 and 1-1, so the function is not differentiable.

Continuous yet not smooth at those points, it is a different creature from the smooth wave of sinx\sin x. The zeros are at x=nπx = n\pi.

Relation to the square wave

Computing the derivative produces a square wave.

ddxarcsin(sinx)=cosx1sin2x=cosxcosx=sgn(cosx)\begin{align*} \frac{d}{dx}\arcsin(\sin x) &= \frac{\cos x}{\sqrt{1-\sin^2 x}} \\ &= \frac{\cos x}{|\cos x|} = \operatorname{sgn}(\cos x) \end{align*}

So the derivative of a triangle wave is a square wave, and conversely integrating a square wave that alternates between +1+1 and 1-1 produces a triangle wave. Integrating a function with jumps yields a function with corners, and that correspondence is visible here.

Fourier series

arcsin(sinx)=4πk=0(1)k(2k+1)2sin((2k+1)x)\arcsin(\sin x) = \frac{4}{\pi}\sum_{k=0}^{\infty}\frac{(-1)^{k}}{(2k+1)^{2}}\sin\bigl((2k+1)x\bigr)

Only odd multiples of the frequency appear, and the coefficients decay as 1(2k+1)2\dfrac{1}{(2k+1)^{2}}.

WaveformSmoothnessDecay of the coefficients
Square wavehas jumps1n\dfrac{1}{n}
Triangle wavehas corners1n2\dfrac{1}{n^{2}}

The fall is quicker than for a square wave, so fewer terms give a good approximation. The general rule that integrating speeds up the decay of the coefficients by one step shows through here.

Applications

The triangle wave is one of the basic waveforms of a synthesizer, softer than a square wave and brighter than a sine, because its higher harmonics fall off as 1n2\dfrac{1}{n^{2}}. In electronics it is also compared against a constant voltage to generate a pulse-width-modulated signal.

  1. Triangle wave, Wikipedia