%------------------------------------------------------------------------------------------------------------------------------------%
\typeout{<----------- PREAMBLE OG EKSTRA KOMMANDOER ----------->}
\input{../preamble.tex}                  %Input af preamble
%\usepackage[notref,notcite]{showkeys}   %Hvis aktiv vises labels i margin - bør kun anvendes i draft
\newcommand{\theaflnr}{3}                %Definition af afleveringsnummer, til sektionsnummerering, forside og sidehoved
\linespread{1.2}
%------------------------------------------------------------------------------------------------------------------------------------%
\typeout{<----------- START PÅ DOKUMENT MED FORSIDE ----------->}
\begin{document}                         % Starter dokumentet efter preamble
\pagestyle{empty}                        % Sidehoved og sidefod for forsiden
\input{../forside.tex}                   % Input af forsiden, der ligger i forside.tex
%------------------------------------------------------------------------------------------------------------------------------------%
\typeout{<---------- START PÅ AFLEVERINGSOPGAVEN SELV ---------->}
\newpage                                 % Ny side efter forsiden er indsat
\pagestyle{fancy}                        % Sidehoved og sidefod for resten af dokumentet
\setcounter{page}{2}                     % Resten af afleveringen har sidenummer 2 og frem
\setcounter{section}{\theaflnr}          % reset tælleren til at nummerere sections (ugeopgavenummer)

%------------------------------------------------------------------------------------------------------------------------------------%
\subsubsection*{Notice}
{\footnotesize In this assignment I'll refer to theorems, definitions and so forth. When I do this, I don't make any references to where they're coming from -- but unless I state anything else -- they're from the notes we use in the course, \cite{notes}. }


\setcounter{subsection}{1}
\subsection*{Problem 1}
\ramme{ Consider the Hilbert space $H = L^2 ([0,1])$ with the inner product
        \begin{equation}
         (f,g) = \int_0^1 f(t) \overline{g(t)} \,\di t .
         \label{p1:innerproduct}
        \end{equation}
        Let $f_1, f_2, g \in H$ be the functions defined (almost everywhere) by $f_1(t) = t$, $f_2(t) = t^2$ and $g(t) = 1$. Find an orthonormal 
        basis for the subspace $\vecspan\{ f_1, f_2 \}$ and determine the projection of $g$ onto this subspace. }
To find an orthonormal basis $[u_1,u_2]$ for the subspace $\vecspan\{ f_1, f_2 \}$, such that $\vecspan\{ u_1, u_2 \} = \vecspan\{ f_1, f_2 \}$, I will use the Gram-Schmidt procedure as described in chapter 5, section 6, in \citet{linalg}. To find the first basis-function for the span I simply normalize $f_1$ and set it equal to the first basis-function
\begin{equation*}
 u_1 = \frac{f_1}{\norm{f_1}} ,
\end{equation*}
so since, by the definition of the inner product in \eqref{p1:innerproduct} and the definition of the norm at page 2 in chapter 4,
\begin{equation*}
 \norm{f_1} = \sqrt{ (f_1,f_1) }
            = \sqrt{ \int_0^1 |f_1(t)|^2 \,\di t }
            = \sqrt{ \int_0^1 t^2 \,\di t }
            = \frac{1}{ \sqrt{ 3 } } ,
\end{equation*}
I simply have that the first basis-function for the subspace $\vecspan\{ f_1, f_2 \}$ is
\begin{equation}
 u_1 = \sqrt{3} f_1 .
 \label{p1:u1}
\end{equation}

To find the second basis-function I first find the projection of $f_2$ on the first basis-function $u_1$. This projection I call $p_1$, and it must be
\begin{equation*}
 p_1 = (f_2,u_1) u_1
     = \int_0^1 f_2(t) \overline{u_1(t)} \,\di t  \,u_1
     = \int_0^1 \sqrt{3} t^3 \,\di t  \,u_1
     = \frac{\sqrt{3}}{4} u_1
     = \frac{3}{4} f_1 .
\end{equation*}
It must be true that $(f_2-p_1) \perp u_1$ since $p_1$ is exactly the component of $f_2$ in the direction of $u_1$, so I normalize $(f_2-p_1)$ and call this my second basis-function,
\begin{equation*}
 u_2 = \frac{f_2-p_1}{\norm{ f_2-p_1 }} .
\end{equation*}
So since
\begin{equation*}
 \norm{ f_2-p_1 } = \sqrt{ \int_0^1 |f_2-p_1|^2 \,\di t }
                  = \sqrt{ \int_0^1 \left( t^2 - \frac{3}{4} t \right)^2 \,\di t }
                  = \frac{1}{\sqrt{80}} ,
\end{equation*}
I get that my second basis-function for the subspace $\vecspan\{ f_1, f_2 \}$ is
\begin{equation}
 u_2 = \sqrt{80} \left( f_2 - \frac{3}{4} f_1 \right) .
 \label{p1:u2}
