\section{Equations}
\definition{An \textbf{equation} is two mathematical \textbf{expressions} joined with an equal sign.}
\begin{example}
  The equation
  \[y^2=1+x\]
  is composed of the expressions $y^2$ and $1+x$.
\end{example}
When an equation involves one or more variables (like $x$ and $y$ here) equality will usually hold for only certain values of the variables. These particular values are called the \textbf{solutions} of the equation.  As an example the pair of values $x=0$, $y=-1$, or, more simply $(x,y)=(0,-1)$, is one solution to the previous equation.  \textbf{Solving} an equation is the act of finding the solutions of it.  If we plotted points for all the solutions to the previous equation in the Cartesian coordinate system we would see these form a curve (a parabola).

We are perhaps more familiar with an equation that represent a (straight) line, like
\[y=-\frac{1}{2}x-1\]
Recalling the slope-intercept general form for a line, $y=mx+b$, we see that the constants are $m=-1/2$ and $b=-1$ for the slope and intercept of the line respectively. This latter equation is an example of a \textbf{linear equation} which we will define precisely shortly.

If we graphed the curve $y^2=x+1$, the point $(0,-1)$, and the line $y=-\frac{1}{2}x-1$, we would see that the line is actually a \textbf{tangent line} to the curve at the point $(0,-1)$ as it just touches the curve at $(0,-1)$ without crossing it. One observes that if we were only interested in the parabola at points very close to the point $(0,-1)$, the straight line determined by the linear equation would approximate the curve quite well.
\begin{center}
\begin{asy}
import graph;
size(200,0);
real f(real x) {return sqrt(1+x);}
pair F(real x) {return (x,f(x));}
real g(real x) {return -sqrt(1+x);}
pair G(real x) {return (x,g(x));}
real h(real x) {return -x/2-1;}
pair H(real x) {return (x,h(x));}
xaxis("$x$",xmin=-2,xmax=2.5,Arrow(HookHead,size=4));
yaxis("$y$",ymin=g(2.5),ymax=f(2.5),Arrow(HookHead,size=4));
draw(graph(f,-1,2.5,operator --),red+2);
draw(graph(g,-1,2.5,operator --),red+2);
draw(graph(h,-1.5,1.5,operator --),blue+2);
label("$y^2=1+x$",(0.2,1),SE);
label("$y=-\frac{1}{2}x-1$",H(-0.5),SW);
dot(G(0),black+5);
label("$(0,-1)$",G(0),NE);
\end{asy}
\end{center}
As such, near a point on a curve that might arise from some arbitrary equation involving two variables there is a line which approximates it well and that line is represented by a linear equation.

If we would introduce a further variable (like $z$) into our original equation the triplets $(x,y,z)$ that satisfy it would, in general, generate a \textbf{surface} in three dimensions.  For example the points of a sphere of radius $r=5$ centred on the origin satisfy the equation
\[x^2+y^2+z^2=25\,.\]
Near one of the points on that surface we could approximate the surface by a \textbf{tangent plane}.  As an example the spherical Earth locally at a point $P$ is approximately a flat plane.
% Note these settings must be done before importing three
% See "An Asymptote Tutorial" by Charles Staats available online
% for how to do 3D in asymptote with examples
%
% Note settings.prc and .render must be set before importing three
% PRC stores 3D image info allowing a limited number of PDF viewers the
% ability to dynamically rotate images, etc.   I found I needed it to be
% off to work in latexmk and there is some discussion of this in the above
% documentation.  A better way to implement the animated 3D could be to
% run asy with the -V option from within the pdf on the .asy code
% to open a proper viewer.
% The render option sets the resolution (see the docs).  The setting render=0
% creates an actual vector graphics image, but it has limited capabilities and
% for the following image produces artifacts.
%
\begin{center}
\begin{asy}[width=.4\textwidth]
size(300);
settings.prc=false;
settings.render=4;
import three;
currentprojection = orthographic(2.5,-3,-3);
currentlight = Viewport;
draw(scale(2,2,2)*unitsphere, red, meshlight=nolight);
draw(surface((2,1,1)--(2,1,-1)--(2,-1,-1)--(2,-1,1)--cycle),blue+opacity(0.5),nolight);
dot((2,0,0),white+5);
label("$P$",(2,0,0),2*(1,0,0),white);
\end{asy}
\end{center}
A plane, in turn, we will see can be represented algebraically by the solutions of a linear equation in three variables.  As such, an understanding of these linear algebraic structures, and, to the extent we can visualize them, their graphs, will provide us with useful insights and approximations for more general equations.
% Note: This really is true for arbitrary surfaces because assuming one has a single equation we could locally isolate a variable and write it as a function of the others.  That function, in turn could be expanded in multivariate Taylor series.  Taking the first order terms only we see the surface at the point is approximated by a hyperplane describable by a linear equation.

