Search This Blog

Mean value theorem proof illustrated

I was rereading recently the proof of the mean value theorem from math real analysis.

This led me to the idea to generate some drawing which nicely illustrates the idea of the proof. Let's first restate the mean value theorem.

Theorem: If the function $f$ is defined and continuous in the closed interval $[a,b]$ and is differentiable in the open interval $(a,b)$, then there exists a point $\theta$ which is strictly between $a$ and $b$ i.e. $a \lt \theta \lt b$, such that 

$$f'(\theta) = \frac{f(b)-f(a)}{b-a} \tag{1}$$

The proof constructs a function and I was wondering what the idea is behind that function. So I finally understood that and wanted to illustrate it here via some nice drawing. It took me some time to find a good looking function but OK... I finally picked this one: 

$$f(x) = \sin(t) - \sin^2(t/2) + \cos^3(t/5) \tag{2}$$

Here is the drawing I generated. 

The given function $f(x)$ is shown in red in the figure above.

The proof of the theorem is quite nice. Main role in it plays the the line which connects the two endpoints of the graph of $f(x)$ i.e. the points $(a,f(a))$ and $(b,f(b))$. This line is represented by the function

$$g(x) = f(a) + \frac{f(b)-f(a)}{b-a}(x-a) \tag{3}$$ 

The line is shown in green in the figure above.

The proof then goes on to construct the function $h(x) = f(x)-g(x)$ and for this one it can be easily seen that $h(a)=h(b)=0$. The proof then applies Rolle's theorem to the function $h$ to get the desired result. 

So I was wondering how this function $h(x) $looks like. It is shown in deep sky blue in the figure above. The interesting thing about this function $h(x)$ is that it measures (at each point $x$) what the difference is between $f(x)$ and $g(x)$. 

In simple words this can be formulated in 2 different ways:  
a) At any value of $x$ the point $(x,h(x))$ is as far from the X axis, as $(x,f(x))$ is from $(x,g(x))$. 
This follows from the fact that: $h(x) = f(x) - g(x)$ which can be informally stated as blue = red - green. 
b) At any value of $x$ the point $(x,f(x))$ is as far from $(x,h(x))$, as $(x,g(x))$ is from the X axis.
This follows from the fact that: $f(x) - h(x) = g(x)$ which can be informally stated as red blue = green.

The function $f(x) = x^x$

Let us look at this function 

$$f(x) = x^x \tag{1}$$

and try to find its derivative for real values of $x$. 

Before this we should mention that this function is well defined only when $x \gt 0$. 

In other words... to avoid any complications we are looking at this function only for positive values of $x$. 

I. How do we go about finding the derivative $f'(x) = (x^x)'$ ? 

Well, we will use the following identity 

$$a^x = e^{x \cdot \ln a} \tag{2}$$

which is well-known from high school math and which holds true for any $a \gt 0$ and any $x \in \mathbb{R}$. 

Substituting $a = x$ in this identity we subsequently get 

$$f(x) = x^x = e ^ {x \cdot \ln x}$$ 

$$f'(x) = e ^ {x \cdot \ln x} \cdot (x \cdot \ln x)'$$ 

$$f'(x) = e ^ {x \cdot \ln x} \cdot (1 \cdot \ln x + x \cdot \frac{1}{x})$$ 

$$f'(x) = e ^ {x \cdot \ln x} \cdot (\ln x + 1)$$ 

$$f'(x) = x ^ x \cdot (\ln x + 1) \tag{3}$$ 

The last equation $(3)$ gives us the derivative which we wanted to find. 

In the above derivation we used several simple facts from math analysis. 

$$(e^x)' = e^x$$

$$(f(g(x)))' = f'(g(x)) \cdot g'(x)$$

$$(u(x) \cdot v(x))' = u'(x) \cdot v(x) + u(x) \cdot v'(x)$$ 

Finally let us restate the above established formula.   