\end{equation}

Now I have an orthonormal basis $[u_1,u_2]$ with the two basis-functions defined respectively in \eqref{p1:u1} and \eqref{p1:u2}. Then I can find the projection $p_g$ of the function $g$ onto the space they span, by equation (4.12) in the notes,
\begin{align*}
 p_g &= (g,u_1) u_1 + (g,u_2) u_2 \\
     &= \int_0^1 g(t) \overline{u_1(t)} ,\di t \, u_1 + \int_0^1 g(t) \overline{u_2(t)} \,\di t \, u_2 \\
     &= \int_0^1 \frac{3}{4} t \di t \, u_1 + \int_0^1 \sqrt{80} \left( t^2 - \frac{3}{4} t \right) \,\di t \, u_2 \\
     &= \frac{3}{8} u_1 - \frac{\sqrt{80}}{24} u_2 ,
\end{align*}
or, by means of $f_1$ and $f_2$,
\begin{equation*}
 p_g = \frac{3 \sqrt{3}}{8} f_1 - \frac{10}{3} \left( f_2 - \frac{3}{4} f_1 \right) 
     = \left( \frac{3 \sqrt{3}}{8} + \frac{5}{2} \right) f_1 - \frac{10}{3} f_2 .
\end{equation*}




\clearpage
\setcounter{subsection}{2}
\subsection*{Problem 2}
\ramme{ {\bfseries\sffamily Exercise 5.24 in the notes} }

\subsubsection*{Question a}
\ramme{ Let $H_1$ and $H_2$ be two Hilbert spaces with inner products denoted $(\cdot, \cdot)_1$ and $(\cdot, \cdot)_2$, respectively. The 
        Cartesian product $H_1 \times H_2$ with the usual adddition and scalar multiplication and inner product
        \begin{equation}
         \big( (u_1,u_2),(v_1,v_2) \big) = (u_1,v_1)_1 + (u_2,v_2)_2 , \qquad u_1,v_1\in H_1 ,\quad u_2,v_2\in H_2
         \label{p2:innerproduct}
        \end{equation}
        is an inner product space. (You do not have to prove this.) Show that it is a Hilbert space. }
To show that $H_1 \times H_2$ is a Hilbert space with the inner product given in \eqref{p2:innerproduct}, I, according to Definition 4.5, have to show that all Cauchy sequences in $H_1 \times H_2$ converges. To show this, I first find an expression for the norm on the space, which, according to the definition of the norm at page 2 in chapter 4, must be given by
\begin{equation*}
 \norm{(u_1,u_2)}^2 = \big( (u_1,u_2),(u_1,u_2) \big)
                    = (u_1,u_1)_1 + (u_2,u_2)_2
                    = \norm{u_1}_1^2 + \norm{u_2}_2^2 ,
\end{equation*}
for $u_1 \in H_1$ and $u_2 \in H_2$, where the norm $\norm{\cdot}_1$ is the norm on $H_1$ and the norm $\norm{\cdot}_2$ is the norm on $H_2$. 

Given a Cauchy sequence $(x_n,y_n)_{n\in\mathbb{N}}$ in $H_1 \times H_2$, I know that the distance $\norm{(x_n,y_n)-(x_m,y_m)}^2$, for $n>m$, can be made smaller than a given $\epsilon$ as long as $n$ and $m$ are made big enough. This distance can be rewritten by the norm I found above, so
\begin{align*}
 \norm{(x_n,y_n)-(x_m,y_m)}^2 &= \norm{(x_n-x_m,y_n-y_m)}^2 \\
                              &= \norm{x_n-x_m}_1^2 + \norm{y_n-y_m}_2^2 .
\end{align*}
Both of these last terms are positive, and hence both of them can be made smaller than or equal to the given $\epsilon$, as long as $n$ and $m$ are large enough, so the sequence $(x_n)_{n\in\mathbb{N}}$ must be Cauchy in $H_1$, and the sequence $(y_n)_{n\in\mathbb{N}}$ must be Cauchy in $H_2$. But both $H_1$ and $H_2$ are Hilbert spaces, so both sequences converge,
\begin{equation*}
 x_n \rightarrow x \quad \text{in } H_1   \qquad \text{and} \qquad
 y_n \rightarrow y \quad \text{in } H_2 .
\end{equation*}
And since
\begin{align*}
 \norm{(x_n,y_n)-(x,y)}^2 &= \norm{(x_n-x,y_n-y)}^2 \\
                          &= \norm{x_n-x}_1^2 + \norm{y_n-y}_2^2 \rightarrow 0 
\end{align*}
for $n \rightarrow \infty$, I see that $(x_n,y_n)_{n\in\mathbb{N}}$ is convergent in $H_1 \times H_2$ to the value $(x,y) \in H_1 \times H_2$, and hence $H_1 \times H_2$ is a Hilbert space. 


