TITLE: "Perimeter" of the sine function
QUESTION [6 upvotes]: Given a sine function with certain parameters (period, amplitude) I would like a function to calculate its "perimeter", i.e. the length of the curve itself.
Everyday application: let's say we need to line a piece of corrugated iron, of which we have its dimensions, but we would need to know the "real length" of it, taking into account its foldings.
Thanks in advance,
cl.

REPLY [2 votes]: Imagine that you have an arbitrary function $f(x)$, and you want to compute the length of its representative curve on a given range $[a,b]$.
One way to do it would be to take $n+1$ points on the curve, equally spaced by an amount $\Delta x$: $P_0(a,f(a))$, $P_1(a+\Delta x,f(a+\Delta x)), \ldots, P_n(b,f(b))$, such that you have $n$ intervals, the sum of which approximates the length of the curve. You would have indeed:
$$L\simeq\sum_{k=1}^n|P_{k-1}P_k|$$
Now, the distance $|P_{k-1}P_k|$ between two consecutive points is simply:
$$|P_{k-1}P_k|=\sqrt{(x_k-x_{k-1})^2+(y_k-y_{k-1})^2}=\sqrt{\Delta x ^2+{\Delta y_k}^2}$$
You've set up your points such that $\Delta x$ is constant, but $\Delta y_k$ will obviously vary. And in fact, since $\Delta y_k$ represents the variation of $y$ on the small interval $k$, we can express it using the derivative of $f$:
$$f'(x_k)\simeq\dfrac{\Delta y_k}{\Delta x}$$
We can thus rewrite the approximate length of the curve as:
$$L\simeq\sum_{k=1}^n\sqrt{\Delta x^2+\left[f'(x_k)\Delta x\right]^2}=\sum_{k=1}^n\Delta x\sqrt{1+\left[f'(x_k)\right]^2}$$
The next step is to make this approximation as accurate as possible, and this is done by converting the sum into an integral, i.e. taking $\Delta x$ infinitesimal and $n$ infinite. Thus:
$$L=\int_a^bdx\sqrt{1+\left[f'(x)\right]^2}=\int_a^bdx\sqrt{1+\left(\dfrac{dy}{dx}\right)^2}$$
To answer your question, you can indeed figure out the length of a sine function (or indeed of any function) using the above formula.