# Not Just Calculus: First-Year Introduction to Upper-Level Mathematics

## Section2.2Linear Mappings

A function $$L\colon \R^2\to \R^2$$ is called a linear mapping (or linear map) if $$L$$ respects the operations of vector addition and scalar multiplication, that is, if
\begin{align} L({\mathbf u}+{\mathbf v}) \amp = L({\mathbf u})+L({\mathbf v}), \text{ and }\tag{2.2.1}\\ L(\alpha{\mathbf u}) \amp = \alpha L({\mathbf u})\tag{2.2.2} \end{align}
for all $${\mathbf u},{\mathbf v}\in \R^2$$ and all $$\alpha\in \R\text{.}$$ It is customary to omit the parentheses in the expression $$L({\mathbf u})$$ and simply write $$L{\mathbf u}$$ to denote the value of a linear mapping. With this convention, equations (2.2.1) and (2.2.2) become
\begin{align*} L({\mathbf u}+{\mathbf v}) \amp = L{\mathbf u}+L{\mathbf v}, \text{ and }\\ L(\alpha{\mathbf u}) \amp = \alpha L{\mathbf u}. \end{align*}

### Checkpoint2.2.1.

For each of the following functions, determine whether or not it is linear. If a given function is linear, show that it satisfies properties (2.2.1) and (2.2.2). If a given function is not linear, give a specific example to show that it fails at least one of the properties (2.2.1) or (2.2.2).
1. the function that sends every input point to its reflection across the $$x$$-axis
2. the function $$g$$ given by $$g(a,b)=(a+b,\sqrt{a^2+b^2})$$
3. the constant function that sends every input point to the origin
4. the constant function that sends every input point to the point $$(1,0)$$
5. the function $$h$$ given by $$h(a,b)=(a+b,a-b)$$
6. the function that sends input vector $$\mathbf{x}$$ to output $$\mathbf{x}+\mathbf{b}\text{,}$$ where $$\mathbf{b}$$ is a constant nonzero vector
If $$L$$ is linear, and $${\mathbf u}=(x,y)$$ is an arbitrary input value, then
\begin{align} L{\mathbf u} \amp = L(x{\mathbf e}_1 + y{\mathbf e}_2)\amp \amp (\text{using } \knowl{./knowl/xref/stdbasisexpansion.html}{\text{(2.1.4)}})\tag{2.2.3}\\ \amp = L(x{\mathbf e}_1) + L(y{\mathbf e}_2)\amp\amp (\text{by }\knowl{./knowl/xref/linsumprop.html}{\text{(2.2.1)}}) \tag{2.2.4}\\ \amp = xL{\mathbf e}_1 + yL{\mathbf e}_2\amp\amp (\text{by }\knowl{./knowl/xref/linscaleprop.html}{\text{(2.2.2)}}).\tag{2.2.5} \end{align}
If we write $$L{\mathbf e_1} = (a_1,b_1)$$ and $$L{\mathbf e_2} = (a_2,b_2)\text{,}$$ then the last expression (2.2.5) above becomes
$$L{\mathbf u}=x(a_1,b_1)+y(a_2,b_2)=(a_1x+a_2y,b_1x+b_2y).\tag{2.2.6}$$
Thus, a linear mapping has a particularly simple form, and is summarized by four real constants $$a_1,b_1,a_2,b_2$$ that are the components of the two values $$L{\mathbf e}_1,L{\mathbf e}_2\text{.}$$ The square array of numbers $$\twotwo{a_1}{a_2}{b_1}{b_2}$$ is called the matrix for $$L\text{,}$$ denoted $$[L]$$. The array $$\begin{bmatrix} x\\y\end{bmatrix}$$ is called the column vector that represents $${\mathbf u}=(x,y)\text{.}$$ Equation (2.2.6) motivates the following definition of the operation that multiplies a matrix times a column vector.
$$\twotwo{a_1}{a_2}{b_1}{b_2}\begin{bmatrix} x\\y\end{bmatrix} = \begin{bmatrix} a_1x+a_2y\\b_1x+b_2y\end{bmatrix}\tag{2.2.7}$$