\subsubsection*{Question b}
\ramme{ Show that in the Hilbert space $H_1 \times H_2$ from question a we have
        \begin{equation}
         \big( H_1 \times \{ \underline0 \} \big)^\perp = \{ \underline0 \} \times H_2 .
         \label{p2:qb:expression}
        \end{equation}\vspace{-0.5cm} }
This is easily shown by first showing that the orthogonal complement of $H_1 \times \{ \underline0 \}$ is a subset of $\{ \underline0 \} \times H_2$ and afterwards showing that $\{ \underline0 \} \times H_2$ is a subset of the orthogonal complement of $H_1 \times \{ \underline0 \}$. 
\\ \\
\noindent First, given a $(x,y)$ in $( H_1 \times \{ \underline0 \} )^\perp$, such that I know that $(x,y) \perp (u,0)$ for all $u \in H_1$ according to the definition in equation (4.10) in the notes, I see that (by using the definition of the inner product in \eqref{p2:innerproduct})
\begin{equation*}
 0 = \big( (x,y),(u,0) \big)
   = (x,u)_1 + (y,0)_2
   = (x,u)_1 ,
\end{equation*}
where I used that the inner product with zero is always zero by the equation above equation (4.3) in the notes. So $x \perp u$ for all $u\in H_1$, but since $x\in H_1$ it must specially be true that $x \perp x$, and hence $x=0$ by equation (4.3) in the notes. So all the elements of $( H_1 \times \{ \underline0 \} )^\perp$ is of the form $(0,y)$, which is exactly the form of elements in $\{ \underline0 \} \times H_2$, and hence I know that $( H_1 \times \{ \underline0 \} )^\perp \subseteq \{ \underline0 \} \times H_2$.

Secondly, given a $v\in H_2$, I have to show that $(0,v) \perp H_1 \times \{ \underline0 \}$, meaning that $(0,v) \perp (u,0)$ for all $u\in H_1$. This is trivial, since
\begin{equation*}
 \big( (u,0),(0,v) \big) = (u,0)_1 + (0,v)_2 = 0 ,
\end{equation*}
again by the equation above equation (4.3) in the notes. So $( H_1 \times \{ \underline0 \} )^\perp \supseteq \{ \underline0 \} \times H_2$.
\\ \\
\noindent Concluding, the only way both $( H_1 \times \{ \underline0 \} )^\perp \subseteq \{ \underline0 \} \times H_2$ and $( H_1 \times \{ \underline0 \} )^\perp \supseteq \{ \underline0 \} \times H_2$ can be true is if the two sets are equal, so the expression in \eqref{p2:qb:expression} must be true.


\clearpage
\subsubsection*{Question c}
\ramme{ We may identify the space $H_1 \times \{ \underline0 \}$ with $H_1$ and the space $H_2 \times \{ \underline0 \}$ with $H_2$. With this
        identification we denote the Hilbert space $H_1 \times H_2$ by $H_1 \oplus H_2$ and we write $(u_1,u_2) = u_1 \oplus u_2$. 
        
        \hspace{0.5cm} A linear map $A : \mathcal{D} \rightarrow H$ from a subspace $\mathcal{D}$ of a Hilbert space $H$ to the Hilbert space 
        itself is said to be a \emph{closed operator} if its graph
        \begin{equation}
         \mathcal{G}(A) = \{ u \oplus A u | u \in \mathcal{D} \}  \subset H \oplus H 
         \label{p2:qc:graph}
        \end{equation}
        is a closed subspace of $H \oplus H$. 
        
        \hspace{0.5cm} Show that a bounded operator $A \in \mathcal{B}(H)$ is a closed operator. }
For a bounded operator $A \in \mathcal{B}(H)$ I specially have that $\mathcal{D} = H$ (since the notation $\mathcal{B}(H)$ actually means $\mathcal{B}(H,H)$ such that the operator is defined on the whole space of $H$), and that $\norm{Au} \leq C \norm{u}$ for all $u \in H$ and some constant $C \in \mathbb{C}$ according to equation (5.2) in the notes. 

Given a sequence $u_n \oplus A u_n$ in the graph of $A$, where $(u_n)_{n\in\mathbb{N}}$ is a sequence in $H$, converging towards $u \oplus v$ for $n \rightarrow \infty$, I want to show that $u \oplus v$ is also in the graph of $A$, and hence $v = Au$ according to the definition of the graph of $A$ in \eqref{p2:qc:graph}. The convergence $u_n \oplus A u_n  \rightarrow  u \oplus v$ gives me that
\begin{equation*}
 \norm{u_n \oplus A u_n - u \oplus v}^2 \rightarrow 0 
\end{equation*}
for $n\rightarrow\infty$. And since
\begin{equation*}
 \norm{u_n \oplus A u_n - u \oplus v}^2 = \norm{(u_n - u) \oplus (A u_n - v)}^2
                                        = \norm{u_n - u}^2 + \norm{A u_n - v}^2 ,