$$ \large { (x^x)' = x ^ x \cdot (\ln x + 1) } \tag{4}$$ 

II. How do we find $\displaystyle{ \lim_{x \to 0^{+}} f(x) } = \displaystyle{ \lim_{x \to 0^{+}} x^x }$ ?

I think the easiest way of finding this limit which I have seen is by letting $x=e^{-t}$ where $t$ is some very large positive number. Then we easily get the following. 

$$\lim_{x \to 0^{+}} f(x) = \lim_{x \to 0^{+}} x^x = \lim_{x \to 0^{+}} e ^ {x \cdot \ln x} = \lim_{x \to 0^{+}} e ^ {(\ln x) \cdot x} =  $$

$$ = \lim_{t \to \infty} e^{(-t) \cdot e^{-t} } = \lim_{t \to \infty} e^{ \frac{(-t)}{e^{t}} } = e ^ {\lim_{t \to \infty} \frac{(-t)}{e^{t} } } = e^0 = 1 $$

Here the main fact which we used was that  

$$\lim_{t \to \infty} \frac{(-t)}{e^{t} }  = 0$$ 

which is quite obvious given that the numerator is a polynomial of $t$ and the denominator is the exponential function $e^t$.  

This way we have just calculated this quite remarkable limit 

$$ \large \lim_{x \to 0^{+}} x^x = 1 \tag{5}$$ 

Finally... here is a video demonstrating nicely an informal numerical approach to finding the same limit What is 0 to the power of 0?

Euler's identity for $\frac{sin(x)}{x}$

Here is this famous identity due to Euler.

$$ \frac{\sin x}{x} = \prod_{k=1}^{\infty} \cos \left(\frac{x}{2^k} \right) \tag{1}$$

This holds true for every $x \ne 0$.

Let's prove it.


$$ S(n) = \prod_{k=1}^{n} \cos \left(\frac{x}{2^k} \right) \tag{2}$$

Multiplying the two sides by $sin{\frac{x}{2^n}}$ we sequentially get:

$$ sin{\frac{x}{2^n}} \cdot S(n) = sin{\frac{x}{2^{n}}} \cdot \prod_{k=1}^{n} \cos \left(\frac{x}{2^k} \right) $$
$$ sin{\frac{x}{2^n}} \cdot S(n) = sin{\frac{x}{2^{n-1}}} \cdot \frac{1}{2^1} \cdot \prod_{k=1}^{n-1} \cos \left(\frac{x}{2^k} \right) $$
$$ sin{\frac{x}{2^n}} \cdot S(n) = sin{\frac{x}{2^{n-2}}} \cdot \frac{1}{2^2} \cdot \prod_{k=1}^{n-2} \cos \left(\frac{x}{2^k} \right) $$
$$ ... $$
$$ sin{\frac{x}{2^n}} \cdot S(n) = sin{\frac{x}{2^{1}}} \cdot \frac{1}{2^{n-1}} \cdot \prod_{k=1}^{1} \cos \left(\frac{x}{2^k} \right) $$

The last one obviously gives us:

$$ sin{\frac{x}{2^n}} \cdot S(n) = \frac{1}{2^{n}} \cdot sin(x) \tag{2}$$

which can be easily reworked to:

$$\large{ \frac{sin{\frac{x}{2^n}}}{\frac{x}{2^n}} \cdot S(n) = \frac{sin(x)}{x}} \tag{3}$$

Now in $(3)$ when we take the limit as ${n\to\infty}$ while using that

$$\lim_{u \to 0} \frac{sin(u)}{u} = 1$$

we get equality $(1)$ which is what we wanted to prove.

Trigonometric identities

1) Even/Odd function identities

$$\sin(-\alpha) = -\sin\alpha \tag{1.1}$$
$$\cos(-\alpha) = \cos\alpha \tag{1.2}$$
$$\tan(-\alpha) = -\tan\alpha \tag{1.3}$$
$$\cot(-\alpha) = -\cot\alpha \tag{1.4}$$

2) Sum/Addition identities

$$\sin(\alpha + \beta) = \sin\alpha\cos\beta + \cos\alpha\sin\beta \tag{2.1}$$
$$\sin(\alpha - \beta) = \sin\alpha\cos\beta - \cos\alpha\sin\beta \tag{2.2}$$
$$\cos(\alpha + \beta) = \cos\alpha\cos\beta - \sin\alpha\sin\beta \tag{2.3}$$
$$\cos(\alpha - \beta) = \cos\alpha\cos\beta + \sin\alpha\sin\beta \tag{2.4}$$

$$\tan(\alpha + \beta) = \frac{\tan\alpha+\tan\beta}{1-\tan\alpha\tan\beta}\tag{2.5}$$

$$\cot(\alpha + \beta) = \frac{\cot\alpha\cot\beta-1}{\cot\alpha+\cot\beta}\tag{2.6}$$

3) Sum to product identities

$$ \sin\alpha + \sin\beta = 2 \sin\frac{\alpha+\beta}{2}\cos\frac{\alpha-\beta}{2} \tag{3.1}$$
$$ \sin\alpha - \sin\beta = 2 \sin\frac{\alpha-\beta}{2}\cos\frac{\alpha+\beta}{2} \tag{3.2}$$

