Let $M=\{f:[a,b] \to \textbf{R} | f \,is \,continuous \}$. Let $d:M \to \textbf{R}$ be defined by $d(f,g)=\int_a^b |f(x)-g(x)| \,dx$. What is d represent geometrically, and show that M, d is a metric space. What is $d(\sin(x),\cos(x))$ for $[a,b]=[0, 2\pi]$?
$\textbf{What does d represent geometrically?}$
d represents absolute value of the area of the region that is bounded by the functions f and g.
$\textbf{Show that M,d is a metric space.}$
$\textbf{Proof:}$ For M to be a metric space, it must satisfy the following properties:
- If $f,g \in M$ with $d(f,g)=0$, then $f=g$ (vice versa).
Let $f,g \in M$. Assume $d(f,g)=\int_a^b |f(x)-g(x)| \,dx=0$. $$ \int_a^b |f(x)-g(x)| \,dx=0 \iff |f(x)-g(x)|=0 \iff$$ \begin{cases} f(x)-g(x)=0 \iff f(x)=g(x)\\ -(f(x)-g(x))=0 \iff f(x)=g(x)\\ \end{cases} Hence $f=g$.
- If $f,g \in M$, then $d(f,g)=d(g,f)$.
Let $f,g \in M$. Assume $d(f,g)=\int_a^b |f(x)-g(x)| \,dx$. $$d(f,g)=\int_a^b |f(x)-g(x)| \,dx=\int_a^b |-(g(x)-f(x))| \,dx=\int_a^b |g(x)-f(x)| \,dx=d(g,f)$$ Hence $d(f,g)=d(g,f)$.
- Triangle Inequality
Let $f,g,h \in M$. Assume $d(f,h)=\int_a^b |f(x)-h(x)| \,dx$. \begin{equation*} \begin{split} d(f,h) & =\int_a^b |f(x)-h(x)| \,dx \\ & =\int_a^b |f(x)-g(x)+g(x)-h(x)| \,dx\\ & \leq \int_a^b |f(x)-g(x)|+|g(x)-h(x)| \,dx\\ & =\int_a^b |f(x)-g(x)|\,dx + \int_a^b|g(x)-h(x)| \,dx\\ & =d(f,g)+d(g,h) \\ \end{split} \end{equation*} Hence $d(f,h) \leq d(f,g)+d(g,h)$.
Hence M,d is a metric space.
$\textbf{What is $d(\sin(x),\cos(x))$ for $[a,b]=[0, 2\pi]$?}$
$$d(\sin(x),\cos(x))=\int_0^{2\pi} |\sin(x)-\cos(x)| \,dx=(-\cos(x)-\sin(x))]_0^{2 \pi}=0$$ Is this correct?
Correction: \begin{equation*} \begin{split} d(\sin(x),\cos(x)) & =\int_0^{2\pi} |\sin(x)-\cos(x)| \,dx \\ & =\int_0^\frac{\pi}{4} \cos(x)-sin(x)\,dx +\int_\frac{\pi}{4}^\frac{5\pi}{4} \sin(x)-cos(x)\,dx+\int_\frac{5\pi}{4}^{2\pi} \cos(x)-sin(x)\,dx \\ & = \sqrt{2}-1+2\sqrt{2}+1+\sqrt{2}\\ & =4\sqrt{2} \\ \end{split} \end{equation*}
No. You cannot simply drop the absolute values. You have to break up the integral into pieces where $\sin x > \cos x$ and vice versa. The answer should be $4\sqrt{2}$.