\end{equation*}
by the same arguments as in question a, I see that $u_n \rightarrow u$ and $A u_n \rightarrow v$ for $n\rightarrow\infty$. By the continuity of the norm and the linearity of $A$, I then see that
\begin{equation*}
 \norm{v - A u} = \lim_{n\rightarrow\infty} \norm{A u_n - A u}
                = \lim_{n\rightarrow\infty} \norm{A (u_n - u)}
                = 0 ,
\end{equation*}
because $\norm{A (u_n-u)} \leq C \norm{u_n-u} \rightarrow 0$ for $n\rightarrow\infty$ according to $A$ being bounded and the convergence of $(u_n)_{n\in\mathbb{N}}$. Hence $v=Au$, and the convergence point $u \oplus v$ is then in the graph of $A$, which means that the graph of $A$ is a closed subspace of $H$, and hence that $A$ is a closed operator as wanted. 


\subsubsection*{Question d}
\ramme{ Let $(e_n)_{n\in\mathbb{N}}$ be an orthonormal basis for a complex Hilbert space $H$ and $(\lambda_n)_{n\in\mathbb{N}}$ be a sequence of
        complex numbers. Consider $A : \mathcal{D} \rightarrow H$ given by
        \begin{equation}
         \mathcal{D} = \bigg\{ x \in H \bigg| \sum_{n=1}^\infty |\lambda_n(x,e_n)|^2 < \infty \bigg\}
         \label{p2:qd:Ddef}
        \end{equation}
        \begin{equation}
         A x = \sum_{n=1}^\infty \lambda_n(x,e_n) e_n , \qquad \text{for } x \in \mathcal{D} .
         \label{p2:qd:Adef}
        \end{equation}
        Show that $A$ is a closed operator. (You do not have to prove that $\mathcal{D}$ is a subspace.) }
Just like in question c, given a sequence $u_i \oplus A u_i$ in the graph of $A$, where $(u_i)_{i\in\mathbb{N}}$ is a sequence in $\mathcal{D}$, such that it converges to $u \oplus v$ for $n\rightarrow\infty$, I have to show that $v = Au$, but now also that $u \in \mathcal{D}$, in order for the convergence value to be in the graph of $A$ (since $A$ is now defined on $\mathcal{D}$ instead of the whole Hilbert space). So I have to show respectively that $\sum_{n=1}^\infty |\lambda_n (u,e_n)|^2 < \infty$ and that $v = \sum_{n=1}^\infty \lambda_n (u,e_n) e_n$. 

From the convergence $u_i \oplus A u_i \rightarrow u \oplus v$ I know that $u_i \rightarrow u$ and $A u_i \rightarrow v$ from the same procedure as in question c. Hence I know, by the continuity of the inner product, that
\begin{equation}
 \lambda_n (u_i,e_n) \rightarrow \lambda_n (u,e_n)   \qquad\text{and}\qquad   (A u_i,e_n) \rightarrow (v,e_n)
 \label{p2:qd:sequences}
\end{equation}
for $i\rightarrow\infty$, and since $u_i \in\mathcal{D}$ it makes sence to write
\begin{equation*}
 A u_i = \sum_{n=1}^\infty \lambda_n (u_i,e_n) e_n .
\end{equation*}
The inner product of $A u_i$ with one of the vectors from the orthonormal basis will then be the coefficient in front of the vector in the series of $A u_i$, 
\begin{equation*}
 (A u_i, e_n) = \bigg( \sum_{n=1}^\infty \lambda_m (u_i,e_m) e_m, e_n \bigg)
              = \lambda_n (u_i , e_n) ,
\end{equation*}
so since the two sequences in \eqref{p2:qd:sequences} are equal, by uniqueness of limits, the two convergence values must also be equal, hence
\begin{equation*}
 \lambda_n (u,e_n) = (v,e_n) ,
\end{equation*}
and I then know that
\begin{equation*}
 \sum_{n=1}^\infty |\lambda_n (u,e_n)|^2 = \sum_{n=1}^\infty |(v,e_n)|^2
                                         = \norm{v}^2 
                                         < \infty
\end{equation*}
from Parseval's identity. This means that $u \in \mathcal{D}$ according to the definition in \eqref{p2:qd:Ddef}. Hence I know that it makes sence to write $A u$ by the definition in \eqref{p2:qd:Adef}, and then I get that
\begin{equation*}
 A u = \sum_{n=1}^\infty \lambda_n(u,e_n) e_n
     = \sum_{n=1}^\infty (v,e_n) e_n
     = v ,
\end{equation*}
by the orthonormal expansion in Theorem 4.17. So by the same arguments as in question c, I know that $A$ is a closed operator. 