$$ \cos\alpha + \cos\beta = 2 \cos\frac{\alpha+\beta}{2}\cos\frac{\alpha-\beta}{2} \tag{3.3}$$

$$ \cos\alpha - \cos\beta = -2 \sin\frac{\alpha+\beta}{2}\sin\frac{\alpha-\beta}{2} \tag{3.4}$$

4) Product to sum identities

$$\sin\alpha\sin\beta = \frac{1}{2}[\cos(\alpha-\beta) - \cos(\alpha+\beta)] \tag{4.1}$$

$$\cos\alpha\cos\beta = \frac{1}{2}[\cos(\alpha-\beta) + \cos(\alpha+\beta)] \tag{4.2}$$

$$\sin\alpha\cos\beta = \frac{1}{2}[\sin(\alpha+\beta) + \sin(\alpha-\beta)] \tag{4.3}$$

5) Double-angle identities

$$\sin 2 \alpha  = 2 \sin\alpha \cos\alpha \tag{5.1}$$

$$\cos 2 \alpha  = \cos^2\alpha - \sin^2\alpha \tag{5.2}$$

Fun problem on Ceva's theorem


Given is $\Delta ABC$. The points $D \in BC$, $E \in CA$, $F \in AB$ are such that the lines $AD,BE,CF$ are concurrent. 

$A'$ - midpoint of $BC$   
$B'$ - midpoint of $CA$   
$C'$ - midpoint of $AB$   
$D'$ - midpoint of $AD$  
$E'$ - midpoint of $BE$  
$F'$ - midpoint of $CF$  

Prove that the lines 

$A'D', B'E', C'F'$ are also concurrent (i.e. that they pass through a common point).


It is crucial to come up with a nice realistic drawing here.

Also, it is important to realize that:
a) $A', F', B'$ are on one line
b) $B', D', C'$ are on one line
c) $C', E', A'$ are on one line

From Ceva's theorem for triangle $ABC$ we get:
$$\frac{AF}{FB}\frac{BD}{DC}\frac{CE}{EA} = 1 \tag{1}$$

Now the trick is to realize that:
$$\frac{B'F'}{F'A'} = \frac{AF}{FB} \tag{2}$$   
$$\frac{C'D'}{D'B'} = \frac{BD}{DC} \tag{3}$$ 
$$\frac{A'E'}{E'C'} = \frac{CE}{EA} \tag{4}$$ 

Why is this so? 

Because $B'C' || BC$   , $C'A' || CA$ and  $A'B' || AB$ 
so these relations follow from the Intercept theorem.   

Multiplying the last 3 equations and using $(1)$ we get:

$$\frac{B'F'}{F'A'}\frac{C'D'}{D'B'}\frac{A'E'}{E'C'} = \frac{AF}{FB}\frac{BD}{DC}\frac{CE}{EA} = 1$$ 


$$\frac{B'F'}{F'A'}\frac{A'E'}{E'C'}\frac{C'D'}{D'B'} = 1 \tag{5}$$

Now using the converse Ceva's theorem (for the triangle $A'B'C'$ and for the points $D', E', F'$), we can conclude from $(5)$ that the three lines  $A'D', B'E', C'F'$ intersect at a single/common point. This is what we had to prove hence the problem is solved.     

Klein bottle mystery

In the book "Basic Topology" by M.A.Armstrong I found an explanation about how to construct a Klein bottle. I had to reread it 5 times and I was still not quite convinced. I am retelling it here.

Begin with a sphere, remove two discs from it, and add a Möbius strip in their places. 
A Möbius strip has after all a single circle as boundary, and all that we are asking 
is that the points of its boundary circle be identified with those of the boundary 
circle of the hole in the sphere. One must imagine this identification taking place 
in some space where there is plenty of room (euclidean four-dimensional space will do). 
This cannot be realized in three dimensions without having each Möbius strip 
intersect itself. The resulting closed surface is called the Klein bottle. 

I was scratching my head around how this procedure actually produces a Klein bottle until I found this question in MathSE.


This picture there in one of the answers is really really nice, it really shows what happens if we cut a Klein bottle in half - we really get two Möbius strips as a result. The cut is done by a plane "parallel to the handle" which cuts the bottle in two symmetric parts.

So... it's really for a reason they say "a picture is worth a thousand words".

How to solve a quadratic equation?

This post comes to demonstrate the support for $\LaTeX$ available in Blogger.

