This is my first question on StackExchange, and i have very little knowledge of mathematics to tell if it is a physics issue or a math issue, so any info will be useful.
Main question
Let's say i want to find the length of a line. Take the following image for reference (1): it is a right triangle, and a naive/wrong way of finding the length of the hypotenuse. Is simple to show how this way of thinking can go wrong with a counterexample, if both smaller sides of the triangle have length $a$, the hypotenuse has length $a\sqrt{2}$. While the "zigzagging" gives the answer $2a$.
Again, i have a shamefully poor background on Real Analysis, so i could not explain the following main question:
How can one of these two "curvy" lines approximate the other?
My physics professor used this "zigzagging" argument (but with curves) to show how to calculate the variation of entropy in a thermodynamic process. And i just could not stop thinking about this problem in the first figure.
Some context
I had this problem in my mind when i saw this on my thermodynamics book (the book is in Portuguese), it showed how to approximate a small line element with fragments that make up a small Carnot Cycle. I don't think this is important to the discussion, so i will just put info regarding the context, just for curiosity: page 22 of this book (there should be an equivalent in English literature).