# Calculus magic

You have probably seen some version of this curve at some time or another:

The blue lines are drawn by putting $n$ evenly spaced points in the interval $[0,1]$ for both the horizontal and vertical axis and connecting them.

As $n$ approaches infinity, the question is, what is the area occupied by the blue lines? The area is clearly finite since the entire shape is bounded by a 1×1 square, but how much of that square is occupied?

Intuitively it might seem that the blue curve is a circle, however that intuition is wrong. In the above diagram, the red curve is the actual circle, and clearly the blue curve is outside the circle. But fortunately the area can be found with some calculus.

If we choose some point $(a,0)$ on the x-axis, then obviously that point is connected to point $(0,1-a)$ on the y-axis. The slope of this line is $\frac{a-1}{a}$ and the equation of this line is $y=\frac{a-1}{a}x+1-a$. More conveniently, we can this expression as $g(a,x)$, intuitively the line formed when we choose $a$ as our x-axis point.

Let $f(x)$ be the bounding curve for the blue lines. To find $f(x)$, we want to choose the value $a$, given $x$, so that $g(a,x)$ is maximized. To do this, we take the partial derivative $\frac{\partial y}{\partial a}$:

$\frac{\partial y}{\partial a} = x(\frac{a-a+1}{a^2})-1=\frac{x}{a^2}-1$

The optimal value of $a$ is the one for which $\frac{\partial y}{\partial a}=0$, so solving for $a$ we get $a=\sqrt{x}$. Then we have

$f(x) = g(\sqrt{x},x) = x \frac{\sqrt{x}-1}{\sqrt{x}}+1-\sqrt{x}$

$f(x)= 1+x-2\sqrt{x}$

Integrating $f(x)$ from 0 to 1 gives us the answer:

$\displaystyle \int_0^1 (1+x-2\sqrt{x}) dx = \frac{1}{6}$

## 3 thoughts on “Calculus magic”

1. Em says:

Hi! Thank you for your interesting blogg. I was wondering if you could explain something that is not obvious for me. You say that to find f(x) we have to find a that maximizes g(a,x). What does it mean exactly to maximize a straight line?

Like

1. Oh. What I meant wasn’t that g(a,x) itself is a straight line; rather if we ‘fix’ a and have the function y=g(a,x) as a function of just x, then we have a straight line. To maximize this would be to choose a so that y=g(a,x) is maximized at that point (again fixing a). Don’t know if what I said makes any sense xD

Like

2. Anonymous says:

Shouldn’t the point (a, 0) be connected to the point (0, 1-a)? What’s b?

Like