\section{Equations of a Line}

A straight line in the $x$-$y$ plane can be characterized in several ways.  The following are common forms of a linear equation in two variables.  Which of the ``recipes'' to use depends on what information one has regarding the line. 

The \textbf{slope--intercept form} of a line is used when the $y$--intercept $b$ is known as well as its direction, characterized by the slope $m$.\footnote{One prefers the $y$--intercept $b$ over the $x$--intercept $a$ (where the line crosses the $x$--axis), because any line that can be written as a function $y=f(x)$ can always be written in the form $y=mx+b$.  The horizontal line $y=3$, which is a valid function, has no $x$-intercept.}  It has the familiar form:
% Uncomment the following if \asybox has not been created elsewhere.
%\newsavebox\asybox
\begin{lrbox}{\asybox}
\begin{asy}
import graph;
size(200,0);
real f(real x) {return -2*x/3+2;}
pair F(real x) {return (x,f(x));}
xaxis("$x$",xmin=-1,xmax=4,Arrow(HookHead,size=4));
yaxis("$y$",ymin=-.5,ymax=2.5,Arrow(HookHead,size=4));
draw(F(.5)--(.5,f(2.5)),dashed+black+1);
draw((.5,f(2.5))--F(2.5),dashed+black+1);
draw(graph(f,-.5,3.5,operator --),red+2);
//dot(F(.5),black+5);
//dot(F(2.5),black+5);
//label("$(x_1,y_1)$",F(.5),NE);
//label("$(x_2,y_2)$",F(2.5),NE);
label("$\scriptsize\Delta x$",(1.4,f(2.5)),N);
label("$\scriptsize\Delta y$",(0.5,.85),E);
label("$m=\frac{\Delta y}{\Delta x}$",F(1.5),NE);
//xtick("$a$",3);
ytick("$b$",2);
\end{asy}
\end{lrbox}
\begin{center}
  % Note the use of parbox vertically centres the image.
\hfill$\boxed{y = mx+b}$\hfill\parbox{2in}{\resizebox{2in}{!}{\usebox\asybox}}\hspace*{10em}
\end{center}

The \textbf{point--slope form} of an equation is used in the more general case when one still knows the slope, $m$, but now an arbitrary point $(x_1,y_1)$ on the line.  It is given by
% Uncomment the following if \asybox has not been created elsewhere.
%\newsavebox\asybox
\begin{lrbox}{\asybox}
\begin{asy}
import graph;
size(200,0);
real f(real x) {return -2*x/3+2;}
pair F(real x) {return (x,f(x));}
xaxis("$x$",xmin=-1,xmax=4,Arrow(HookHead,size=4));
yaxis("$y$",ymin=-.5,ymax=2.5,Arrow(HookHead,size=4));
draw(F(.5)--(.5,f(2.5)),dashed+black+1);
draw((.5,f(2.5))--F(2.5),dashed+black+1);
draw(graph(f,-.5,3.5,operator --),red+2);
dot(F(.5),black+5);
//dot(F(2.5),black+5);
label("$(x_1,y_1)$",F(.5),NE);
//label("$(x_2,y_2)$",F(2.5),NE);
label("$\scriptsize\Delta x$",(1.4,f(2.5)),N);
label("$\scriptsize\Delta y$",(0.5,.85),E);
label("$m=\frac{\Delta y}{\Delta x}$",F(1.5),NE);
//xtick("$a$",3);
//ytick("$b$",2);
\end{asy}
\end{lrbox}
\begin{center}
  % Note the use of parbox vertically centres the image.
\hfill$\boxed{y - y_1 = m(x-x_1)}$\hfill\parbox{2in}{\resizebox{2in}{!}{\usebox\asybox}}\hspace*{10em}
\end{center}

