# Uniform convergence - Length of graph

#### mathmari

##### Well-known member
MHB Site Helper
Hey!!

We define the sequence of functions $f_n:[0,1]\rightarrow \mathbb{R}$ by $$f_{n+1}(x)=\begin{cases}0 & \text{ if } x\in \left[ 0, \frac{1}{2n+3}\right ]\\ |2(n+1)x-1| & \text{ if } x\in \left [\frac{1}{2n+3}, \frac{1}{2n+1}\right ] \\ f_n(x) & \text{ if } x\in \left [\frac{1}{2n+1}, 1\right ] \end{cases}$$ where $f_1$ is given by $$f_1(x)=\begin{cases}0 & \text{ if } x\in \left [0, \frac{1}{3}\right ]\\ |2x-1| & \text{ if } x\in \left [\frac{1}{3}, 1\right ]\end{cases}$$

(a) Draw the graphs of the functions $f_n$.
(b) Show that the sequence of functions converges uniformly to a continuous function $f:[0,1]\rightarrow \mathbb{R}$.
(c) Calculate the lengths of the graphs of the functions $f_n$.
(d) Show that the graph of $f$ is not a rectifiable curve.

Could you give me a hint for (a) ? How do we draw these graphs?

At (b) we first show that $f_n$ converges pointwise to a function $f$, right? Taking the limit $n\rightarrow \infty$ then do we look at the intervals that we get at the definition of $f_{n+1}$ ?

Last edited:

#### Klaas van Aarsen

##### MHB Seeker
Staff member
Could you give me a hint for (a) ? How do we draw these graphs?
Hey mathmari !!

It's a bit awkward to draw them with the usual online graphing tools.
Instead we can use for instance sage to do it.
It is online available on for instance https://cocalc.com.
This page shows how to plot the Cantor set, which is similar to what we want.

At (b) we first show that $f_n$ converges pointwise to a function $f$, right? Taking the limit $n\rightarrow \infty$ then do we look at the intervals that we get at the definition of $f_{n+1}$ ?
The function doesn't change anymore on $\left[\frac{1}{2n+1},\,1\right]$ does it?

#### mathmari

##### Well-known member
MHB Site Helper
The function doesn't change anymore on $\left[\frac{1}{2n+1},\,1\right]$ does it?
Do you mean because for $n\rightarrow \infty$ we get the interval $[0,1]$ ?

#### Klaas van Aarsen

##### MHB Seeker
Staff member
Do you mean because for $n\rightarrow \infty$ we get the interval $[0,1]$ ?
Yes.
So for any interval $(\varepsilon, 1]$ we can find that the function does not change for sufficiently large $n$.

Btw, I could plot the function with sage and the following code:
Code:
def f(x, n):
if n == 1:
if x <= 1/3:
return 0
if x <= 1:
return abs(2 * x - 1)
return 0
if x <= 1 / (2 * n + 3):
return 0
if x <= 1 / (2 * n + 1):
return abs(2 * (n + 1) * x - 1)
if x <= 1:
return f(x, n - 1)
return 0

plot(lambda x: f(x, 100))

Last edited:

#### mathmari

##### Well-known member
MHB Site Helper
Yes.
So for any interval $(\varepsilon, 1]$ we can find that the function does not change for sufficiently large $n$.
Does that mean that the function is then $0$ everywhere, as in the first interval?

#### Klaas van Aarsen

##### MHB Seeker
Staff member
Does that mean that the function is then $0$ everywhere, as in the first interval?
No, the function is generally not zero.

#### mathmari

##### Well-known member
MHB Site Helper
No, the function is generally not zero.
But when $n$ is large enough what is then the function? I got stuck right now.

#### Klaas van Aarsen

##### MHB Seeker
Staff member
But when $n$ is large enough what is then the function? I got stuck right now.
How about we draw $f_1, f_2,$ and $f_3$ as requested in part (a)?
We can use pencil and paper.

#### mathmari

##### Well-known member
MHB Site Helper
How about we draw $f_1, f_2,$ and $f_3$ as requested in part (a)?
We can use pencil and paper.
We have $$f_1(x)=\begin{cases}0 & \text{ if } x\in \left [0, \frac{1}{3}\right ]\\ |2x-1| & \text{ if } x\in \left [\frac{1}{3}, 1\right ]\end{cases}$$ and the graph is:

