"Perimeter" of the sine function 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.
 A: Let $y=A\sin\left(2\pi\dfrac xP\right)$.
The arc length is given by the integral
$$\int_{x_0}^{x_1}\sqrt{1+y'^2(x)}dx=\int_{x_0}^{x_1}\sqrt{1+\frac{4\pi^2A^2}{P^2}\cos^2\left(2\pi\dfrac{x}P\right)}dx.$$
The latter has no closed form with usual functions and requires the so-called elliptic integrals.
These functions are called complete or incomplete, depending on whether you cover whole periods of the sinusoid or not.

If you can tolerate an approximation, you could replace the sinusoid by arcs of hyperbolic cosine, which lead to an analytic solution.
$$y=\cosh(x)\to\int \sqrt{1+\sinh^2(x)}dx=\int\cosh(x)\,dx=\sinh(x)+C.$$
A: 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.
If it helps, here is a Desmos visualisation of the principle (similar to Riemann sum for integration):
https://www.desmos.com/calculator/o2okvkuvxg
A: $$
\text{arc length} = \int_{(x,y)=(x_0,y_0)}^{(x,y)=(x_1,y_1)} \sqrt{(dx)^2+(dy)^2}.
$$
If you have $y$ as a function of $x$, then this becomes
$$
\int_{x_0}^{x_1} \sqrt{1+\left(\frac{dy}{dx}\right)^2} \  dx.
$$
If $y=\sin x$, then this is
$$
\int_{x_0}^{x_1} \sqrt{1+\left(\frac{d}{dx}\sin x\right)^2} \  dx = \int_{x_0}^{x_1} \sqrt{1+\cos^2 x}\  dx.
$$
Over the whole period of the sine function, this is
$$
\int_0^{2\pi} \sqrt{1+\cos^2 x}\  dx.
$$