In the event two points $(x_1,y_1)$ and $(x_2,y_2)$ on the line are known rather than the slope one can use the \textbf{two point form} for a line:
% Uncomment the following if \asybox has not been created elsewhere.
%\newsavebox\asybox
\begin{lrbox}{\asybox}
\begin{asy}
import graph;
size(200,0);
real f(real x) {return -2*x/3+2;}
pair F(real x) {return (x,f(x));}
xaxis("$x$",xmin=-1,xmax=4,Arrow(HookHead,size=4));
yaxis("$y$",ymin=-.5,ymax=2.5,Arrow(HookHead,size=4));
//draw(F(.5)--(.5,f(2.5)),dashed+black+1);
//draw((.5,f(2.5))--F(2.5),dashed+black+1);
draw(graph(f,-.5,3.5,operator --),red+2);
dot(F(.5),black+5);
dot(F(2.5),black+5);
label("$(x_1,y_1)$",F(.5),NE);
label("$(x_2,y_2)$",F(2.5),NE);
//label("$\scriptsize\Delta x$",(1.4,f(2.5)),N);
//label("$\scriptsize\Delta y$",(0.5,.85),E);
//label("$m=\frac{\Delta y}{\Delta x}$",F(1.5),NE);
//xtick("$a$",3);
//ytick("$b$",2);
\end{asy}
\end{lrbox}
\begin{center}
  % Note the use of parbox vertically centres the image.
\hfill$\boxed{y-y_1 = \frac{y_2-y_1}{x_2-x_1}(x-x_1)}$\hfill\parbox{2in}{\resizebox{2in}{!}{\usebox\asybox}}\hspace*{10em}
\end{center}
which arises from the point--slope form by noting that $m=\frac{\Delta y}{\Delta x}=\frac{y_2-y_1}{x_2-x_1}$.  None of the previous three line equations can represent vertical lines.

If one knows the $x$-intercept $a$ of a line in addition to its $y$-intercept $b$ the \textbf{two intercept} form is just
% Uncomment the following if \asybox has not been created elsewhere.
%\newsavebox\asybox
\begin{lrbox}{\asybox}
\begin{asy}
import graph;
size(200,0);
real f(real x) {return -2*x/3+2;}
pair F(real x) {return (x,f(x));}
xaxis("$x$",xmin=-1,xmax=4,Arrow(HookHead,size=4));
yaxis("$y$",ymin=-.5,ymax=2.5,Arrow(HookHead,size=4));
//draw(F(.5)--(.5,f(2.5)),dashed+black+1);
//draw((.5,f(2.5))--F(2.5),dashed+black+1);
draw(graph(f,-.5,3.5,operator --),red+2);
//dot(F(.5),black+5);
//dot(F(2.5),black+5);
//label("$(x_1,y_1)$",F(.5),NE);
//label("$(x_2,y_2)$",F(2.5),NE);
//label("$\scriptsize\Delta x$",(1.4,f(2.5)),N);
//label("$\scriptsize\Delta y$",(0.5,.85),E);
//label("$m=\frac{\Delta y}{\Delta x}$",F(1.5),NE);
xtick("$a$",3);
ytick("$b$",2);
\end{asy}
\end{lrbox}
\begin{center}
  % Note the use of parbox vertically centres the image.
\hfill$\boxed{\frac{x}{a}+\frac{y}{b}=1}$\hfill\parbox{2in}{\resizebox{2in}{!}{\usebox\asybox}}\hspace*{10em}
\end{center}
since clearly when $x=0$ one has $y=b$ and when $y=0$ one has $x=a$\,.  This two intercept form cannot, however, represent lines that lack an intercept (either $x$ or $y$), namely horizontal and vertical lines.

The \textbf{standard form} of a line is given by

\[\boxed{a_1x + a_2y = b}\,\]

where $a_1$, $a_2$, and $b$ are constants with $a_1$ and $a_2$ not both zero. While geometrically the constants do not have an immediate meaning like the previous equations, the standard form is able to represent all possible lines in the plane.\footnote{It will be shown later that constants $a_1$ and $a_2$ can be interpreted in terms of the \emph{normal} direction to the line.}  One can always rearrange it into one of the other forms to interpret it geometrically.  Alternatively substitute any two values of $x$ and evaluate (solve for) their $y$-coordinates to establish two points on the line for graphing.

\begin{example}
  Find the standard form of the equation of the line going through points $(1,3)$ and $(-2,9)$\,.

  Solution:\\
  Since we are given two points, use the two point form with $(x_1,y_1)=(1,3)$ and $(x_2,y_2)=(-2,9)$ to get
  \[y-3=\frac{9-3}{-2-1}(x-1)\]
  which simplifies to
  \[y-3=-2(x-1)\]
  Expanding the right hand side to get $y-3=-2x+2$ and isolating the variables on the left gives the standard form
  \[2x+y=5\,.\]
  One can check that the points $(1,3)$ and $(-2,9)$ satisfy the equation.
