### Squaring the Circular Functions

The circular functions occur throughout mathematics. Fourier showed that, under very general assumptions, an arbitrary function can be decomposed into components each of which is a circular function. The functions get their name from their use in defining a circle in parametric form: if $\displaystyle x = a\cos t \qquad\mbox{and}\qquad y = a\sin t$

then ${x^2 + y^2 = a^2}$, the usual equation for a circle in Cartesian coordinates. In the figure, we plot the familiar sinusoid, which has a period of ${2\pi}$. Step Function & Square Wave Function

Electrical engineers just love step-functions, which can be used to represent processes that are switched on at a specific time. Square-wave functions are also valuable in modelling processes that alternate between two states. One problem with these functions is that they have jump discontinuities, which can be difficult to handle in an analytical context where continuity and smoothness are expected. It is sometimes advantageous to replace them by functions that are continuous or even differentiable. The step function can be represented by the function ${H(x) = x/|x|}$. For ${x=0}$ we put ${H(x)=0}$. Alternatively, we may write ${H(x)= x/\sqrt{x^2}}$ , again with ${H(0)=0}$. This function can be approximated by various elementary analytical functions, for example ${\tanh(k x)}$. This function becomes steeper near the origin, coming closer to the step function as ${k}$ increases. Considering the square wave, the Fourier series converging to this gives approximations that converge to the correct solution. But the convergence is not uniform and there are spurious oscillations called Gibbs waves that can be problematical. It is desirable to have a series of functions that converge to a square wave, and that have attractive analytical properties. The square-wave function can be approximated by a sine function. Indeed, if we plot the function ${f(x) = \sin x/|\sin x|}$ we see that it is just a square-wave. To get a smooth approximation to this, we can consider the sine function raised to a small fractional power: ${(\sin x)^{1/n}}$. We must be careful: when ${\sin x}$ is negative, this is imaginary, so we use $\displaystyle (\sin x/|\sin x|) \times |\sin x|^{1/n}$

The first component looks after the sign while the second becomes closer to 1 as ${n}$ increases. Elliptic Functions

The sine functions raised to small fractional powers approach the square wave function, but they are singular at the points where they vanish. We can obtain analytical approximations to the square wave by using Jacobian elliptic functions. The function ${y=\mathrm{sn}\,x}$ is defined to be a solution of the ode $\displaystyle \left(\frac{\mathrm{d}y}{\mathrm{d}x}\right)^2 = (1-y^2)(1-k^2 y^2) \,.$

with appropriate initial conditions. For ${k=0}$ we have ${\mathrm{sn}\,x=\sin x}$. As ${k}$ increases from 0 to 1, this function changes character, becoming flatter near its maxima and minima as ${k}$ increases. The notation ${m=k^2}$ is often used, with ${m}$ called the modulus.

The function ${\mathrm{sn}_m(x)}$ has period ${4K(m)}$, where ${K(m)}$ is the complete elliptic integral of the first kind. To ensure functions having period of ${2\pi}$, we consider the functions ${y_m(x)=\mathrm{sn}_m(2K x/\pi)}$. The results are plotted in the following figure for several values of ${m}$. Thus, by using Jacobian elliptic functions we obtain a beautiful sequence of analytical approximations to the square wave.

This is a nice way to square the circular functions!