\documentclass{article}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{enumerate}
\usepackage{ifthen}
\usepackage{ulem} % for strikethrough \sout{...} command
\usepackage{color}
\setlength{\oddsidemargin}{-0.5in}
\setlength{\evensidemargin}{-0.5in}
\setlength{\topmargin}{-0.5in}
\setlength{\headheight}{0.0in}
\setlength{\headsep}{0.0in}
\setlength{\topskip}{0.0in}
\setlength{\textheight}{9.75in}
\setlength{\textwidth}{7.5in}


\usepackage{tikz,pgfplots}
\usepgfplotslibrary{fillbetween}


\newcommand{\bdot}{\, {\scriptstyle{\bullet}} \,}
\newcommand{\B}[1]{{\bf {#1}}}
\newcommand{\la}{\langle}
\newcommand{\ra}{\rangle}

\newcommand{\myspace}{\parbox[c][0.2in]{0.2in}{\hfill}}
\newcommand{\varspace}[2]{\mbox{\parbox[c][#1]{#2}{\hfill}}}
\newcommand{\force}{{$\mbox{\,\!}$}}

\begin{document}

\pagestyle{empty}

\noindent
\parbox{2in}{\bf Math 2240}
\hfill {\Large \bf Homework \#3} \hfill
\parbox{2in}{\bf \hfill Due: Tues., July $28^\mathrm{st}$\!,\  2020}

%\vspace{0.2in}

\force \hfill {\bf Be sure to show your work!} \hfill \force

\vspace{0.05in}

\noindent
{\it Notes:} 
\begin{itemize}
\item This first homework was shorter. These later homeworks are longer. I don't plan on weighting each homework equally.   
\item You can copy/paste my {\color{red}sample code} into Maple. However, if you would prefer to do computations using different software, that is ok. Make sure you turn in {\it all} of your work (including computer code).
\item If you end up doing the entire assignment in Maple, feel free to turn in a Maple worksheet (.mw file) instead of a pdf. 
\item {\bf While some calculations can be done by hand}, some are better done using technology. A calculator is a poor choice since I want {\it exact} answers not decimal approximations.
\end{itemize}

\vspace{0.15in}

\noindent {\bf\large 1.} Find the determinant and inverse of the following $4 \times 4$ matrix ($a,b,c,d$ are unknown constants):
$$ X = \begin{bmatrix} a & b & c & d \\ b & 0 & 0 & c \\ c & 0 & 0 & b \\ d & c & b & a \end{bmatrix}$$

\vspace{0.1in}

\noindent {\bf\large 2.} Let $W = \left\{ f(t) \in \mathbb{P}_3 \;|\; f''(1)=0 \mbox{ and } f(-1)=0 \right\}$. 

\begin{enumerate}[(a)]
\item Consider $T : \mathbb{P}_3 \to \mathbb{R}^2$ defined by $T(f(t)) = \begin{bmatrix} f''(1) \\ f(-1) \end{bmatrix}$. Show that $T$ is a linear map. Then briefly explain why $W= \mathrm{Ker}(T)$. {\it Note:} Since we now know $W$ is a kernel (i.e., nullspace) of a linear transformation and kernels are subspaces, we have that $W$ is a subspace of $\mathbb{P}_3$.
        
\item Let $\alpha = \{1,t,t^2,t^3\}$ (the standard basis for $\mathbb{P}_3$). Let $\beta = \{ {\bf e}_1, {\bf e}_2 \}$ (the standard basis for $\mathbb{R}^2$). Find the coordinate matrix $[T]_\alpha^\beta$. Find the rank and nullity of $T$. Is $T$ one-to-one? Onto? 

\item Find a basis for the null space of $[T]_\alpha^\beta$. Use this to get a basis $\gamma$ for $W=\mathrm{Ker}(T)$. 

\item Show that $f(t)=t^3-3t^2+5t+9 \in W$. Find $[f(t)]_\gamma$. 

\item Suppose that $[g(t)]_\gamma = \begin{bmatrix} 3 \\ -1 \end{bmatrix}$. What is $g(t)$?

\end{enumerate}

\vspace{0.05in}

\noindent
{}[Problem \#3 is on the next page.]

\newpage

\noindent {\bf\large 3.} Here we explore eigen-stuff. You definitely do not want to (and probably cannot) do these by hand. 

\vspace{0.05in}

\noindent{\bf For example:}  

\noindent {\color{red}
\verb# restart; #\\
\verb# with(LinearAlgebra): #\\
\verb# A := <<5,-1,-2,-3>|<5,11,2,3>|<7,5,11,6>|<-2,-4,1,7>>; #\\
\verb# Eigenvectors(A); #\\
}
This will result in\dots

\vspace{-0.25in}

{\color{blue}
$$\begin{bmatrix} 10\\10\\7\\7 \end{bmatrix}, \quad \begin{bmatrix} 1 & 1 & 1 & 0 \\ 0 & 1 & -1 & 0 \\ 1 & 0 & 1 & 0 \\ 1 & 0 & 0 & 0 \end{bmatrix}$$
}

This means that $A$ has eigenvalues 10 and 7 both with algebraic multiplicity 2. The $4 \times 4$ matrix consists of eigenvectors (and the zero vector). The first two columns are (linearly independent) eigenvectors with eigenvalue 10 (i.e., the geometric multiplicity of $\lambda=10$ is $\dim(E_{10})=2$). The third column is an eigenvector with eigenvalue $7$. The column of $0$'s indicates that there isn't a second dimension's worth of eigenvectors with eigenvalue $7$ (i.e., the geometric multiplicity of $\lambda=7$ is $\dim(E_7)=1$). 

\vspace{0.05in}

\noindent{\bf Functions of matrices:}
When a matrix $A$ is diagonalizable we can compute ``$f(A)$'' for any function $f(x)$. Specifically, suppose that $P^{-1}AP=D$ where 
$D = \begin{bmatrix} \lambda_1 &            & \\
                                                     & \ddots & \\
                                                     &            & \lambda_n \end{bmatrix}$ is a diagonal matrix. 
Then $f(A) = Pf(D)P^{-1} = P \begin{bmatrix} f(\lambda_1) &            & \\
                                                                                                 & \ddots & \\
                                                                                                 &            & f(\lambda_n) \end{bmatrix}P^{-1}$.

\vspace{0.1in}           
                                                                                                 
Why do we define $f(A)$ this way? Notice that since $P^{-1}AP=D$, we have $A=PDP^{-1}$. Thus if $f(x) = \sum\limits_{k=0}^\infty c_kx^k$, then $f(A) = \sum\limits_{k=0}^\infty c_kA^k = \sum\limits_{k=0}^\infty c_k(PDP^{-1})^k = \sum\limits_{k=0}^\infty c_kPD^kP^{-1} = P\left(\sum\limits_{k=0}^\infty c_kD^k\right)P^{-1} = Pf(D)P^{-1}$. When $D$ is diagonal, $f(D)$ is just $f(x)$ applied to the diagonal entries of $D$.                                        

\vspace{0.1in}           

\noindent {\bf For example:} $A=\begin{bmatrix} 5 & 3 \\ -2 & 0 \end{bmatrix}$. Then if $P=\begin{bmatrix} -1 & -3 \\ 1 & 2 \end{bmatrix}$, then $P^{-1}AP = \begin{bmatrix} 2 & 0 \\ 0 & 3 \end{bmatrix}=D$.  

\force \hfill This means that $e^A = Pe^DP^{-1} = P\begin{bmatrix} e^2 & 0 \\ 0 & e^3 \end{bmatrix}P^{-1} = \begin{bmatrix} -2e^2+3e^3 & -3e^2+3e^3 \\ 2e^2-2e^3 & 3e^2-2e^3 \end{bmatrix}$.

\vspace{0.1in}

\noindent
{\it Note:} You may also find the ``{\color{red}\verb#simplify(stuff);#}'' command helpful. If you want decimal approximations use ``{\color{red}\verb#evalf(stuff);#}''.

%\vspace{0.15in}

\begin{enumerate}[(a)]
\item Let $A = \begin{bmatrix} 6 & -1 & 7 & 1 \\ 1 & -3 & 0 & 1 \\ -1 & 1 & -2 & -1 \\ -7 & 0 & -7 & -2 \end{bmatrix}$. Find the eigenvalues of $A$. Then find each eigenvalue's algebraic and geometric multiplicities and a basis for each eigenspace for $A$. Is $A$ diagonalizable? Why or why not?

\vspace{0.05in}

{\color{red}\verb#A := <<6,1,-1,-7>|<-1,-3,1,0>|<7,0,-2,-7>|<1,1,-1,-2>>;#}

\vspace{0.05in}

\item Let $B = \begin{bmatrix} 13 & -12 & 9 & -15 & 9 \\ 6 & -5 & 9 & -15 & 9 \\ 6 & -12 & -5 & 6 & 9 \\ 6 & -12 & 9 & -8 & 9 \\ -6 & 12 & 12 & -6 & -2 \end{bmatrix}$.
Find a matrix $P$ which diagonalizes $B$. What is $D=P^{-1}BP$ for your matrix $P$? Use this to compute $\sin(B)$ (the matrix sine of $B$). Please round your matrix entries (3 decimal places is fine).

\vspace{0.05in}

{\color{red}\verb#B := <<13,6,6,6,-6>|<-12,-5,-12,-12,12>|<9,9,-5,9,12>|<-15,-15,6,-8,-6>|<9,9,9,9,-2>>;#}

\vspace{0.05in}

\item Let $C = \begin{bmatrix} 4 & 5 & 0 & -5 \\ -5 & 24 & -5 & -20 \\ 5 & -5 & 9 & 5 \\ -5 & 15 & -5 & -11 \end{bmatrix}$. 
Again, find a matrix $P$ which diagonalizes $C$. What is $D=P^{-1}CP$ for your matrix $P$? Use this to compute $\sqrt{C}$. Then check that $(\sqrt{C})^2=C$.

\vspace{0.05in}

{\color{red}\verb#C := <<4,-5,5,-5>|<5,24,-5,15>|<0,-5,9,-5>|<-5,-20,5,-11>>;#}

\vspace{0.05in}

\end{enumerate}

\end{document}