$$f_{2}(x)=\begin{cases}0 & \text{ if } x\in \left[ 0, \frac{1}{5}\right ]\\ |4x-1| & \text{ if } x\in \left [\frac{1}{5}, \frac{1}{3}\right ] \\ f_1(x) & \text{ if } x\in \left [\frac{1}{3}, 1\right ] \end{cases}=\begin{cases}0 & \text{ if } x\in \left[ 0, \frac{1}{5}\right ]\\ |4x-1| & \text{ if } x\in \left [\frac{1}{5}, \frac{1}{3}\right ] \\ |2x-1| & \text{ if } x\in \left [\frac{1}{3}, 1\right ] \end{cases}$$
and the graph is:

$$f_{3}(x)=\begin{cases}0 & \text{ if } x\in \left[ 0, \frac{1}{7}\right ]\\ |6x-1| & \text{ if } x\in \left [\frac{1}{7}, \frac{1}{5}\right ] \\ f_2(x) & \text{ if } x\in \left [\frac{1}{5}, 1\right ] \end{cases}=\begin{cases}0 & \text{ if } x\in \left[ 0, \frac{1}{7}\right ]\\ |6x-1| & \text{ if } x\in \left [\frac{1}{7}, \frac{1}{5}\right ] \\ |4x-1| & \text{ if } x\in \left [\frac{1}{5}, \frac{1}{3}\right ] \\ |2x-1| & \text{ if } x\in \left [\frac{1}{3}, 1\right ] \end{cases}$$
and the graph is:

So that will be the form of the graph of the functions $f_n$ (as we get at the plot at sage).
So is the functon $f$ of the form $$\begin{cases}|2x-1| \\ |4x-1| \\ |6x-1| \\ \ldots\end{cases}$$ ?

Last edited:

#### mathmari

##### Well-known member
MHB Site Helper
Or do we have for $n\rightarrow \infty$ that $f_n\rightarrow x$ ?
That means that $f_n$ converges pointwise to $f(x)=x$, $x\in [0,1]$, right?
Now we have to check if $\sup |f_n(x)-f(x)|\rightarrow 0$, right?

We have that \begin{equation*}|f_n(x)-f(x)|= \begin{cases}|0-x| & \text{ if } x\in \left[ 0, \frac{1}{2(n-1)+3}\right ]\\ \left ||2nx-1|-x\right | & \text{ if } x\in \left [\frac{1}{2(n-1)+3}, \frac{1}{2(n-1)+1}\right ] \\ \left |f_{n-1}(x)-x\right | & \text{ if } x\in \left [\frac{1}{2(n-1)+1}, 1\right ] \end{cases}= \begin{cases}x & \text{ if } x\in \left[ 0, \frac{1}{2n+1}\right ]\\ \left ||2nx-1|-x\right | & \text{ if } x\in \left [\frac{1}{2n+1}, \frac{1}{2n-1}\right ] \\ \left |f_{n-1}(x)-x\right | & \text{ if } x\in \left [\frac{1}{2n-1}, 1\right ] \end{cases}\end{equation*}

How do we get the supremum? Is the supremum at the first case because at the other we have $x$ and subtraction but in the first case we have just $x$ ?

Last edited:

#### mathmari