A quadratic equation is an equation of the form
$$ax^2 + bx + c = 0   \tag{1} $$
$ a,b,c \in \mathbb{R}$ and $a \ne 0 $.
Let us assume that we are trying to solve this equation for real numbers only.
The value
$$D = b^2 - 4ac  \tag{2} $$
is called discriminant of the equation $(1)$.
Case #1:
When $D \gt 0$, there are two distinct real solutions to $(1)$ and they are:
$$x_{1,2} = {-b \pm \sqrt{b^2-4ac} \over 2a} \tag{3} $$
Case #2:
When $D = 0$, there is one real solution to $(1)$ which is:
$$x = {-b \over 2a} \tag{4} $$
Case #3:
When $D \lt 0$, there are no real solutions to $(1)$.

How to solve a linear equation?

This post comes to demonstrate the support for $\LaTeX$ available in Blogger.

 A linear equation is an equation of the form

$$ax + b = 0  \tag{1} $$


$$a,b \in \mathbb{R}, a \ne 0 $$

Let us assume that we are trying to solve this equation for real numbers only i.e. we are trying to find the real roots of the equation.

Solving this equation is simple, it always has a single real solution which is

$$x = - {b \over a}  \tag{2}$$

Calculate $\lim_{x \to \infty} \sqrt[n]{(x+a_1)(x+a_2) ... (x+a_n)} - x$

This is a problem which I found in a math textbook some time ago. I tried solving it but I did not manage to solve it as quickly as I wanted and so I lost patience. Therefore I posted it in MathSE. I liked quite a lot one of the solutions I got, so I wrote it on a sheet of paper and kept it.

Here is the full story...


Find $\lim_{x \to \infty} \sqrt[n]{(x+a_1)(x+a_2) ... (x+a_n)} - x$,

where $x$ is a real variable and $n$ is a fixed natural number $n \ge 1$.


$f(x)=\sqrt[n]{(x+a_1)(x+a_2)\cdot (x+a_n)}$

We now calculate:

$$\lim_{x\to \infty} \frac{f(x)}{x}=\lim_{x\to \infty} \sqrt[n]{(1+\frac{a_1}{x})(1+\frac{a_2}{x}) \cdot (1+\frac{a_n}{x})}= \sqrt[n]{1} = 1 \tag{1}$$

We now form the below difference and we rework it a bit:

$$f(x)-x=\frac{f(x)^n-x^n}{\sum_{k=0}^{n-1} f(x)^{n-1-k} x^{k}}= \frac{f(x)^n-x^n}{f(x)^{n-1}+f(x)^{n-2}x+\dots+f(x)x^{n-2}+x^{n-1}}$$

We note here that the numerator $P(x) = f(x)^n-x^n$ is a polynomial of degree $n-1$ and it has a leading coefficient of $c = a_1+a_2+\dots+a_n$. The denominator is composed of the sum of $n$ terms of the form $f(x)^{n-1-k}x^k$ (for $k=0,1, \dots, n-1$).

So we divide the numerator and the denominator by $x^{n-1}$ and we get:

\lim_{x\to \infty}f(x)-x & = \lim_{x\to \infty} \frac {\frac{f(x)^n-x^n}{x^{n-1}}}{\frac{f(x)^{n-1}}{x^{n-1}}+\frac{f(x)^{n-2}}{x^{n-2}}+\dots+\frac{f(x)}{x}+1} \\[10pt]
&= \lim_{x\to \infty} \frac {\frac{P(x)}{x^{n-1}}}{\frac{f(x)^{n-1}}{x^{n-1}}+\frac{f(x)^{n-2}}{x^{n-2}}+\dots+\frac{f(x)}{x}+1} \\[10pt]
&= \frac{c}{\underbrace{1 + 1 + \dots + 1}_{n\text{ times}}} \\[10pt]
&= \frac{a_1+a_2+\dots+a_n}{n}\end{align*}

The cool thing here is that the limit value happens to be the arithmetic mean of the numbers $a_1, a_2, \dots a_n$.

See also Math SE question/solution here

Derivative of $f(x)=x^n$

What is the derivative of $$f(x)=x^n$$ when $n$ is a fixed integer and $x$ is a real variable?

As we all know this derivative is


But for which values of $n$ and $x$ does this hold true?


1) this is true for integers $n \gt 0$
2) this is also true for integers $n \lt 0$ if $x \ne 0$

Note that when $x=0$ the symbols $x^0, x^{-1}, x^{-2}, x^{-3}, \dots$ are usually treated as undefined. That is why for 2) we need the additional restriction that $x \ne 0$.