### Checkpoint2.2.2.

1. Suppose that $$f\colon \R^2\to\R^2$$ is given by $$f(x,y)=(ax+by,cx+dy)$$ for some real constants $$a,b,c,d\text{.}$$ Show that $$f$$ is linear.
2. Suppose that the matrix for a linear map $$L$$ is $$\twotwo{2}{1}{1}{-1}\text{.}$$ Find $$L(3,2)\text{.}$$
3. Suppose that a linear map $$L$$ satisfies $$L(2,0)=(3,4)$$ and $$L(0,3)=(2,1)\text{.}$$ Find the matrix for $$L\text{.}$$

### Checkpoint2.2.3.

Given linear maps $$L,M\colon \R^2\to \R^2$$ and a real number $$\alpha\text{,}$$ we define linear maps $$\alpha L\text{,}$$ $$L+M$$ and $$LM$$ by
\begin{align} (\alpha L){\mathbf u} \amp = \alpha (L{\mathbf u})\tag{2.2.8}\\ (L+M){\mathbf u} \amp = L{\mathbf u} + M{\mathbf u}\tag{2.2.9}\\ (LM){\mathbf u} \amp = (L\circ M){\mathbf u} = L(M{\mathbf u}).\tag{2.2.10} \end{align}

### Checkpoint2.2.4.

Verify that $$\alpha L\text{,}$$ $$L+M\text{,}$$ and $$LM$$ are indeed linear maps, that is, that they satisfy properties (2.2.1) and (2.2.2).
If the matrix for $$L$$ is $$\twotwo{a}{b}{c}{d}\text{,}$$ and the matrix for $$M$$ is $$\twotwo{e}{f}{g}{h}\text{,}$$ then the matrices (the plural of matrix is matrices) for the linear maps $$\alpha L\text{,}$$ $$L+M\text{,}$$ and $$LM$$ are given by the following.
\begin{align} (\text{matrix for } \alpha L) \amp = \twotwo{\alpha a}{\alpha b}{\alpha c}{\alpha d}\tag{2.2.11}\\ (\text{matrix for } L+M) \amp = \twotwo{a+e}{b+f}{c+g}{d+h}\tag{2.2.12}\\ (\text{matrix for } LM) \amp = \twotwo{ae+bg}{af+bh}{ce+dg}{cf+dh}\tag{2.2.13} \end{align}
These natural constructions motivate the following matrix operations, called matrix scalar multiplication, matrix addition, and matrix multiplication, respectively.
\begin{align} \alpha \twotwo{a}{b}{c}{d} \amp = \twotwo{\alpha a}{\alpha b}{\alpha c}{\alpha d}\tag{2.2.14}\\ \twotwo{a}{b}{c}{d} + \twotwo{e}{f}{g}{h} \amp = \twotwo{a+e}{b+f}{c+g}{d+h}\tag{2.2.15}\\ \twotwo{a}{b}{c}{d}\twotwo{e}{f}{g}{h} \amp = \twotwo{ae+bg}{af+bh}{ce+dg}{cf+dh}\tag{2.2.16} \end{align}
Notice that every entry in the matrix on the right side of (2.2.16) is a dot product. For example, the entry $$af+bh$$ in the upper right corner (top row, right column) of the matrix on the right side of (2.2.16) is the dot product
\begin{equation*} (a,b)\cdot (f,h) = af+bh \end{equation*}
of the top row of $$\twotwo{a}{b}{c}{d}$$ with the right column of $$\twotwo{e}{f}{g}{h}\text{.}$$ The row and column matching pattern works for every entry in the product matrix.

### Checkpoint2.2.5.