\end{example}

\begin{example}
  Convert the line with standard form $6x-y=2$ into two intercept form and sketch the line.

  Solution:\\
  The two intercept form $x/a+y/b=1$ requires a 1 on the right hand side so dividing $6x-y=2$ by two gives
  \[3x-\frac{y}{2}=1\,.\]
  Noting that multiplying by 3 in the first term is the same as dividing by its reciprocal 1/3 and bringing the -1 into the denominator of the second term gives the two intercept form
  \[\frac{x}{1/3}+\frac{y}{-2}=1\,.\]
 with $x$-intercept $a=1/3$ and $y$-intercept $b=-2$\,.  Plotting the points $(1/3,0)$ and $(0,-2)$ and joining them with the straight line gives the following graph.
 % Asymptote code within the example environment fails.  There are two solutions
 % Either put it in a box or put it in a minipage environment.  The former
 % solution is preferable as it allows the image to be resized overall if
 % necessary and secondly the box dimensions are the proper dimensions so that
 % centering works.  Note that the box name asybox can be reused but can
 % only be declared once.
 \begin{center}
   % Uncomment the following if \asybox has not been created elsewhere.
   %\newsavebox\asybox
   \begin{lrbox}{\asybox}
     \begin{asy}
       import graph;
       size(100,150,IgnoreAspect);
       real f(real x) {return 6*x-2;}
       pair F(real x) {return (x,f(x));}
       draw(graph(f,-0.2,.5,operator ..),red+2);
       xaxis("$x$",xmax=.6,Arrow(HookHead,size=4),above=true);
       yaxis("$y$",Arrow(HookHead,size=4),above=true);
       xtick("$\frac{1}{3}$",0.333333);
       ytick("$-2$",-2);
     \end{asy}
   \end{lrbox}
   %\usebox\asybox
   % The following can be used to resize the image to any size.  Just use it
   % instead of the previous line.
   \resizebox{.8in}{!}{\usebox\asybox}
   %
   % The following also works but the centering is off because it centres the
   % minipage not the figure.  Also \resizebox cannot be used on it.
   %\begin{minipage}{1in}
   %\begin{asy}
   %  import graph;
   %  size(100,150,IgnoreAspect);
   %  real f(real x) {return 6*x-2;}
   %  pair F(real x) {return (x,f(x));}
   %  draw(graph(f,-0.2,.5,operator ..),red+2);
   %  xaxis("$x$",xmax=.6,Arrow(HookHead,size=4),above=true);
   %  yaxis("$y$",Arrow(HookHead,size=4),above=true);
   %  xtick("$\frac{1}{3}$",0.333333);
   %  ytick("$-2$",-2);
   %\end{asy}
   %\end{minipage}
 \end{center}
\end{example}

\section{Systems of Linear Equations}

The equation of a line, $a_1x+a_2y=b$ is a linear equation for 2 variables, $x$ and $y$.  More generally we have the following.

\definition{A \textbf{linear equation} in $n$ variables $x_1$, $x_2$, \ldots, $x_n$ is an equation that can be written in the form
\[\boxed{a_1x_1 + a_2x_2+\ldots+ a_nx_n = b}\]
where the $a_i$ are the (constant) \textbf{coefficients} and $b$ is the \textbf{constant term}.}

Note that one or more of the constants in a linear equation may be zero.

\definition{A \textbf{solution} of the linear equation $a_1x_1 + a_2x_2+\ldots+ a_nx_n = b$ is a sequence of numbers $(t_1, t_2, \ldots, t_n)$ such that the substitution $x_1=t_1$, $x_2=t_2$, \ldots $x_n=t_n$ into the equation makes it true.}

\begin{example}
\begin{enumerate}
  \item For $3x_1+2x_2=5$, we have $x_1=3$, $x_2=-2$ as a solution and $x_1=-5$ and $x_2=10$ as another solution as can be confirmed by direct substitution into the equation.
  \item For $2x+3y-2z=2$ we have $x=2$, $y=2$, and $z=4$ as a solution.
\end{enumerate}
\end{example}

\definition{Linear equation $a_1x_1 + a_2x_2+\ldots+ a_nx_n = b$ is called \textbf{homogeneous} if $b=0$ and \textbf{non-homogeneous} otherwise.}