\clearpage
\setcounter{subsection}{3}
\subsection*{Problem 3}
\ramme{ {\bfseries\sffamily Exercise 5.25 in the notes} \\
        Consider the complex Hilbert space $H = L^2([-\pi,\pi])$ with inner product
        \begin{equation}
         (f,g) = \frac{1}{2\pi} \int_{-\pi}^{\pi} f(\theta) \overline{g(\theta)} \,\di\theta
         \label{p3:innerproduct}
        \end{equation}
        and the orthonormal basis $(e_n)_{n\in\mathbb{Z}}$ given by $e_n(\theta) = \exp{(in\theta)}$.
        
        \hspace{0.5cm} Consider the following subspace of $H$:
        \begin{equation}
         \mathcal{D} = \bigg\{ f\in H \bigg| \sum_{n=-\infty}^{\infty} |n (f,e_n)|^2 < \infty \bigg\} 
         \label{p3:Drum}
        \end{equation}
        and the operator $D : \mathcal{D} \rightarrow H$ defined by
        \begin{equation*}
         Df = \sum_{n=-\infty}^{\infty} n (f,e_n) e_n, \qquad \text{for } f\in \mathcal{D} .
        \end{equation*}\vspace{-0.5cm} }

\subsubsection*{Question a}
\ramme{ If $g(\theta) = \theta$, $\theta \in [-\pi,\pi]$ find the coefficients $(g,e_n)$ for all $n\in\mathbb{Z}$ and show that 
        $g\in C^1([-\pi,\pi])$ but $g \notin \mathcal{D}$. }
To find the coefficients $(g,e_n)$ I simply insert the expression of $g(\theta)$ and the expressions of $e_n(\theta)$ into the definition of the inner product in \eqref{p3:innerproduct}, from which I see that for a general $n\in\mathbb{Z}\setminus\{0\}$
\begin{align}
 (g,e_n) &= \frac{1}{2\pi} \int_{-\pi}^{\pi} g(\theta) \overline{e_n(\theta)} \,\di\theta \nn\\
         &= \frac{1}{2\pi} \int_{-\pi}^{\pi} \theta \exp{(-i n \theta)} \,\di\theta \nn\\
         &= \frac{1}{2\pi} \left[ \frac{\exp{(-in\theta)}}{-in} \left( \theta + \frac{1}{in} \right) \right]_{-\pi}^{\pi} \nn\\
         &= \frac{1}{2\pi} \left[ \frac{\exp{(-in\pi)}}{-in} \left( \pi + \frac{1}{in} \right) 
                                  + \frac{\exp{(in\pi)}}{in} \left( -\pi + \frac{1}{in} \right) \right] , \label{p3:qa:midlertidig}
\end{align}
where I solved the integral in the second step by using formula 17.25.2 in \citetalias{schaums}, \citet{schaums}. If $n=0$ I have to look at the integral for itself, where I get that
\begin{equation*}
 (g,e_0) = \frac{1}{2\pi} \int_{-\pi}^{\pi} g(\theta) \overline{e_0(\theta)} \,\di\theta 
         = \frac{1}{2\pi} \int_{-\pi}^{\pi} \theta \,\di\theta 
         = 0 ,
