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.
$$ \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. $$