\begin{example}
  \begin{enumerate}
  \item $2x-3y=0$ is homogeneous
  \item $-2x_1+3x_2-x_3=5$ is non-homogeneous.
  \end{enumerate}
\end{example}

\definition{A \textbf{system of linear equations} (or \textbf{linear system}) is a finite set of two or more linear equations involving the same set of variables called the \textbf{unknowns}.}

\definition{A \textbf{solution} of a linear system involving $n$ unknowns is a sequence of numbers $(t_1, t_2, \ldots, t_n)$ that is simultaneously a solution of every linear equation in the system.}

\begin{example}\label{exam:twodunique}
  The equations
\[\begin{array}{c}
    5x+y=3\\
    2x-y=4
\end{array}\]
form a linear system of two equations in two unknowns.  $x=1$, $y=-2$ is a solution to the system. Equivalently we may write the solution as $(x,y)=(1,-2)$\,.
\end{example}

\subsection{Geometrical Interpretation of the Solution}

The solution of a linear system with two equations in two dimensions has a convenient geometrical interpretation.  Suppose we have such a system of two equations in two unknowns:
\[\begin{array}{c}
    a_1x+b_1y=c_1\\
    a_2x+b_2y=c_2
\end{array}\]
Since each linear equation separately represents a line in the plane, a solution $x$, $y$ of the system must be any point $(x,y)$ that geometrically lies on both lines.  Thus a unique solution occurs if the lines are not parallel since they then intersect at a single point.
%\footnote{At least within Euclidean geometry!}
The system has no solution if the lines are parallel (equal slopes) but do not overlap.  The system has infinitely many solutions if the two lines are parallel and do overlap (i.e. are coincident).
\begin{center}
% Uncomment the following if \asybox has not been created elsewhere.
%\newsavebox\asybox
\begin{lrbox}{\asybox}
\begin{asy}
import graph;
size(200,0);
real f(real x) {return -2*x/3+3;}
pair F(real x) {return (x,f(x));}
real g(real x) {return -2*x/3+2;}
pair G(real x) {return (x,g(x));}
real h(real x) {return x+.2;}
pair H(real x) {return (x,h(x));}
xaxis("$x$",xmin=-1,xmax=3,Arrow(HookHead,size=4));
yaxis("$y$",ymin=-.75,ymax=3,Arrow(HookHead,size=4));
draw(graph(f,.5,2.5,operator --),red+2);
//draw(graph(f,.75,2.25,operator --),black+3);
//draw(graph(g,.5,2.5,operator --),red+2);
draw(graph(h,.5,2.5,operator --),red+2);
dot(F(126/75),black+5);
label("$\mathit{l}_1$",F(2.5),SW);
//label("$\mathit{l}_1=\mathit{l}_2$",F(2.5),SW);
//label("$\mathit{l}_2$",G(2.5),SW);
label("$\mathit{l}_2$",H(2.5),SE);
label("lines not parallel",(.45,-.4),E);
//label("different parallel lines",(.25,-.4),E);
//label("coincident parallel lines",(.25,-.4),E);
\end{asy}
\end{lrbox}
\hfill\resizebox{1.75in}{!}{\usebox\asybox}
\hfill
\begin{lrbox}{\asybox}
\begin{asy}
import graph;
size(200,0);
real f(real x) {return -2*x/3+3;}
pair F(real x) {return (x,f(x));}
real g(real x) {return -2*x/3+2;}
pair G(real x) {return (x,g(x));}
real h(real x) {return x+.2;}
pair H(real x) {return (x,h(x));}
xaxis("$x$",xmin=-1,xmax=3,Arrow(HookHead,size=4));
yaxis("$y$",ymin=-.75,ymax=3,Arrow(HookHead,size=4));
draw(graph(f,.5,2.5,operator --),red+2);
//draw(graph(f,.75,2.25,operator --),black+3);
draw(graph(g,.5,2.5,operator --),red+2);
//draw(graph(h,.5,2.5,operator --),red+2);
//dot(F(126/75),black+5);
label("$\mathit{l}_1$",F(2.5),SW);
//label("$\mathit{l}_1=\mathit{l}_2$",F(2.5),SW);
label("$\mathit{l}_2$",G(2.5),SW);
//label("$\mathit{l}_2$",H(2.5),SE);
//label("lines not parallel",(.45,-.4),E);
label("different parallel lines",(.25,-.4),E);
//label("coincident parallel lines",(.25,-.4),E);
\end{asy}
\end{lrbox}
\resizebox{1.75in}{!}{\usebox\asybox}
\hfill
\begin{lrbox}{\asybox}
\begin{asy}
import graph;
size(200,0);
real f(real x) {return -2*x/3+3;}
pair F(real x) {return (x,f(x));}
real g(real x) {return -2*x/3+2;}
pair G(real x) {return (x,g(x));}
real h(real x) {return x+.2;}
pair H(real x) {return (x,h(x));}
xaxis("$x$",xmin=-1,xmax=3,Arrow(HookHead,size=4));
yaxis("$y$",ymin=-.75,ymax=3,Arrow(HookHead,size=4));
draw(graph(f,.5,2.5,operator --),red+2);
draw(graph(f,.75,2.25,operator --),black+3);
//draw(graph(g,.5,2.5,operator --),red+2);
//draw(graph(h,.5,2.5,operator --),red+2);
//dot(F(126/75),black+5);
//label("$\mathit{l}_1$",F(2.5),SW);
label("$\mathit{l}_1=\mathit{l}_2$",F(2.5),SW);
//label("$\mathit{l}_2$",G(2.5),SW);
//label("$\mathit{l}_2$",H(2.5),SE);
//label("lines not parallel",(.45,-.4),E);
//label("different parallel lines",(.25,-.4),E);
label("coincident parallel lines",(.25,-.4),E);
\end{asy}
\end{lrbox}
\resizebox{1.75in}{!}{\usebox\asybox}
\hfill~
\end{center}
In Example~\ref{exam:twodunique} the solution is unique as the lines are not parallel and intersect only at the point~$(1,-2)$.