\end{equation*}
because $g$ is an odd function around $\theta = 0$ (easily seen on figure \vref{fig:p3:grafer}). So from the above, combined with \eqref{p3:qa:midlertidig} (where I note that $\exp{(\pm i n \pi)} = 1$ for even $n$ and $\exp{(\pm i n \pi)} = -1$ for odd $n$), I see  that
\begin{equation}
 (g,e_n) = \left\{ \begin{array}{ll}
                    -\dfrac{1}{in} & \quad \text{for even } n \\
                    \addlinespace[5pt]
                    \dfrac{1}{in} &  \quad \text{for odd } n \\
                    \addlinespace[5pt]
                    0 & \quad \text{for } n = 0 .
                   \end{array} \right.
 \label{p3a:innerproductgen}
\end{equation}

It is trivial to see that $g \in C^1([-\pi,\pi])$ since $g(\theta)=\theta$ is differentiable for all $\theta\in[-\pi,\pi]$, with the continous differential $g'(\theta) = 1$. To check whether or not $g$ is in $\mathcal{D}$, I first note that $C^1([-\pi,\pi])$ is a subspace of $H$ (which means that $g\in H$ too), so I only have to check if the series
\begin{equation*}
 \sum_{n=-\infty}^{\infty} |n(g,e_n)|^2 
\end{equation*}
converges. Since I found the inner product coefficients $(g,e_n)$ in \eqref{p3a:innerproductgen}, I see that this series is given by
\begin{equation*}
 \sum_{\substack{n=-\infty\\n\neq0}}^{\infty} \left| n \frac{(-1)^{n-1}}{i n} \right|^2 
   = \sum_{\substack{n=-\infty\\n\neq0}}^{\infty} \left| \frac{(-1)^{n-1}}{i} \right|^2 
   = \sum_{\substack{n=-\infty\\n\neq0}}^{\infty} \left| (-1)^{n} i \right|^2 
   %= \sum_{\substack{n=-\infty\\n\neq0}}^{\infty} (-1)^{2n} | i |^2 
   = \sum_{\substack{n=-\infty\\n\neq0}}^{\infty} 1 ,
\end{equation*}
which does not converge, since the terms does not even decrease for increasing $n$ (according to the divergence test in Theorem 12.1.4 in \citetalias{kalkulus}, \citet{kalkulus}). Hence $g\notin\mathcal{D}$ according to the definition of $\mathcal{D}$ in \eqref{p3:Drum}.


\subsubsection*{Question b}
\ramme{ Use the result in question a and Parseval's identity to show that the infinite series $\sum_{n=1}^{\infty} n^{-2}$ is convergent and determine 
        its value. }
Parseval's identity from equation (4.27) in the notes says that
\begin{equation*}
 \norm{x}^2 = \sum_{n=-\infty}^{\infty} |(x,e_n)|^2 ,
\end{equation*}
for all $x \in H$ (note that I have to sum over the whole orthonormal basis, and hence the lower boundary to sum from is $-\infty$ instead of the 1 that is in equation (4.27)). As my $x$ I use the function $g$ from question a, which I know was in $H$ from the arguments in the last part of question a. And since I get that
\begin{equation}
 \sum_{n=-\infty}^{\infty} |(g,e_n)|^2 
   = \sum_{\substack{n=-\infty\\n\neq0}}^{\infty} \left| \frac{(-1)^{n-1}}{i n} \right|^2 
   = \sum_{\substack{n=-\infty\\n\neq0}}^{\infty} \left| \frac{1}{i n} \right|^2 
   = \sum_{\substack{n=-\infty\\n\neq0}}^{\infty} \frac{1}{n^2} ,
 \label{p3:qb:series}
\end{equation}
I know from Parseval's identity that this series is convergent exactly as wanted, and that it converges to the value $\norm{g}^2$. This value is given by
\begin{equation*}
 \norm{g}^2 = (g,g)
         = \frac{1}{2\pi} \int_{-\pi}^{\pi} |g(\theta)|^2 \,\di\theta
         = \frac{1}{2\pi} \int_{-\pi}^{\pi} \theta^2 \,\di\theta
         = \frac{1}{2\pi} \frac{2}{3} \pi^3
         = \frac{1}{3} \pi^2 .
\end{equation*}
From this I now know that the shorter series (note that I have changed the lower boundary to sum from)
\begin{equation*}
 \sum_{n=1}^{\infty} \frac{1}{n^2}
\end{equation*}
must konverge, since it is simply half of the series in \eqref{p3:qb:series}. It must then converge to the value of one half times the value that the long series converges to (it can be done this simple since the series in \eqref{p3:qb:series} is even around $n=0$). So the series $\sum_{n=1}^{\infty} n^{-2}$ hence converges towards $\pi^2/6$. 



\begin{figure}[tb]
 \centering
  %\begin{center}
  \psset{xunit=10mm,
         yunit=5mm}
  \begin{pspicture}(-4,-4)(4,4) %\psgrid
   %Fyldte områder:
   \definecolor{solidhigh}{rgb}{0.4, 0.4, 0.9}
   \definecolor{solidlow}{rgb}{0.8, 0.8, 0.9}
   %\pspolygon[linewidth=1pt,style=TGreen](-3.14,3.14)(0,0)(-3.14,0)(-3.14,3.14)
   %\pspolygon[linewidth=0pt,fillstyle=gradient,gradangle=0,gradmidpoint=0,gradbegin=solidhigh,gradend=solidlow,opacity=0.5]
   %          (-3.14,3.14)(0,0)(-3.14,0)(-3.14,3.14)
   %Koordinatsystem:
   \psline[arrows=->](-4,0)(4,0)                  \uput[-90](4,0){$\theta$}
   \psline[arrows=->](0,-4)(0,4)                 %\uput[180](0,4){$f(\theta)$}
   \psline[linewidth=0.1mm](-3.14,0)(-3.14,-0.2)  \uput*[-90](-3.14,0){\footnotesize$-\pi$}
   \psline[linewidth=0.1mm](3.14,0)(3.14,-0.2)    \uput*[-90](3.14,0){\footnotesize$\pi$}
   \psline[linewidth=0.1mm](0,3.14)(-0.1,3.14)    \uput*[180](0,3.14){\footnotesize$\pi$}
   \psline[linewidth=0.1mm](0,-3.14)(-0.1,-3.14)  \uput*[180](0,-3.14){\footnotesize$-\pi$}
   \psline[linewidth=0.1mm,linestyle=dotted](-3.14,3.14)(-3.14,-3.14)
   \psline[linewidth=0.1mm,linestyle=dotted](3.14,3.14)(3.14,0)
   \psline[linewidth=0.1mm,linestyle=dotted](-3.14,-3.14)(0,-3.14)
   \psline[linewidth=0.1mm,linestyle=dotted](-3.14,3.14)(3.14,3.14)
   %Kurver:
   \psline[linecolor=Periwinkle,linewidth=0.4mm,arrows=*-*](-3.14,-3.14)(3.14,3.14)  
          \uput[45](-2,-3){{\color{Periwinkle}$g(\theta)$}}
   \psline[linecolor=SpringGreen,linewidth=0.4mm,linestyle=dashed,arrows=*-*](-3.14,3.14)(0,0)(3.14,3.14) 
          \uput[-45](-2,3){{\color{SpringGreen}$h(\theta)$}}
  \end{pspicture}
  %\end{center}
 \caption{The two functions $g(\theta) = \theta$ and $h(\theta) = |\theta|$ used in problem 3. Here it is easy to see that $g$ is odd, while $h$ 
          is even.}
 \label{fig:p3:grafer}
\end{figure}


\subsubsection*{Question c}
\ramme{ Show that the function $h(\theta) = |\theta|$, $\theta \in [-\pi,\pi]$ satisfies
        \begin{equation*}
         h \in \mathcal{D}, \qquad h \notin C^1([-\pi,\pi]) .
        \end{equation*}\vspace{-0.5cm} }
First of all, I note that it is trivially true that $h \notin C^1([-\pi,\pi])$, since $h$ is not even differentiable at $\theta=0$. 

I now want to check wether $h$ is in $\mathcal{D}$, so first I note that $h$ is continous for all $\theta \in [-\pi,\pi]$, so $h\in C([-\pi,\pi])$, and hence $h\in H$ because $L^2([-\pi,\pi])$ is simply an extension of $C([-\pi,\pi])$ (by point 3ii in Example 4.12). Then I calculate the inner product coefficients $(h,e_n)$ by using the definition of the inner product in \eqref{p3:innerproduct}, first for a general $n\in\mathbb{Z}\setminus\{0\}$,
{\allowdisplaybreaks{\begin{align*}
 (h,e_n) &= \frac{1}{2\pi} \int_{-\pi}^{\pi} h(\theta) \overline{e_n(\theta)} \,\di\theta \\
         &= \frac{1}{2\pi} \int_{-\pi}^{\pi} | \theta | \exp{(-i n \theta)} \,\di\theta \\
         &= \frac{1}{2\pi} \left[ \int_{-\pi}^{0} (-\theta) \exp{(-i n \theta)} \,\di\theta 
                                  + \int_{0}^{\pi} \theta \exp{(-i n \theta)} \,\di\theta \right] \\
         &= \frac{1}{2\pi} \left[ \int_{0}^{\pi} \theta \exp{(-i n \theta)} \,\di\theta 
                                  - \int_{-\pi}^{0} \theta \exp{(-i n \theta)} \,\di\theta \right] \\
         &= \frac{1}{2\pi} \left\{ \left[ \frac{\exp{(-in\theta)}}{-in} \left( \theta + \frac{1}{in} \right) \right]_{0}^{\pi} 
                                   - \left[ \frac{\exp{(-in\theta)}}{-in} \left( \theta + \frac{1}{in} \right) \right]_{-\pi}^{0} \right\} \\
         &= \frac{1}{2\pi} \left[ \frac{1}{n^2} + \frac{\exp{(-in\pi)}}{in} \left( \pi + \frac{1}{in} \right)
                                  + \frac{\exp{(in\pi)}}{in} \left( -\pi + \frac{1}{in} \right) + \frac{1}{n^2} \right] ,
\end{align*}}}%
where I solved the integrals like I did in question a. So since $\exp{(in\pi)} = \exp{(-in\pi)}$ for $n\in\mathbb{Z}$, I see that
\begin{equation*}
 (h,e_n) = \frac{1}{\pi n^2} \big( 1 - \exp{(i n \pi)} \big) , \qquad \text{for } n\in\mathbb{Z} \setminus \{0\} .
\end{equation*}
For $n=0$ the inner product becomes
\begin{align*}
 (h,e_0) = \frac{1}{2\pi} \int_{-\pi}^{\pi} h(\theta) \overline{e_0(\theta)} \,\di\theta 
         = \frac{1}{2\pi} \int_{-\pi}^{\pi} |\theta| \,\di\theta 
         = \frac{1}{\pi} \int_{0}^{\pi} \theta \,\di\theta 
         = \frac{\pi}{2} ,
\end{align*}
because $h$ is an even function around $\theta=0$ (easily seen on figure \vref{fig:p3:grafer}). So by the same arguments on the exponential function as used in question a, I finally get that
\begin{equation}
 (h,e_n) = \left\{ \begin{array}{ll}
                    0 &  \quad \text{for even } n \\
                   \addlinespace[5pt]
                    \dfrac{2}{\pi n^2} & \quad \text{for odd } n \\
                   \addlinespace[5pt]
                    \dfrac{\pi}{2} & \quad \text{for } n = 0 .
                   \end{array} \right.
 \label{p3:qc:hen}
\end{equation}
Now I must simply check wether the series
\begin{equation*}
 \sum_{n=-\infty}^{\infty} |n (h,e_n)|^2
\end{equation*}
converges. I found the inner product coefficients in \eqref{p3:qc:hen}, so by inserting in the above, I get that the series is given by
\begin{equation*}
 \sum_{\substack{n=-\infty\\n \text{ odd}}}^{\infty} \left| n \frac{2}{\pi n^2} \right|^2 + \left| 0 \cdot \frac{\pi}{2} \right|^2
   = \sum_{\substack{n=-\infty\\n \text{ odd}}}^{\infty} \left| \frac{2}{\pi n} \right|^2 
   = \sum_{\substack{n=-\infty\\n \text{ odd}}}^{\infty} \frac{4}{\pi^2} \frac{1}{n^2} ,
   %= \frac{4}{\pi^2} \sum_{\substack{n=-\infty\\n \text{ odd}}}^{\infty} \frac{1}{n^2} ,
\end{equation*}
which, according to Setning 12.2.4 in \citetalias{kalkulus}, does converge. Hence $h$ is in $\mathcal{D}$ as expected. 


\clearpage
\subsubsection*{Question d}
\ramme{ Let
        \begin{equation*}
         C^1_p([-\pi,\pi]) = \{ f\in C^1([-\pi,\pi]) | f(-\pi) = f(\pi) \} .
        \end{equation*}
        Show by integration by parts that if $f \in C^1_p([-\pi,\pi])$ then
        \begin{equation}
         (-i f' , e_n) = n (f,e_n) .
         \label{p3:qd:udtryk}
        \end{equation}\vspace{-0.5cm} }
I simply calculate the left hand side of \eqref{p3:qd:udtryk} and check that it is equal to the right hand side. I get, by integration by parts, that
\begin{align*}
 (-i f' , e_n) &= \frac{1}{2\pi} \int_{-\pi}^{\pi} -if'(\theta) \overline{e_n(\theta)} \,\di\theta \\
               &= \frac{1}{2\pi} \int_{-\pi}^{\pi} -if'(\theta) \exp{(-in\theta)} \,\di\theta \\
               &= \frac{1}{2\pi} \left[ -if(\theta) \exp{(-in\theta)} \right]_{-\pi}^{\pi}
                  - \frac{1}{2\pi} \int_{-\pi}^{\pi} -if(\theta) \dd{}{\theta} \big( \exp{(-in\theta)} \big) \,\di\theta \\
               &= \frac{1}{2\pi} \left[ -if(\theta) \exp{(-in\theta)} \right]_{-\pi}^{\pi}
                  + \frac{1}{2\pi} \int_{-\pi}^{\pi} n f(\theta) \exp{(-in\theta)} \,\di\theta \\
               &= \frac{1}{2\pi} \left[ -if(\theta) \exp{(-in\theta)} \right]_{-\pi}^{\pi} + n (f,e_n) ,
\end{align*}
and since $f\in C^1_p([-\pi,\pi])$, I know that $f(-\pi) = f(\pi)$, and for $n\in\mathbb{Z}$, I also know that $\exp{(-in\pi)} = \exp{(in\pi)}$, so the first term equals zero, and hence
\begin{equation*}
 (-i f' , e_n) = n (f,e_n) ,
\end{equation*}
for all $f \in C^1_p([-\pi,\pi])$, which was exactly what I wanted to show. 


\clearpage
\subsubsection*{Question e}
\ramme{ Use the result of question d to show that $C^1_p([-\pi,\pi]) \subseteq \mathcal{D}$ and that $Df = -i f'$ for all $f \in C^1_p([-\pi,\pi])$. }
To show that $C^1_p([-\pi,\pi]) \subseteq \mathcal{D}$ I will look at the series from the definition of $\mathcal{D}$ in \eqref{p3:Drum}. From question d I know that
\begin{equation*}
 \sum_{n=-\infty}^\infty |n(f,e_n)|^2 = \sum_{n=-\infty}^\infty |(-if',e_n)|^2 ,
\end{equation*}
which is convergent if $-if' \in L^2([-\pi,\pi])$ according to Parseval's identity (which says that the series converges towards the value $\norm{-if'}$ if $-if' \in H$), which is true because $f \in C^1([-\pi,\pi])$, so $f' \in C([-\pi,\pi])$, and $L^2([-\pi,\pi])$ contains all the continous functions according to Example 4.12.3 point ii. 

To show that $Df = -i f'$ for all $f \in C^1_p([-\pi,\pi])$ I simply use the result of question d to calculate $Df$, where I get that
\begin{equation*}
 Df = \sum_{n=-\infty}^\infty n (f,e_n) e_n
    = \sum_{n=-\infty}^\infty (-i f' , e_n) e_n
    = -i f' ,
\end{equation*}
by the orthonormal expansion in Theorem 4.17. 






\vspace{2.5cm}
\bibliography{../bibliography}

\label{lastpage}
\end{document}