I'm fairly novice at maths so please excuse my imperfect description of the problem at hand. I'm trying to find the formula that would calculate the length of the $y = \sin(\pi x)$ curve contained between to x points.
See this curve for reference, here with a $x$ range = $[0.2, 0.7]$: sin(πx) curve
I would like to know the distance on the red curve between $x = 0.2$ and $x = 0.7$.
As people have mentioned - indeed this problem screams out for Calculus; and in fact we have a formula for calculating the exact thing you are talking about - it's called the "arc length".
Generally, the arc length does not have a nice closed form (by closed form, I mean it cannot be written nicely in terms of other numbers we know, like ${\pi,e,\sqrt{2}}$ etc etc). In fact I believe this is one of those cases. Not to say it always won't have a nice answer, but with a lot of functions, it mostly doesn't.
Ultimately, if you just want a numerical value, you can simply approximate the arc length (to arbitrary precision) by "slicing up" the sine curve between ${x=0.2,0.7}$ into smaller and smaller slices and approximating it in each slice to be a straight line (being the hypotenuse of a right-angled triangle); the following graphic explains what I mean with $4$ slices for example:
And so the arc length overall can be approximated by using the Pythagorean theorem, and summing up those hypotenuses (do ${\sqrt{\Delta x^2 + \Delta y^2}}$ for each slice then add them up).
As you do more and more slices, the answer will be closer and closer to the true value (and each slice will obviously be becoming smaller). And this is essentially what Calculus does! It takes what's called the "limit" as we use more and more of these slices (and as a result the slices are getting closer and closer to $0$), and gives us a final answer at the end to what it's "approaching". If you take a look at the Calculus formula for arc length
$${\int_{x=a}^{x=b}\sqrt{1+\left(\frac{dy}{dx}\right)^2}dx}$$
you can see the similarity between what we were doing with the whole square root stuff and the Calculus answer. And that big long ${S}$ shaped symbol essentially means we are summing up pieces that are getting infinitely small (as these slices would). I didn't know whether you knew Calculus, so I tried to write this answer in such a way that it'd be comprehensible either way. If you do know Calculus - now you have a general formula for any function above you can use (as the formula suggests though, the function needs to be differentiable so it can be locally approximated to be linear. If you don't understand what this means, don't worry) :D. I hope this helps explain