**Read** Section 2.2 for next class.
Remember that the text gives more examples and explanation than I can
give in a lecture.
Work through recommended homework questions.

**Office hour:** Monday, 3:00-3:30, and Wednesday, 11:30-noon, MC103B.

**Help Centers:** Monday-Friday 2:30-6:30 in MC 106.

**Example:** Find the distance from the point $B = (1,3,6)$ to the
line through $P = (1, 1, 0)$ in the direction $\vd = [0,-1,1]$.
We derived the formula $d(B, \ell) = \| \vv - \proj_\vd(\vv) \|$,
where $\vv = \vec{PB}$.

If the line was in $\R^2$ and had been described in normal form, one could instead compute $\| \proj_\vn(\vv) \|$, which saves one step.

**Definition:** A **linear equation** in the variables $x_1, x_2, \ldots, x_n$
is an equation that can be written in the form
$$
a_1 x_1 + a_2 x_2 + \cdots + a_n x_n = b ,
$$
where the **coefficients** $a_1, \ldots, a_n$ and the **constant term** $b$
are constants.

**Linear equations:**
$$
\kern-6ex
\begin{aligned}
2x - 5y\ &= 10, & r + \frac{1}{2} s\ &= 0.5 t - 2, \\
x\ &= 0, & \quad x_1 - \sqrt{2} \, x_2 - (\sin \frac{\pi}{5}) \, x_3\ &= 0 .
\end{aligned}
$$
**Non-linear equations:**
$$
\kern-6ex
x y + z = 1, \quad x^2 + y^2 = 2, \quad \sin(x) = 0, \quad 2^y + z = 16.
$$

A **solution** to
$ a_1 x_1 + a_2 x_2 + \cdots + a_n x_n = b $
is a vector $[s_1, \ldots, s_n]$ such that the equation is true when
we substitute $x_1 = s_1, \ldots, x_n = s_n$.
For example, $[ 10, 2 ]$ is a solution to $2x-5y=10$.

When a linear equation has two unknowns, its solutions form a line in $\R^2$. (The linear equation is the general form of this line.) To describe the solutions in parametric form, we can solve for one of the variables in terms of the other.

For example, for $2x-5y=10$, we can write $y = \frac{2}{5} x - 2$. If we set $x$ to a parameter $t$, we get parametric solutions $$ \begin{aligned} x\ &= t \\ y\ &= \frac{2}{5} t - 2 \end{aligned} $$ or, more concisely, $[t, \frac{2}{5} t - 2]$.

When there are three variables, the solutions form a plane, and it can be described in parametric form by solving for one variable in terms of the other two.

The same works when there are $n$ variables: we can solve for one in terms of all of the others, and get a solution with $n-1$ parameters.

**Definition:** A **system of linear equations** is a finite set of
linear equations, each with the same variables.
A **solution** to the system is a vector that satisfies *all* of the equations.

**Example:**
$$
\begin{aligned}
x + y\ &= 2\\
-x + y\ &= 4
\end{aligned}
$$
Is $[1, 1]$ a solution? How about $[-1, 3]$? How can we find all solutions?
What's happening geometrically?

**Example:**
$$
\begin{aligned}
x + \phantom{2} y\ &= 2\\
2 x + 2 y\ &= 4
\end{aligned}
$$
Is $[1, 1]$ a solution? How about $[-1, 3]$? How can we find all solutions?
What's happening geometrically?

**Example:**
$$
\begin{aligned}
x + y\ &= 2\\
x + y\ &= 3
\end{aligned}
$$
Is $[1, 1]$ a solution? How about $[-1, 3]$? How can we find all solutions?
What's happening geometrically?

A system is **consistent** if it has one or more solutions,
and **inconsistent** if it has no solutions.
We'll see later that a consistent system always has either one
solution or infinitely many.

