\documentclass{exam}
\usepackage[latin1]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{tikz}
\usetikzlibrary{arrows}
\usepackage{pgfplots}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{mathrsfs}
\usepackage{tabularx,ragged2e}
\usepackage{hyperref}
\usepackage{color}
\usepackage{tikz}
\usepackage{enumerate}
\usepackage{tabularx,ragged2e}
\newcommand*\circled[1]{\tikz[baseline=(char.base)]{
            \node[shape=circle,draw,inner sep=2pt] (char) {#1};}}

\newcommand{\dd}{\mathrm{d}}
%\renewcommand*{\arraystretch}{2}
\cfoot{}
\begin{document}

\begin{coverpages}
\begin{center}{\huge MATH 3520 - EXAM 2 FALL 2019 \\
\vspace*{0.4in}
%\large Name: \makebox[3in]{\hrulefill}\\
SOLUTION
}
\end{center}

\begin{flushleft}\vspace{0.5in}
Friday, 18 October \\
Instructor: Tom Cuchta
\end{flushleft}

\textbf{Instructions:}
\begin{itemize}
	\item  Show all work, clearly and in order, if you want to get full
	credit. If you claim something is true \textbf{you must show work backing up your claim}. I reserve the right to take off points if I cannot see how you arrived at your answer (even if your final answer is correct).
	\item Justify your answers algebraically whenever possible to ensure full credit. 	
	\item  Circle or otherwise indicate your final answers.
	\item  Please keep your written answers brief; be clear and to the point.
	\item  Good luck!
\end{itemize}

\end{coverpages}

\begin{questions}
\question[12] Is $W$ a subspace of $V$? If so, prove it. If not, explain why not (preferably using a counterexample).
\begin{parts}
\part[6] $V=\mathscr{P}_2$ and $W=\{a t^2+b \colon a,b \in \mathbb{R}\}$\\
\textit{Solution}: Yes $W$ is a subspace of $V$. First we show that it is closed under vector addition: let $at^2+b, ct^2+d \in W$. Then,
\[ (at^2+b)+(ct^2+d) = (a+c)t^2 + (b+d) \in W,\]
because $a+c \in \mathbb{R}$ and $b+d \in \mathbb{R}$. Now we show that it is closed under scalar multiplication: let $at^2+b \in W$ and let $\alpha \in \mathbb{R}$ be a scalar, then 
\[ \alpha(at^2+b)=\alpha at^2 + \alpha b \in W,\]
because $\alpha a \in \mathbb{R}$ and $\alpha b \in \mathbb{R}$. Therefore $W$ is a subspace of $V$.
\part[6] $V=\mathbb{R}^{2 \times 2}$ and $W=\left\{ \begin{bmatrix} a & 0 \\ 1 & b \end{bmatrix} \colon a,b \in \mathbb{R} \right\}$  \\
\textit{Solution}: No, $W$ is not a subspace of $V$ because it is not closed under addition. For instance, let $\vec{v}_1=\vec{v}_2=\begin{bmatrix} 0 & 0 \\ 1 & 0 \end{bmatrix} \in W$. Then
\[ \vec{v}_1 + \vec{v}_2 = \begin{bmatrix} 0&0 \\ 2&0 \end{bmatrix} \not\in W,\]
because it is has a ``$2$" in the lower left corner, contrary to the condition that defines $W$. 
\end{parts}
\question[11] Determine whether or not $\mathscr{B}=\left\{ \begin{bmatrix} 1 \\ 0 \\ -1 \end{bmatrix}, \begin{bmatrix} 0 \\ 1 \\ 1 \end{bmatrix}, \begin{bmatrix} 1 \\ 0 \\ 1 \end{bmatrix} \right\}$ is a basis for vector space $V=\mathbb{R}^{3 \times 1}$. Explain why or why not. \\
\textit{Solution}: It is a basis. To check it, first check whether or not $\mathscr{B}$ spans $\mathbb{R}^{3 \times 1}$: let $\begin{bmatrix} a \\ b \\ c \end{bmatrix} \in \mathbb{R}^{3 \times 1}$, and consider the vector equation
\[ \alpha_1 \begin{bmatrix} 1 \\ 0 \\ -1 \end{bmatrix} + \alpha_2 \begin{bmatrix} 0 \\ 1 \\ 1 \end{bmatrix} + \alpha_3 \begin{bmatrix} 1 \\ 0 \\ 1 \end{bmatrix} = \begin{bmatrix} a \\ b \\ c \end{bmatrix}.\]
This becomes
\[ \begin{bmatrix} \alpha_1 + \alpha_3 \\
\alpha_2 \\
-\alpha_1+\alpha_2+\alpha_3 \end{bmatrix} = \begin{bmatrix} a \\ b \\ c \end{bmatrix}.\]
We will know that $\mathscr{B}$ spans $\mathbb{R}^{3 \times 1}$ if we can solve this system of linear equations. Of course we can write it as an augmented matrix and put it into reduced echelon form:
\[ \begin{bmatrix} 1&0&1&a \\ 0&1&0&b \\ -1&1&1&c \end{bmatrix} \sim \begin{bmatrix} 1 & 0 & 0 & \frac{a+b-c}{2} \\ 0&1&0&b \\ 0&0&1&\frac{a-b+c}{2} \end{bmatrix}, \]
meaning that we have solution vector
\[ \vec{\alpha} = \begin{bmatrix} \alpha_1 \\ \alpha_2 \\ \alpha_3 \end{bmatrix} = \begin{bmatrix} \frac{a+b-c}{2} \\ b \\ \frac{a-b+c}{2} \end{bmatrix},\]
and so we know that $\mathscr{B}$ spans $\mathbb{R}^{3 \times 1}$. Now we must check if $\mathscr{B}$ is linearly independent. This means we must check to see if there are any nonzero solutions to the vector equation
\[ \alpha_1 \begin{bmatrix} 1 \\ 0 \\ -1 \end{bmatrix} + \alpha_2 \begin{bmatrix} 0 \\ 1 \\ 1 \end{bmatrix} + \alpha_3 \begin{bmatrix} 1 \\ 0 \\ 1 \end{bmatrix} = \begin{bmatrix} 0 \\ 0 \\ 0 \end{bmatrix}.\]
However, we have already solved this equation and so we simply plug in $a=b=c=0$ into our earlier solution and we observe solution vector
\[ \vec{\alpha} = \begin{bmatrix} 0 \\ 0 \\ 0 \end{bmatrix}.\]
Therefore $\mathscr{B}$ is linearly independent. Since $\mathscr{B}$ is linearly independent and spans $\mathbb{R}^{3 \times 1}$, we conclude that it is a basis for $\mathbb{R}^{3 \times 1}$.
\question[16] Consider the basis $\mathscr{B}=\{1,2x,4x^2-2\}$ of $\mathscr{P}_2$ (this basis for $\mathscr{P}_2$ is called the ``Hermite polynomials"). Find $[x^2+x+1]_{\mathscr{B}}$. \\
\textit{Solution}: We have to express the polynomial $x^2+x+1$ in terms of the basis $\mathscr{B}$. This amounts to finding weights $\alpha_1$, $\alpha_2$, and $\alpha_3$ so that
\[ x^2+x+1 = \alpha_1 (1) + \alpha_2 (2x) + \alpha_3(4x^2-2).\]
Rearranging the right-hand side yields
\[ x^2+x+1 = \Big(4\alpha_3 \Big) x^2 + \Big( 2\alpha_2 \Big)x + \Big( \alpha_1 - 2\alpha_3 \Big). \]
Equating coefficients yields the system of linear equations
\[ \left\{ \begin{array}{ll}
4\alpha_3 &= 1 \\
2\alpha_2 &= 1 \\
\alpha_1 - 2\alpha_3 &= 1.
\end{array} \right. \]
We can solve this directly or with an augmented matrix: 
\[ \begin{bmatrix} 0&0&4&1 \\ 0&2&0&1 \\ 1&0&-2&1 \end{bmatrix} \stackrel{\textrm{rref}}{\sim} \begin{bmatrix} 1&0&0&\dfrac{3}{2} \\[2mm] 0&1&0&\dfrac{1}{2} \\[2mm] 0&0&1&\dfrac{1}{4} \end{bmatrix}.\]
Therefore, we have shown that 
\[ [x^2+x+1]_{\mathscr{B}} = \begin{bmatrix} \frac{3}{2} \\[2mm] \frac{1}{2} \\[2mm] \frac{1}{4} \end{bmatrix}.\]
\question[17] Consider the basis $\mathscr{B}=\left\{1, x-\dfrac{1}{2}, x^2-x \right\}$ (called ``Euler polynomials") and the basis $\mathscr{C}=\left\{ 1, x, x^2 \right\}$ of $\mathscr{P}_2$. Find the change of basis matrix $P_{\mathscr{C}\leftarrow \mathscr{B}}$. \\
\textit{Solution}: The change of basis matrix is given by
\[ P_{\mathscr{C} \leftarrow \mathscr{B}} = \begin{bmatrix} [1]_{\mathscr{C}} & \left[ x -\frac{1}{2} \right]_{\mathscr{C}} & \left[ x^2-x \right]_{\mathscr{C}} \end{bmatrix},\]
so we must find those coordinates. To find $[1]_{\mathscr{C}}$, we have to find scalars $\alpha_1, \alpha_2, \alpha_3$ so that
\[ 1 = \alpha_1 (1) + \alpha_2 (x) + \alpha_3 (x^2).\]
It is immediately clear that $\alpha_1=1$ and $\alpha_2=\alpha_3=0$. Therefore,
\[ [1]_{\mathscr{C}} = \begin{bmatrix} 1 \\ 0 \\ 0 \end{bmatrix}.\]
To find $\left[ x-\frac{1}{2} \right]_{\mathscr{C}}$ we must find scalars $\beta_1, \beta_2, \beta_3$ so that 
\[ x-\dfrac{1}{2} = \beta_1 (1) + \beta_2 (x) + \beta_3 (x^2).\]
It is immediately clear that $\beta_1=-\dfrac{1}{2}$, $\beta_2=1$, and $\beta_3=0$. Therefore the coordinates are
\[ \left[ x - \dfrac{1}{2} \right]_{\mathscr{C}} = \begin{bmatrix} -\frac{1}{2} \\ 1 \\ 0 \end{bmatrix}.\]
Finally, to find the coordinates $[x^2-x]_{\mathscr{C}}$, we must find scalars $\gamma_1, \gamma_2, \gamma_3$ so that 
\[ x^2-x = \gamma_1 (1) + \gamma_2(x) + \gamma_3(x^2).\]
It is immediately clear that $\gamma_1=0$, $\gamma_2=-1$, and $\gamma_3=1$, and so we write
\[ [x^2-x]_{\mathscr{C}} = \begin{bmatrix} 0 \\ -1 \\ 1 \end{bmatrix}.\] 
Therefore we have found the change of basis matrix:
\[ P_{\mathscr{C} \leftarrow \mathscr{B}} = \begin{bmatrix} 
1 & -\frac{1}{2} & 0 \\
0 & 1 & -1 \\
0 & 0 & 1
\end{bmatrix}.\]


\question[22] Find the dimension of the described subspace $W$ of $V$.
\begin{parts}
\part[11] $V=\mathscr{P}_2, \quad W=\{p \in \mathscr{P}_2 \colon \dfrac{x^2}{2}p''(x)=p(x)\}$ \\
\textit{Solution}: We need to find a basis for $W$. To do so, consider an arbitrary $p \in \mathscr{P}_2$ given by $p=ax^2+bx+c$. Then $p''=2a$ and so the equation $\dfrac{x^2}{2}p''(x) = p(x)$ yields 
\[ ax^2 = ax^2+bx+c,\]
or equivalently
\[ 0 = bx+c.\]
Equating coefficients on each side (note: left-side is same as $0x+0$) yields $b=0$ and $c=0$. Therefore,
\[ W = \{ax^2+bx+c \colon a \in \mathbb{R}, b=c=0\} = \left\{ ax^2 \colon a \in \mathbb{R}\right\}.\]
A basis for $W$ could be $\mathscr{B} = \{x^2\}$ and so $\mathrm{dim}(W)=1$.
\part[11] $V=\mathscr{P}_2, W=\{ A \in \mathbb{R}^{2 \times 2} \colon A^T=A\}$ \\
\textit{Solution}:  Let $A \in \mathbb{R}^{2 \times 2}$ be given by $A=\begin{bmatrix} a&b \\ c&d \end{bmatrix}$. The condition $A^T=A$ implies that
\[ \begin{bmatrix} a&c \\ b&d \end{bmatrix} = \begin{bmatrix} a&b \\ c&d \end{bmatrix}.\]
Therefore we see that $a=a$ (useless equation), $c=b$ (useful), $b=c$ (useful), and $d=d$ (useless). This means that the top right and bottom left entry must agree in order to satisfy $A^T=A$. Therefore
\[ W = \left\{ \begin{bmatrix} a& b \\ b&d \end{bmatrix} \colon a,b,d \in \mathbb{R} \right\}.\]
A basis for $W$ could be $\mathscr{B} = \left\{ \begin{bmatrix} 1 & 0 \\ 0 & 0 \end{bmatrix}, \begin{bmatrix} 0&1 \\ 1 &0 \end{bmatrix}, \begin{bmatrix} 0&0 \\ 0&1 \end{bmatrix} \right\}$, and hence $\mathrm{dim}(W)=3$. 
\end{parts}

\question[22] Is the function a linear transformation? If so, prove it. If not, explain why not (preferably with a counterexample).
\begin{parts}
%\part $\left\{ \begin{array}{ll}
%T \colon \mathbb{R}^{2 \times 2} \rightarrow \mathbb{R}^{2 \times 1} \\
%T\left(\begin{bmatrix} a&b \\ c&d \end{bmatrix} \right)=\begin{bmatrix} a&b \\ c&d \end{bmatrix}\begin{bmatrix} 1 \\ 2 \end{bmatrix}
%\end{array} \right.$
\part[11] $\left\{ \begin{array}{ll}
T \colon \mathbb{R}^{2 \times 1} \rightarrow \mathscr{P}_2 \\
T\left( \begin{bmatrix} a\\ b  \end{bmatrix} \right) = abx^2+b
\end{array} \right.$ \\
\textit{Solution}: Not a linear transformation. 
\[ T \left( \begin{bmatrix} 1 \\ 1 \end{bmatrix} + \begin{bmatrix} 1 \\ 1 \end{bmatrix} \right) = T \left( \begin{bmatrix} 2 \\ 2 \end{bmatrix} \right) = 4x^2+2, \]
while
\[ T \left( \begin{bmatrix} 1 \\ 1 \end{bmatrix} \right) + T \left( \begin{bmatrix} 1 \\ 1 \end{bmatrix} \right) =(x^2+1) + (x^2+1) = 2x^2+2 \neq T \left( \begin{bmatrix} 1 \\ 1 \end{bmatrix} + \begin{bmatrix} 1 \\ 1 \end{bmatrix} \right). \]
This demonstrates that the mapping $T$ is not a linear transformation.
\part[11] Let $V$ be an arbitrary vector space with zero vector $\vec{0}$: $\left\{ \begin{array}{ll}
T \colon V \rightarrow \{\vec{0}\}  \\
T(v)=\vec{0}
\end{array} \right.$ \\
\textit{Solution}: Let $\vec{v} \in V$. Then,
\[ T(\vec{v}+\vec{v}) = T(2\vec{v}) = \vec{0} = T(\vec{v})+T(\vec{v})),\]
and
\[ T(\alpha \vec{v}) = \vec{0} = \alpha T(\vec{v}).\]
Therefore this map is a linear transformation.
\end{parts}

\question (\textbf{BONUS: 5 points}) Recall that a sequence is a function whose domain is the integers. Typically, if $a$ is a sequence, then $a(n)$ is denoted by $a_n$. For exmaple, the sequence $a_n=n^2$ has values $a_{-2}=4$, $a_0=0$, $a_1=1$, etc.

Let $V$ denote the set of real-valued sequences with the property that for all integers $n$, $1+a_n>0$. Define the addition operation of $V$, denoted by $\oplus$, to be defined by
\[ a_n \oplus b_n = a_n+b_n+a_nb_n.\]
Define scalar multiplication on $V$, denoted by $\odot$, by 
\[\alpha \odot a_n = \alpha a_n \displaystyle\int_0^1 (1+a_nx)^{\alpha-1} \mathrm{d}x. \]
This structure forms a vector space called the ``regressive vector space of the time scale of integers". Consider the sequences $a_n=n^3$ and $b_n=n^2$ and compute $a_n \oplus b_n$ and compute $2 \odot a_n$. \\
\textit{Solution}: By definition,
\[ \begin{array}{ll}
a_n \oplus b_n &= n^3 + n^2 + n^3n^2 = n^3 + n^2 + n^5,
\end{array} \]
and
\[ 2 \odot a_n = 2 n^3 \displaystyle\int_0^1 (1+n^2 x)^1 \mathrm{d}x = 2n^3 \Bigg[ x + \dfrac{n^2x^2}{2} \Bigg|_{x=0}^{x=1} = 2n^3\left( 1 + \dfrac{n^2}{2} \right). \]
\vfill
\end{questions}
\end{document}