1. Choose random integer values between $$-5$$ and $$+5$$ for the constants $$\alpha,a,b,c,d,e,f,g,h,x,y\text{.}$$ Set $$S=\twotwo{a}{b}{c}{d}\text{,}$$ let $$T=\twotwo{e}{f}{g}{h}\text{,}$$ and let $$\mathbf{u}=\begin{bmatrix}x\\y\end{bmatrix}\text{.}$$ Calculate $$\alpha S\text{,}$$ $$S+T\text{,}$$ $$ST\text{,}$$ $$TS\text{,}$$ $$S\mathbf{u}\text{,}$$ and $$T\mathbf{u}\text{.}$$ Check your answers with an online matrix algebra calculator. Repeat the exercise until you can do matrix multiplication quickly and accurately, without having to look at the formula (2.2.16).
2. Find a set of values for $$a,b,c,d,e,f,g,h$$ for which $$ST\neq TS\text{.}$$ Find another set of values for $$a,b,c,d,e,f,g,h\text{,}$$ all of them nonzero, for which $$ST=TS\text{.}$$
The identity function $$\Id\colon \R^2\to\R^2$$ is linear, and the matrix $$\twotwo{1}{0}{0}{1}$$ for the identity function is called the identity matrix. It is easy to check that
$$\twotwo{a}{b}{c}{d}\twotwo{d}{-b}{-c}{a} = \twotwo{d}{-b}{-c}{a}\twotwo{a}{b}{c}{d} = \twotwo{ad-bc}{0}{0}{ad-bc}.\tag{2.2.17}$$
If $$ad-bc\neq 0\text{,}$$ then we can multiply (2.2.17) by $$\frac{1}{ad-bc}$$ to obtain
$$\twotwo{a}{b}{c}{d}\twotwo{\frac{d}{ad-bc}}{\frac{-b}{ad-bc}}{\frac{-c}{ad-bc}}{\frac{a}{ad-bc}} = \twotwo{\frac{d}{ad-bc}}{\frac{-b}{ad-bc}}{\frac{-c}{ad-bc}}{\frac{a}{ad-bc}}\twotwo{a}{b}{c}{d} = \twotwo{1}{0}{0}{1}.\tag{2.2.18}$$
If $$L,M$$ are linear mappings such that $$[L] = \twotwo{a}{b}{c}{d}$$ and $$[M] = \frac{1}{ad-bc}\twotwo{d}{-b}{-c}{a}\text{,}$$ then (2.2.18) becomes
$$[L][M] = [M][L] = [\Id] \tag{2.2.19}$$
which is the same as
$$[LM] = [ML] = [\Id]. \tag{2.2.20}$$
From this, it follows that
$$L\of M = M\of L = \Id \tag{2.2.21}$$
and we conclude that $$L,M$$ are inverses to one another. This shows that, if $$[L]=\twotwo{a}{b}{c}{d}$$ and $$ad-bc\neq 0\text{,}$$ then $$[L^{-1}]=\frac{1}{ad-bc}\twotwo{d}{-b}{-c}{a}\text{,}$$ and motivates the following definition of the inverse of a matrix.
\begin{align} \twotwo{a}{b}{c}{d}^{-1} = \frac{1}{ad-bc}\twotwo{d}{-b}{-c}{a} \amp \amp (\text{ if } ad-bc\neq 0)\tag{2.2.22} \end{align}
Comment: The quantity $$ad-bc$$ is called the determinant of the matrix $$\twotwo{a}{b}{c}{d}\text{,}$$ denoted $$\det\left(\twotwo{a}{b}{c}{d}\right)$$.

### Checkpoint2.2.6.

1. Verify that the identity function $$\Id\colon \R^2\to \R^2$$ is linear, and that the matrix for the identity function is $$\twotwo{1}{0}{0}{1}\text{.}$$
2. Verify each of the equalities in (2.2.17).
3. Explain each of the connecting phrases "which is the same as", "it follows that", and "we conclude that" immediately following equations (2.2.19), (2.2.20), and (2.2.21).
Hint.
For the last statement, use Corollary 1.2.4.

### ExercisesExercises

#### 1.

Verify the matrix formulas (2.2.11), (2.2.12), and (2.2.13).
Hint.
To obtain the matrix for a linear map $$L\text{,}$$ use the fact that the first column of the matrix is the column vector $$L\mathbf{e}_1\text{,}$$ and the second column is the column vector $$L\mathbf{e}_2\text{.}$$

#### 2.Distributive law for linear functions.