**Example 2.5:**
Similarly, a large system such as
$$
\begin{aligned}
x - y - \phantom{3} z\ &= 2 \\
y + 3 z\ &= 5 \\
5 z\ &= 10
\end{aligned}
$$
is easy to solve, because of its **triangular** structure.
The method is called **back substitution**:
$$
\begin{aligned}
z\ &= 2\\
y\ &= 5 - 3z = 5 - 6 = -1\\
x\ &= 2 + y + z = 2 - 1 + 2 = 3.
\end{aligned}
$$
So the unique solution is $[3, -1,\, 2]$.

Let's see how a general system can be converted into a system with a triangular form.

**Example 2.6:** We'll solve the system on the left
$$
\begin{aligned}
\ph x - \ph y - \ph z\ &= 2 \\
3 x - 3 y + 2 z\ &= 16 \\
2 x - \ph y + \ph z\ &= 9
\end{aligned}
\qquad\qquad
\bmat{rrr|r}
1 & -1 & -1 & 2 \\
3 & -3 & 2 & 16 \\
2 & -1 & 1 & 9
\emat
$$
but to save time, we can write it as the **augmented matrix** on the right.

Today, we'll show the equations as well.

To put it into triangular form, the first step is to eliminate the $x$s in equations 2 and 3. We write $R_i$ for the $i$th equation or the $i$th row of the augmented matrix.

Replace $R_2$ with $R_2 - 3 R_1$: $$ \begin{aligned} \ph x - \ph y - \ph z\ &= 2 \\ 5 z\ &= 10 \\ 2 x - \ph y + \ph z\ &= 9 \end{aligned} \qquad\qquad \bmat{rrr|r} 1 & -1 & -1 & 2 \\ 0 & 0 & 5 & 10 \\ 2 & -1 & 1 & 9 \emat $$ Replace $R_3$ with $R_3 - 2 R_1$: $$ \begin{aligned} \ph x - \ph y - \ph z\ &= 2 \\ 5 z\ &= 10 \\ y + 3 z\ &= 5 \end{aligned} \qquad\qquad \bmat{rrr|r} 1 & -1 & -1 & 2 \\ 0 & 0 & 5 & 10 \\ 0 & 1 & 3 & 5 \emat $$ Now we can exchange rows 2 and 3, to end up in triangular form: $$ \begin{aligned} \ph x - \ph y - \ph z\ &= 2 \\ y + 3 z\ &= 5 \\ 5 z\ &= 10 \end{aligned} \qquad\qquad \bmat{rrr|r} 1 & -1 & -1 & 2 \\ 0 & 1 & 3 & 5 \\ 0 & 0 & 5 & 10 \\ \emat $$ Hey! This is the system we solved earlier, so now we know that the solution is $[3, -1, 2]$.

This system and the original system have *exactly* the same solutions. (Explain.)
We say they have the same **solution set** and therefore that they are
**equivalent** systems.

**True/false:**
The equation
$$
\frac{x}{\sin(2)} + y = z
$$
is linear.

**True/false:**
The system
$$
\begin{aligned}
2 x + 3 y + 4 z\ &= 7 \\
4 x + 6 y + 8 z\ &= 9
\end{aligned}
$$
has no solutions.

Alternatively, one can subtract twice the first equation from the second to get $0 = -5$, which has no solution.

**True/false:**
The system
$$
\begin{aligned}
2 x + 3 y + 4 z\ &= 7 \\
4 x + 6 y + 8 z\ &= 14
\end{aligned}
$$
has a unique solution.

**Question:**
Solve the system
$$
\begin{aligned}
2 x + 3 y\ &= 2 \\
x + 2 y\ &= 2
\end{aligned}
$$
geometrically and algebraically.

**Algebraically:** subtracting half of the first equation from the second gives
$$
\begin{aligned}
2 x + 3 y\ &= 2 \\
\frac{1}{2} y\ &= 1
\end{aligned}
$$
Now we apply back substitution.
The second equation gives $y = 2$, and then the first equation gives $x = -2$.
(Check that this satisfies the original equation!)

**Question:**
How many solutions does the system
$$
\begin{aligned}
2 x + 3 y\ &= 2 \\
x + 2 y\ &= 2 \\
x + 4 y\ &= 2
\end{aligned}
$$
have?

This about this for next class.