##### Well-known member
MHB Site Helper
As for (c) are the lengths of $f_n$ equal to \begin{align*}s&=\int_0^1\sqrt{1+\left [f_n'(x)\right ]^2}\, dx\\ & =\int_0^{\frac{1}{2n+1}}\sqrt{1+\left [f_n'(x)\right ]^2}\, dx+\int_{\frac{1}{2n+1}}^{\frac{1}{2n-1}}\sqrt{1+\left [f_n'(x)\right ]^2}\, dx+\int_{\frac{1}{2n-1}}^1\sqrt{1+\left [f_n'(x)\right ]^2}\, dx \\ & =\int_0^{\frac{1}{2n+1}}\sqrt{1+\left [0\right ]^2}\, dx+\int_{\frac{1}{2n+1}}^{\frac{1}{2n-1}}\sqrt{1+\left [2n\right ]^2}\, dx+\int_{\frac{1}{2n-1}}^1\sqrt{1+\left [f_{n-1}'(x)\right ]^2}\, dx \\ & =\int_0^{\frac{1}{2n+1}}1\, dx+\int_{\frac{1}{2n+1}}^{\frac{1}{2n-1}}\sqrt{1+4n^2}\, dx+\int_{\frac{1}{2n-1}}^1\sqrt{1+\left [f_{n-1}'(x)\right ]^2}\, dx \\ & =\left [x\right ]_0^{\frac{1}{2n+1}}+\sqrt{1+4n^2}\cdot \left [x\right ]_{\frac{1}{2n+1}}^{\frac{1}{2n-1}}+\int_{\frac{1}{2n-1}}^1\sqrt{1+\left [f_{n-1}'(x)\right ]^2}\, dx \\ & =\frac{1}{2n+1}+\sqrt{1+4n^2}\cdot \left (\frac{1}{2n-1}-\frac{1}{2n+1}\right )+\int_{\frac{1}{2n-1}}^1\sqrt{1+\left [f_{n-1}'(x)\right ]^2}\, dx \\ & =\frac{1}{2n+1}+\sqrt{1+4n^2}\cdot \frac{1}{4n^2-1}+\int_{\frac{1}{2n-1}}^1\sqrt{1+\left [f_{n-1}'(x)\right ]^2}\, dx \end{align*}
Or do we have to calculate for specific $n$ and then derive a formula?

#### Klaas van Aarsen

##### MHB Seeker
Staff member
So that will be the form of the graph of the functions $f_n$ (as we get at the plot at sage).
So is the functon $f$ of the form $$\begin{cases}|2x-1| \\ |4x-1| \\ |6x-1| \\ \ldots\end{cases}$$ ?
Yep.

My sage graph for $n=100$ is:

MHB Site Helper

#### Klaas van Aarsen

##### MHB Seeker
Staff member
Or do we have for $n\rightarrow \infty$ that $f_n\rightarrow x$ ?
That means that $f_n$ converges pointwise to $f(x)=x$, $x\in [0,1]$, right?
Now we have to check if $\sup |f_n(x)-f(x)|\rightarrow 0$, right?
We can see from the graph that $f_n$ does not converge to $x\mapsto x$.
Instead it's a sawtooth function that gets more teeth at small values when $n$ increases. The teeth at higher values remain unchanged.
We can also see that $x\mapsto x$ is an upper bound and $x\mapsto 0$ is a lower bound.

Suppose $f$ be the unspecified function that $f_n$ converges to.
Then for any $0 <\delta < 1$ there is an $N$ such that for any $n>N$ and $x$ in $(\delta, 1]$ we have that $f_n(x)=f(x)$.
And for any $x$ in $[0,\delta]$ we have that $0\le f_n(x) \le \delta$, so $|f(x)-f_n(x)|\le \delta$.
Can we find uniform convergence from that?

#### mathmari

##### Well-known member
MHB Site Helper
We can see from the graph that $f_n$ does not converge to $x\mapsto x$.
Instead it's a sawtooth function that gets more teeth at small values when $n$ increases. The teeth at higher values remain unchanged.
We can also see that $x\mapsto x$ is an upper bound and $x\mapsto 0$ is a lower bound.

Suppose $f$ be the unspecified function that $f_n$ converges to.
Then for any $0 <\delta < 1$ there is an $N$ such that for any $n>N$ and $x$ in $(\delta, 1]$ we have that $f_n(x)=f(x)$.
And for any $x$ in $[0,\delta]$ we have that $0\le f_n(x) \le \delta$, so $|f(x)-f_n(x)|\le \delta$.
Can we find uniform convergence from that?
Ah so the supremum of $|f(x)-f_n(x)|$ is the maximum of $\delta$ and $0$, so $\delta$, or not? This $\delta$ is a fraction 1 to a number including n and if n gets large enough the fraction goes to 0, which implies uniform convergence, right?

#### Klaas van Aarsen

##### MHB Seeker
Staff member
As for (c) are the lengths of $f_n$ equal to \begin{align*}s&=\int_0^1\sqrt{1+\left [f_n'(x)\right ]^2}\, dx\end{align*}
Or do we have to calculate for specific $n$ and then derive a formula?
We can see from the graph that $f_n$ is not differentiable: it has corners and a jump.
That is, at every interval boundary it is not differentiable.
Instead we should find the lengths within each interval and sum them.
Can we find a series that sums those lengths?

#### mathmari

##### Well-known member
MHB Site Helper
We can see from the graph that $f_n$ is not differentiable: it has corners and a jump.
That is, at every interval boundary it is not differentiable.
Instead we should find the lengths within each interval and sum them.
Can we find a series that sums those lengths?
Do we not write it as the sum I wrote it in #11 ?
Do you mean an other sum?

#### Klaas van Aarsen

##### MHB Seeker
Staff member
Ah so the supremum of $|f(x)-f_n(x)|$ is the maximum of $\delta$ and $0$, so $\delta$, or not?
It's not the supremum.
Instead it's an upper bound. The supremum must be somewhere between $0$ and $\delta$, and we don't have to know what it is exactly. It suffices that it is $\le \delta$.

This $\delta$ is a fraction 1 to a number including n and if n gets large enough the fraction goes to 0, which implies uniform convergence, right?
True. Perhaps we should be a bit more formal though.
Something like: for any $\varepsilon > 0$ there is an $N$ such that...
... so that for any $x$ in $[0,1]$ we have that $\sup|f_n(x) -f(x)| < \varepsilon$.

#### Klaas van Aarsen

##### MHB Seeker
Staff member
Do we not write it as the sum I wrote it in #11 ?
Do you mean an other sum?
Ah right.
I triggered on the use of $f_n'$ and the use of an integral on a domain with missing points...
I guess we can do that if we implicitly leave out the points of the domain where $f_n'$ is undefined, and if we use a more general integral than the Riemann integral.

Then it looks as if your $s$ is actually an $s_n$, and we have to find what it converges to.
Oh, and I didn't check your calculations yet, but the approach seems correct.

#### mathmari

##### Well-known member
MHB Site Helper
Perhaps we should be a bit more formal though.
Something like: for any $\varepsilon > 0$ there is an $N$ such that...
... so that for any $x$ in $[0,1]$ we have that $\sup|f_n(x) -f(x)| < \varepsilon$.
I got stuck right now. So we don't need to find a specific $f$ that $f_n$ converges pointwise?
We just describe what $f$ has to look like from the graph of $f_n$ ?

We have that the graph of $f_n$ is between $y=x$ and $y=0$. So does $f$ be also there?

#### mathmari

##### Well-known member
MHB Site Helper
Ah right.
I triggered on the use of $f_n'$ and the use of an integral on a domain with missing points...
I guess we can do that if we implicitly leave out the points of the domain where $f_n'$ is undefined, and if we use a more general integral than the Riemann integral.

Then it looks as if your $s$ is actually an $s_n$, and we have to find what it converges to.
Oh, and I didn't check your calculations yet, but the approach seems correct.
I tried some examples for $n$.

For $n=1$ :
\begin{align*}s_1&=\int_0^1\sqrt{1+\left [f_n'(x)\right ]^2}\, dx\\ & = \int_0^{\frac{1}{3}}\sqrt{1+\left [f_n'(x)\right ]^2}\, dx+\int_{\frac{1}{3}}^1\sqrt{1+\left [f_n'(x)\right ]^2}\, dx\\ & = \int_0^{\frac{1}{3}}\sqrt{1+\left [0\right ]^2}\, dx+\int_{\frac{1}{3}}^1\sqrt{1+\left [2\right ]^2}\, dx \\ & = \int_0^{\frac{1}{3}}\sqrt{1}\, dx+\int_{\frac{1}{3}}^1\sqrt{1+4}\, dx\\ & = \int_0^{\frac{1}{3}}1\, dx+\int_{\frac{1}{3}}^1\sqrt{5}\, dx\\ & = \frac{1}{3}+\sqrt{5}\left (1-\frac{1}{3}\right ) \\ & = \frac{1}{3}+\sqrt{5}\cdot \frac{2}{3} \end{align*}

For $n=2$ :
\begin{align*}s_2&=\int_0^1\sqrt{1+\left [f_n'(x)\right ]^2}\, dx\\ & = \int_0^{\frac{1}{5}}\sqrt{1+\left [f_n'(x)\right ]^2}\, dx+\int_{\frac{1}{5}}^{\frac{1}{3}}\sqrt{1+\left [f_n'(x)\right ]^2}\, dx+\int_{\frac{1}{3}}^1\sqrt{1+\left [f_n'(x)\right ]^2}\, dx\\ & = \int_0^{\frac{1}{5}}\sqrt{1+\left [0\right ]^2}\, dx+\int_{\frac{1}{5}}^{\frac{1}{3}}\sqrt{1+\left [4\right ]^2}\, dx+\int_{\frac{1}{3}}^1\sqrt{1+\left [2\right ]^2}\, dx \\ & = \int_0^{\frac{1}{5}}\sqrt{1+0}\, dx+\int_{\frac{1}{5}}^{\frac{1}{3}}\sqrt{1+16}\, dx+\int_{\frac{1}{3}}^1\sqrt{1+4}\, dx \\ & = \int_0^{\frac{1}{5}}1\, dx+\int_{\frac{1}{5}}^{\frac{1}{3}}\sqrt{17}\, dx+\int_{\frac{1}{3}}^1\sqrt{5}\, dx \\ & = \frac{1}{5}+\sqrt{17}\left (\frac{1}{3}-\frac{1}{5}\right )+\sqrt{5}\left (1-\frac{1}{3}\right ) \\ & = \frac{1}{5}+\sqrt{17}\cdot \frac{2}{15}+\sqrt{5}\cdot \frac{2}{3} \end{align*}

For $n=3$ :
\begin{align*}s_3&=\int_0^1\sqrt{1+\left [f_n'(x)\right ]^2}\, dx\\ & = \int_0^{\frac{1}{7}}\sqrt{1+\left [f_n'(x)\right ]^2}\, dx+\int_{\frac{1}{7}}^{\frac{1}{5}}\sqrt{1+\left [f_n'(x)\right ]^2}\, dx+\int_{\frac{1}{5}}^{\frac{1}{3}}\sqrt{1+\left [f_n'(x)\right ]^2}\, dx+\int_{\frac{1}{3}}^1\sqrt{1+\left [f_n'(x)\right ]^2}\, dx\\ & = \int_0^{\frac{1}{7}}\sqrt{1+\left [0\right ]^2}\, dx+\int_{\frac{1}{7}}^{\frac{1}{5}}\sqrt{1+\left [6\right ]^2}\, dx+\int_{\frac{1}{5}}^{\frac{1}{3}}\sqrt{1+\left [4\right ]^2}\, dx+\int_{\frac{1}{3}}^1\sqrt{1+\left [2\right ]^2}\, dx \\ & = \int_0^{\frac{1}{7}}\sqrt{1}\, dx+\int_{\frac{1}{7}}^{\frac{1}{5}}\sqrt{37}\, dx+\int_{\frac{1}{5}}^{\frac{1}{3}}\sqrt{17}\, dx+\int_{\frac{1}{3}}^1\sqrt{5}\, dx \\ & = \frac{1}{7}+\sqrt{37}\cdot \frac{2}{35}+\sqrt{17}\cdot \frac{2}{15}+\sqrt{5}\cdot \frac{2}{3}\end{align*}

Does this help us to check where $s_n$ converges?

#### mathmari

##### Well-known member
MHB Site Helper
As for the uniform convergence, can we not say the following?

From the graph of part (a) we see that for $n\rightarrow \infty$ the $f_n$ converges to a function $f(x)$ with $0\leq f(x)\leq x$, $x\in [0,1]$.

Then we have that:
\begin{equation*}|f_n(x)-f(x)|\leq \begin{cases}|0-x| & \text{ if } x\in \left[ 0, \frac{1}{2(n-1)+3}\right ]\\ \left ||2nx-1|-x\right | & \text{ if } x\in \left [\frac{1}{2(n-1)+3}, \frac{1}{2(n-1)+1}\right ] \\ \left |f_{n-1}(x)-x\right | & \text{ if } x\in \left [\frac{1}{2(n-1)+1}, 1\right ] \end{cases}= \begin{cases}x & \text{ if } x\in \left[ 0, \frac{1}{2n+1}\right ]\\ \left ||2nx-1|-x\right | & \text{ if } x\in \left [\frac{1}{2n+1}, \frac{1}{2n-1}\right ] \\ \left |f_{n-1}(x)-x\right | & \text{ if } x\in \left [\frac{1}{2n-1}, 1\right ] \end{cases}\end{equation*}
So we get \begin{equation*}\sup_{x\in [0,1]}|f_n(x)-f(x)|\leq \frac{1}{2n+1}\end{equation*}
The right side goes to $0$ if $n\rightarrow \infty$.

Therefore $f_n$ converges uniformly to the continuous function $f(x)$.