\documentclass{article}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{enumerate}

\usepackage{hyperref}

\usepackage{ifthen}
\usepackage{ulem} % for strikethrough \sout{...} command
\usepackage{color}

\usepackage{wasysym}

\usepackage{tikz} % diagram package

\usetikzlibrary{calc}

%\pagestyle{empty}

\setlength{\unitlength}{0.1in}

\setlength{\oddsidemargin}{-0.25in}
\setlength{\evensidemargin}{-0.25in}
\setlength{\topmargin}{-0.45in}
\setlength{\headheight}{0.0in}
\setlength{\headsep}{0.0in}
\setlength{\topskip}{0.0in}
\setlength{\textheight}{9.6in}
\setlength{\textwidth}{7in}

%\newcommand{\comp}{ \,{\scriptstyle \stackrel{\circ}{}}\, } 
%\newcommand{\nullset}{\mathrm{O}\!\!\!\!\big/\,}

%\def\myfrac#1#2{
%    \hspace{3pt}\!\!\!$^{#1}\!\!\hspace{1pt}/\hspace{2pt}\!\!_{#2}$\!\!\!\hspace{3pt}
%} 

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

\newcommand{\myspace}{\parbox[c][0.25in]{0.25in}{\hfill}}
\newcommand{\varspace}[2]{\mbox{\parbox[c][#1]{#2}{\hfill}}}
\newcommand{\force}{{\noindent $\mbox{\;}$}}

\newcommand{\diagquotient}[2]{\displaystyle{{#1 \atop \;}\hspace*{-0.1in} \mbox{\put(0,0){\line(2,1){2}}} \hspace*{0.1in} {\; \atop #2}}}

\newcommand{\F}{\mathbb{F}}
\newcommand{\K}{\mathbb{K}}
\newcommand{\Z}{\mathbb{Z}}
\newcommand{\R}{\mathbb{R}}
\newcommand{\Q}{\mathbb{Q}}
\newcommand{\C}{\mathbb{C}}

\newcommand{\LEMMA}{\vspace{0.1in} \noindent \fbox{\large\bf Lemma:}  }
\newcommand{\COR}{\vspace{0.1in} \noindent \fbox{\large\bf Corollary:}  }
\newcommand{\PROP}{\vspace{0.1in} \noindent \fbox{\large\bf Proposition:}  }
\newcommand{\DEF}{\vspace{0.1in} \noindent \fbox{\large\bf Definition:}  }
\newcommand{\THM}{\vspace{0.1in} \noindent \fbox{\large\bf Theorem:}  }
\newcommand{\EX}{\vspace{0.1in} \noindent \fbox{\large\bf Example:}  }
\newcommand{\bproof}{\vspace{0.05in} \noindent {\bf Proof:} }
\newcommand{\eproof}{$\blacksquare$ \vspace{0.05in}}

\newcommand{\vsp}{\vspace{0.05in}}

\newcommand{\HEAD}[1]{\vspace{0.05in} \noindent {\large\bf #1} \vspace{0.05in}}

\definecolor{ignoreGray}{rgb}{0.75,0.75,0.75}
\newcommand{\ig}{\color{ignoreGray}}

\newcommand{\E}[2]{\B e_{#1}\B e_{#2}^T}

\begin{document}

\noindent
{\bf Math 2240}
\hfill {\Large \bf The Vector Form of Solutions} \hfill 
{\bf Linear Algebra}

\vspace{0.05in}

Here we will look at writing parameterized solutions of linear systems in a nice vector form.

\HEAD{Matrix Vector Form:}

Suppose we have a linear system:
$$\begin{array}{ccccccccc}
a_{11}x_1 & + & a_{12}x_2 & + & \cdots & + & a_{1n}x_n & = & b_1 \\ 
a_{21}x_1 & + & a_{22}x_2 & + & \cdots & + & a_{2n}x_n & = & b_2 \\
\vdots & & \vdots & & & & \vdots &  & \vdots \\
a_{m1}x_1 & + & a_{m2}x_2 & + & \cdots & + & a_{mn}x_n & = & b_m 
\end{array}$$ 
We can rewrite this in a matrix vector form:
$$\begin{bmatrix} 
a_{11} & a_{12} & \cdots & a_{1n} \\
a_{21} & a_{22} & \cdots & a_{2n} \\
\vdots & \vdots & \ddots & \vdots \\
a_{m1} & a_{m2} & \cdots & a_{mn} \end{bmatrix}
\begin{bmatrix} x_1 \\ x_2 \\ \vdots \\ x_n \end{bmatrix}
=
\begin{bmatrix} b_1 \\ b_2 \\ \vdots \\ b_m \end{bmatrix}
$$
If we let $A$ be the matrix whose $(i,j)$-entry is $a_{ij}$, $\B x$ be the column vector whose $i^\mathrm{th}$-entry is $x_i$, and $\B b$ be the column vector whose $i^\mathrm{th}$-entry is $b_i$, then we can write this compactly as $A\B x=\B b$. Of course, $\B x$ is our vector of {\bf variables}. The $m \times n$ matrix $A$ here is called the {\bf coefficient} matrix for this system and $\B b$ is called the vector of {\bf constant terms}. 

\vspace{0.05in}

\HEAD{Solutions in Vector Form:}

To solve a linear system we first translate it into an augmented matrix. This is the coefficient matrix with the constant terms adjoined to the end as a final column. Often we include colons or some other punctuation to indicate the last column is to be interpreted differently. In the notation above, our augmented matrix would be $[A\,:\,\B b]$. 

Next, we use Gauss-Jordan elimination to row reduce our augmented matrix and find its reduced row echelon form (RREF). Here we run into several interesting possibilities. First, if the final column (the one corresponding to the constant terms $\B b$) is a pivot column (i.e., it contains a pivot), we have a row in our RREF that looks like: $[0\,0\, \cdots\,0\,:\,1]$. This translates back into the equation $0=1$. Such a system has {\it no solutions}. In particular, {\it if our final column is a pivot column, we have an {\bf inconsistent system}.} If our final column is not a pivot column, we have a {\bf consistent system}. 

In a consistent system, if the $i^\mathrm{th}$ column of our coefficient matrix $A$ is a pivot column, we have that the $i^\mathrm{th}$ variable $x_i$ is a {\bf basic variable}. On the other hand, if the $i^\mathrm{th}$ column of our coefficient matrix $A$ is not a pivot column, we have that the $i^\mathrm{th}$ variable $x_i$ is a {\bf free variable}. When all the columns of our coefficient matrix are pivot columns and the final column is not a pivot column (i.e., our system is consistent), then our system has {\it exactly one solution}. In this case, the $i^\mathrm{th}$ row of the RREF is of the form: $[0\,0\,\cdots\,0\,1\,0\,\cdots\,0\,:\,c_i]$. This translates back to $x_i=c_i$. In vector form, $\B x=\B c$ where $\B c$ is a column vector whose $i^\mathrm{th}$ entry is $c_i$.

\EX Solve $\begin{array}{ccccc} x & + & 2y & = & 1 \\ 3x & + & 4y & = & 5 \end{array}$. Our coefficient matrix is $A=\begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix}$ and constant term vector is $\B b = \begin{bmatrix} 1 \\ 5 \end{bmatrix}$. Thus our augmented matrix is $[A\,:\,\B b] = \begin{bmatrix} 1 & 2 & : & 1 \\ 3 & 4 & : & 5 \end{bmatrix}$. Using Gaussian elimination we can find the RREF of our augmented matrix is $\begin{bmatrix} 1 & 0 & : & 3 \\ 0 & 1 & : & -1 \end{bmatrix}$. Noting that the final column is not a pivot column, we see this is a consistent system. Both columns of our coefficient matrix are pivot columns. Thus both variables are basic variables (no free variables). This means our system has a unique solution (i.e., it has exactly one solution). Translating the rows of our RREF back into equations we get $1x+0y=3$ and $0x+1y=-1$ so that $x=3$ and $y=-1$. In vector form this is $\B x =\begin{bmatrix} 3 \\ -1 \end{bmatrix}$.

\vspace{0.1in}

Finally, if our final column is not a pivot column (i.e., the system is consistent) and at least one of our coefficient matrix's columns is not a pivot column (i.e., we have at least one free variable), then our system has {\it infinitely many solutions}. In this case, we often give new names to the free variables (calling these parameters) and write down a corresponding {\it parameterized solution}. Instead of trying to give a general form in this case, we will illustrate this with examples.

\EX Solve $\begin{array}{ccccccc} x & + & 2y & + & 3z & = & 3 \\ 4x & + & 5y & + & 6z & = & 9 \\ 7x & + & 8y & + & 9z & = & 15 \end{array}$. Our coefficient matrix is $A=\begin{bmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9 \end{bmatrix}$ and constant term  vector is $\B b =\begin{bmatrix} 3 \\ 9 \\ 15 \end{bmatrix}$. We find the RREF of our augmented matrix using Gaussian elimination (details skipped here): $[A\,:\,\B b] = \begin{bmatrix} 1 & 2 & 3 & : & 3 \\ 4 & 5 & 6 & : & 9 \\ 7 & 8 & 9 & : & 15 \end{bmatrix} \sim \begin{bmatrix} 1 & 0 & -1 & : & 1 \\ 0 & 1 & 2 & : & 1 \\ 0 & 0 & 0 & : & 0 \end{bmatrix}$. Our final column is not a pivot column, so this is a consistent system. Notice that the last column of our augmented matrix is a non-pivot column, so we will have infinitely many solutions. In particular, $x$ and $y$ (corresponding to pivot columns of $A$) are basic variables and $z$ (corresponding to a non-pivot column of $A$) is a free variable. Translating the RREF back into equations, we have $1x+0y-1z=1$, $0x+1y+2z=1$, and $0x+0y+0z=0$ so $x-z=1$, $y+2z=1$, and $0=0$. 

If we let our free variable $z=t$ (a parameter), then these equations say (after putting the free variable terms on the right hand side with the constant terms): \fbox{$x=1+t$, $y=1-2t$, (and $z=t$)} for any scalar $t$. This is our general solution in parameterized form. We then put this into a vector form: $\begin{bmatrix} x \\ y \\ z \end{bmatrix} = \begin{bmatrix} 1+t \\ 1-2t \\ t \end{bmatrix}$. Factoring apart the constant and free variable parts, we have \fbox{$\B x = \begin{bmatrix} 1 \\ 1 \\ 0 \end{bmatrix} + \begin{bmatrix} 1 \\ -2 \\ 1 \end{bmatrix}t$} is the vector form of our general solution. 

\vspace{0.1in}

\noindent
Let's focus just on the final translation step in our last examples.

\vspace{0.05in}

\EX Suppose we have RREF $\begin{bmatrix} 1 & 2 & 0 & 1 & 3 & : & 5 \\ 0 & 0 & 1 & -1 & 2 & : & 7 \\ 0 & 0 & 0 & 0 & 0 & : & 0 \end{bmatrix}$. The final column is not a pivot column so this system is consistent. The first and third variables are basic whereas the second, fourth, and fifth variables are free. Let's use parameters: $x_2=r$, $x_4=s$, and $x_5=t$. The rows say $x_1+2x_2+x_4+3x_5=5$, $x_3-x_4+2x_5=7$, and $0=0$. In terms of our parameters, this is $x_1+2r+s+3t=5$ and $x_3-s+2t=7$. Therefore, $x_1=5-2r-s-3t$, $x_2=r$, $x_3=7+s-2t$, $x_4=s$, and $x_5=t$. 

\vspace{-0.1in}

\force\hfill In vector form this is $\B x = \begin{bmatrix} 5 \\ 0 \\ 7 \\ 0 \\ 0 \end{bmatrix} + \begin{bmatrix} -2 \\ 1 \\ 0 \\ 0  \\ 0 \end{bmatrix}r + \begin{bmatrix} -1 \\ 0 \\ 1 \\ 1 \\ 0 \end{bmatrix}s+\begin{bmatrix} -3 \\ 0 \\ -2 \\ 0 \\ 1 \end{bmatrix}t$. 

\EX Suppose we have RREF $\begin{bmatrix} 1 & 0 & 0 & -1 & : & 2 \\ 0 & 1 & 3 & 0 & : & 4 \end{bmatrix}$. Then our first two variables are basic and whereas the third and fourth are free, say $x_3=s$ and $x_4=t$. Translating the RREF back into equations, we have $x_1-x_4=2$ and $x_2+3x_3=4$ so $x_1-t=2$ and $x_2+3s=4$. Therefore, $x_1=2+t$, $x_2=4-3s$, $x_3=s$, and $x_4=t$.

\vspace{0.05in}

\force\hfill In vector form this is $\B x = \begin{bmatrix} 2 \\ 4 \\ 0 \\ 0 \end{bmatrix} + \begin{bmatrix} 0 \\ -3 \\ 1 \\ 0 \end{bmatrix}s + \begin{bmatrix} 1 \\ 0 \\ 0 \\ 1 \end{bmatrix}t$.

\vspace{-0.1in}

\EX Suppose we have RREF $\begin{bmatrix} 0 & 1 & 0 & 0 & 2 & 0 & : & 0 \\ 0 & 0 & 1 & 0 & 0 & 0 & : & 3 \\ 0 & 0 & 0 & 1 & 4 & 0 & : & 5 \\ 0 & 0 & 0 & 0 & 0 & 1 & : & 6 \end{bmatrix}$. The second, third, fourth, and sixth variables are basic with the first and fifth variables being free, say $x_1=s$ and $x_5=t$. The RREF then says $x_2+2x_5=0$, $x_3=3$, $x_4+4x_5=5$, and $x_6=6$ and so $x_2+2t=0$, $x_3=3$, $x_4+4t=5$, and $x_6=6$. Therefore, $x_1=s$, $x_2=-2t$, $x_3=3$, $x_4=5-4t$, $x_5=t$, and $x_6=6$.\\ 

\vspace{-0.2in}

\force\hfill In vector form, we have $\B x = \begin{bmatrix} 0 \\ 0 \\ 3 \\ 5 \\ 0 \\ 6 \end{bmatrix} + \begin{bmatrix} 1 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \end{bmatrix}s + \begin{bmatrix} 0 \\ -2 \\ 0 \\ -4 \\ 1 \\ 0 \end{bmatrix}t$.



\end{document}