\subsection{Consistent and Homogeneous Linear Systems}
\definition{A linear system which has at least one solution is called \textbf{consistent}. This means that the system will have \textbf{at least one solution}. A system which has no solution is called \textbf{inconsistent}.}

\begin{example}
  \begin{enumerate}
  \item The system $\begin{cases}
    x-3y=2\\2x-6y=2
  \end{cases}$ is inconsistent because there are no solutions to this system.\newline To see this algebraically note the left side of the second equation is double the left side of the first but the right sides are equal. If, for given $x$ and $y$, the left side is zero then this is not a solution.  If, for given $x$ and $y$, the left sides are non-zero then both must be so with one being double the other which contradicts them being equal as required by the right sides. Geometrically, writing the equations in point-slope form shows they both have slope $m=1/3$ so they are parallel but a solution to the first, such as $(x,y)=(0,-2/3)$, is not a solution of the second, so the lines do not overlap.

  \item The system $\begin{cases}
    y-x = 1\\
    2y+x =1\\
  \end{cases}$ is consistent because it has at least one solution, $x=-1/3$, $y=2/3$ which can be verified by substitution.  Geometrically, writing the lines in point-slope form shows they have slopes $m_1=1$ and $m_2=-1/2$ respectively which are not equal so the lines are not parallel.  Since they lie in the plane they intersect at a point, in fact $(-1/3,2/3)$, which is a solution of the system.
  \end{enumerate}
\end{example}

\textbook{\newpage}
\definition{A \textbf{homogeneous system} is a linear system in which every linear equation is homogeneous (i.e. right-hand side constant terms are all zero).  A \textbf{non-homogeneous system} is a system in which at least one linear equation is non-homogeneous.}

\begin{example}
  The system $\begin{cases}
    x+y=0\\2x-4y=0\\
  \end{cases}$ is homogeneous.
\end{example}

Every homogeneous system is consistent since setting all unknowns equal zero ($x=0$, $y=0$ in the previous example) will be a solution to the linear system.

%Should add notes about how to determine if a system is consistent or inconsistent or at least that that will be one of the things we want to know.

\definition{If the number of equations in a linear system equals the number of unknowns the system is called \textbf{determined}.  If the number of equations is less than the number of unknowns the system is \textbf{underdetermined}.  If the number of equations exceeds the number of unknowns the system is \textbf{overdetermined}.}