Prove the following property of linear mappings, called the distributive law. For linear mappings $$K,L,M$$ from $$\R^2$$ to $$\R^2\text{,}$$ we have
$$K(L+M)=KL+KM.\tag{2.2.23}$$

#### 3.Solving linear systems of equations.

A pair of equations of the form
\begin{align} ax + by \amp = r\tag{2.2.28}\\ cx + dy \amp = s\notag \end{align}
where $$a,b,c,d,r,s$$ are constants, and $$x,y$$ are unknowns, is called a linear system of equations in two unknowns. A solution is a pair of values for $$x,y$$ so that both equations in (2.2.28) hold. We can use matrix algebra to solve linear systems of equations, as follows. Using the notation defined in (2.2.7), here is the matrix version of (2.2.28).
$$\twotwo{a}{b}{c}{d}\begin{bmatrix}x\\y\end{bmatrix} =\begin{bmatrix}r\\s\end{bmatrix}\tag{2.2.29}$$
The matrix $$A=\twotwo{a}{b}{c}{d}$$ is called the matrix of coefficients for the linear system. If we write $$\mathbf{u}=\begin{bmatrix}x\\y\end{bmatrix}$$ and $$\mathbf{v}=\begin{bmatrix}r\\s\end{bmatrix}$$ then we can write (2.2.29) even more compactly as
$$A\mathbf{u} = \mathbf{v}.\tag{2.2.30}$$
If $$A$$ is invertible, we can multiply both sides of (2.2.30) by $$A^{-1}$$ on the left, and we have
$$\mathbf{u} = A^{-1}A\mathbf{u} = A^{-1}\mathbf{v}.\tag{2.2.31}$$
1. Use this matrix method to solve the following linear system. Find $$A\text{,}$$ $$A^{-1}\text{,}$$ $$x\text{,}$$ and $$y\text{.}$$
\begin{equation*} \begin{array}{ccccc} 3x \amp - \amp y \amp = \amp -2\\ x \amp + \amp 2y \amp = \amp 3 \end{array} \end{equation*}
2. Choose random integer values between $$-5$$ and $$+5$$ for the constants $$a,b,c,d,r,s\text{.}$$ Let $$A=\twotwo{a}{b}{c}{d}\text{,}$$ let $$\mathbf{u}=\begin{bmatrix}x\\y\end{bmatrix}\text{,}$$ and let $$\mathbf{v}=\begin{bmatrix}r\\s\end{bmatrix}\text{.}$$ Solve the linear system $$A\mathbf{u}=\mathbf{v}$$ for $$\mathbf{u}\text{.}$$ Check your answers with an online matrix algebra calculator. Repeat the exercise until you can do matrix inversion and solve the system quickly and accurately, without having to look at the formula (2.2.22).

#### 4.Rotations.

Let $$R_\theta\colon \R^2 \to \R^2$$ be the counterclockwise rotation by $$\theta$$ radians about the origin, that is,
$$R_\theta(r\cos \phi,r\sin\phi)=(r\cos(\phi+\theta),r\sin(\phi+\theta)).\tag{2.2.32}$$
Show that $$R_\theta$$ is linear for all $$\theta\text{,}$$ and that its matrix is
$$[R_\theta]=\twotwo{\cos \theta}{-\sin \theta}{\sin \theta}{\cos \theta}\text{.}\tag{2.2.33}$$
Hint.
Use the trigonometric identities below, and use part 1 of Checkpoint 2.2.2.
\begin{align*} \cos (\theta + \phi) \amp = \cos \theta \cos \phi - \sin\theta \sin \phi\\ \sin(\theta+\phi) \amp = \cos \theta \sin\phi + \sin\theta\cos\phi \end{align*}

#### 5.Reflections.

1. Show that the reflection $$F_X$$ across the $$x$$-axis is linear.
2. Find the matrix for $$F_X\text{.}$$
3. Let $$\ell$$ be a line through the origin. Show that reflection $$F_\ell$$ across the line $$\ell$$ can be written as a composition $$R_{\theta}\of F_X \of R_{-\theta}$$ for some appropriate value of $$\theta\text{.}$$ Find the matrix for $$F_\ell\text{.}$$