\begin{example} Describe the following systems of linear equations:
  \begin{enumerate}
    \item \begin{align*}
      3x + 2z &= 7\\
      x-4y-4z &= 3\\
      3x+3y + 8z &= 0\\
    \end{align*}
    There are 3 equations with 3 unknowns, thus the system is determined. It is non-homogeneous since the right hand side is not identically zero.
    \item \begin{align*}
      -x+2z+ w &= 0\\
      2x+3y-5z+w &= 0\\
      z-2w &= 0\\
    \end{align*}
    There are 3 equations with 4 unknowns, therefore the system is underdetermined.  It is homogeneous since the right hand side is identically zero and so also a consistent system as $(x,y,z,w)=(0,0,0,0)$ will be at least one solution.
    \item \begin{align*}
      2x-y &= 2\\
      -x+y &= 7\\
      -5x + 6y &= -4\\
    \end{align*}
    There are 3 equations with 2 unknowns, therefore the system is overdetermined.  It is also non-homogeneous.
  \end{enumerate}
\end{example}

\section{Parameterization of Solutions}

When a linear system has an infinite number of solutions, these can be conveniently described by the introduction of one or more \textbf{parameters}.  These are independent variables in the solution description which can be assigned any numerical values to produce one of the solutions to the linear system.
\begin{example}\label{ex:parametric}
  Show that the following parametric form
  \begin{align*}
    x&=2s+1\\
    y&=1-s\\
    z&=s
  \end{align*}
  where parameter $s$ is any real number, is a solution to the underdetermined linear system
 \begin{align*}
      2x+3y-z &= 5\\
      -x+2z &= -1\\
 \end{align*}

 Solution:\\
 We must show that $x=2s+1$, $y=1-s$, $z=s$ satisfies each linear equation in the system for any value of $s$.  Direct substitution in the left-hand side of the first equation gives
\begin{align*}
  2x+3y-z&=2(2s+1)+3(1-s)-s\\
  &=4s+2+3-3s-s\\
  &=5
\end{align*}
as required.  Substitution into the second linear equation gives
\begin{align*}
  -x+2z &= -(2s+1)+2s \\
  &= -2s-1+2s \\
  &=-1
\end{align*}
showing that it is also satisfied.  Choosing a particular value of $s$ in the parametric form (such as $s=2$) would provide $(x,y,z)=(5,-1,2)$, one of the infinitely many solutions of the system.
\end{example}

We will see that any consistent linear system with more than one solution can have its \textbf{general solution} described, using enough parameters, in a \textbf{parametric form}.  Such a parametric solution is not unique and can be written in several ways. The reader may verify that
 \begin{align*}
    x&=-2t+3\\
    y&=t\\
    z&=1-t
 \end{align*}
 for parameter $t$ is also a parametric solution to the linear system in Example~\ref{ex:parametric}\,.

We can interpret our parametric solution in the previous example geometrically.  A linear equation in three unknowns has the form
\[a_1x+a_2y+a_3z=b\ .\]
If at least one of the coefficients $a_i$ is non-zero we will see that its solutions $(x,y,z)$ constitute a plane in three-dimensional space.  A solution of a linear system involving two equations in three unknowns requires geometrically that the solutions lie simultaneously on two planes.  The intersection of two planes that are not parallel is a line.  Our first parametric solution, by finding the points generated by evaluating it for all possible values of $s$,  describes this line in three-dimensional space.

If we had a third equation in our linear system we would have had a determined system.  We would have expected typically a single solution since three planes (assuming each equation represents a plane) typically intersect at a point.  The line intersection of the first two planes will be cut at a single point by the third plane.
\begin{center}
% The following asymptote code currently generates an error regarding some
% incompatibility with hyperref.  I have compiled the image separately and
% included it.
\includegraphics[width=1in]{linearequations/threeplanes}
% See the asymptote documentation on how to do this.
%\begin{asy}
%size(6cm,0);
%import bsp;
%settings.prc=false;
%real u=2.5;
%real v=1;
%currentprojection=oblique;
%path3 r=plane((2u,0,0),(0,2v,0),(-u,-v,0));
%path3 l=rotate(90,Z)*rotate(90,Y)*r;
%path3 b=rotate(90,X)*rotate(90,Y)*r;
%face[] faces;
%filldraw(faces.push(r),project(r),lightred);
%filldraw(faces.push(l),project(l),lightgrey);
%filldraw(faces.push(b),project(b),lightblue);
%add(faces);
%\end{asy}
\end{center}
% Add more diagrams

If we had added a fourth equation forming an overdetermined system we typically would expect no solution since if each equation represents a plane, the point that is the intersection of the first three planes will not, in general, lie on the fourth.

So generally one expects that underdetermined systems have an infinite number of solutions, determined systems have one solution and overdetermined systems have no solution.  There are exceptions, however, due to the fact that (as in a three dimensional example such as ours) some of the planes could be parallel and, if so, either overlap or not.  If they overlap then one could really have removed one of them without affecting the system.  If they don't overlap then the system must be inconsistent.  Also a linear equation in our three dimensional example may not represent a plane, for instance, if all the coefficients $a_i=0$.  In that case if $b=0$ such an equation could be removed as it produces no restriction on the variables ($0=0$).  If $b\neq0$ then that equation has no solution ($0\neq b$) and hence the linear system would be inconsistent.  Other exceptions are also possible.  As such we will have to come up with a more systematic analysis of our linear systems.  That said, if, for instance, the constants in our linear system were generated completely at random our expectation on the nature of the solution set would be based on a consideration of the number of equations and the number of unknowns.

As a final comment, the behaviour of linear equations gives us insight into the behaviour of arbitrary equations.  For instance, if we had a system of two non-linear equations in three unknowns (three dimensions) each equation would represent more generally a surface, not a plane.  However if a solution exists (the surfaces intersect) then in the neighbourhood around that point the surfaces could typically be approximated by their tangent planes which, as we have discussed, would intersect in a line.  Now for our surfaces as we move further away from our initial point we do not expect a straight line, but rather a curve for the solution.  So, for instance, two intersecting spherical surfaces will typically intersect in a circle.\footnote{They could intersect at a point if they just touched each other.  Note that the tangent planes in this case are also exceptional as they are parallel and coincident.}  In the case of having three equations in three unknowns we can again consider that in the vicinity of a solution the surfaces will behave like three intersecting tangent planes.  As such we expect the solution to be typically isolated (a point) since the intersecting planes, generally speaking, would have a unique solution.  As an example, a third spherical surface would intersect the circular intersection of the first two at isolated points.  As such our expectation for general systems of equations follows from the behaviour of linear ones.  If the number of equations equals the number of unknowns we expect, if solution exist, that they are isolated solutions.  Having fewer equations than unknowns we expect that if solutions exist that there will be an infinite number of them.  Finally if we have more equations than unknowns we expect no solutions.
% Add diagrams

\section{Elementary Methods for Solving Linear Systems}
So far we have only checked that certain values are solutions to linear equations and systems.  The obvious question is how does one find these solutions. To solve a linear system involving few variables there are several strategies that involve eliminating variables.
\begin{example}
  Solve the linear system
  \begin{align*}
      5x+y &= 3\\
      2x-y &= 4\\
  \end{align*}

  Solution:\\
  One method to eliminate a variable is to add a suitable multiple of one equation to the other.  In this example simply adding both sides of the equation eliminates the $y$ variable:
  \begin{align*}
    5x+y+2x-y &= 3+4 \\
    7x &= 7\\
    x &=1
  \end{align*}
  Substitution of $x=1$ into the second original equation then gives
  \begin{align*}
    2(1)-y&=4 \\
    2-y&=4\\
    -y&=2\\
    y&=-2
  \end{align*}
  Thus $x=1$ and $y=-2$ is a solution to the system.

  A second method to solve the system is the \textbf{method of substitution}.  Solving the first equation for $y$ gives $y=3-5x$.  Substitution of $3-5x$ for $y$ in the second equation then gives
  \begin{align*}
    2x-(3-5x)&=4\\
    7x-3&=4\\
    7x&=7\\
    x&=1
  \end{align*}
  Then substitution of $x=1$ into $y=3-5x$ gives $y=3-5(1)=-2$ as before.

  One can easily check that $(x,y)=(1,-2)$ solves the original system.
\end{example}
% Here show adding/subtracting equations.  Also substitution.

For a linear system with more variables and many non-zero constants like
\begin{align*}
      x+y+2z &= 9\\
      2x+4y -3z&= 1\\
      3x + 6y -5z &= 0\\
\end{align*}
we cannot easily eliminate the variables to obtain a solution.  Thus we need to develop systematic techniques to solve linear systems.

%\clearpage
%\begin{exercise}
%This exercise was written by Michael Thatcher
%\input{linearequations/problemset1}                       
%\end{exercise}
%
% TODO:
% Add more diagrams for 3D Geometrical Interpretation (page 10)
%
% Make a problem that asks whether the an equation (or system) is linear or
% not and include a problem like
% 5x^2/x+3y=7
% This is not linear as it is not equivalent to 5x+3y=7 as the former is
% undefined on the line x=0.
%
% Maybe I should show how a linear system arises from discretizing an ODE
% somewhere.  i.e. connect to finite difference equations.  This could be
% a computer application.
%
