Multivariable calculus: Exercises

02 Vectors and matrices, part 2

Exercise 1: More practice with matrix multiplication

In class, we learned that if \(A\) and \(B\) are matrices, then the product \(AB\) is defined if the number of columns of \(A\) equals the number of rows of \(B\). In other words, if \(A\) is \(m\times n\) and \(B\) is \(n\times p\), then \(AB\) is defined and is an \(m\times p\) matrix.

If the \((i,j)\)-th entry of \(A\) is \(a_{ij}\), and the \((j,k)\)-th entry of \(B\) is \(b_{jk}\), then the \((i,k)\)-th entry of \(AB\) is given by

\[ \sum_{j=1}^n a_{ij} b_{jk}. \]

Multiply the following matrices, if possible. If the multiplication is not defined, explain why not.

  1. \(A = \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix}\) and \(B = \begin{bmatrix} 5 & 6 \\ 7 & 8 \end{bmatrix}\)

  2. \(C = \begin{bmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \end{bmatrix}\) and \(D = \begin{bmatrix} 1 & 2 \\ 3 & 4 \\ 5 & 6 \end{bmatrix}\)

  3. \(E = \begin{bmatrix} 1 & 0 \\ 0 & 1 \\ 2 & 3 \end{bmatrix}\) and \(F = \begin{bmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \end{bmatrix}\)

  4. \(G = \begin{bmatrix} 2 & -1 \\ 3 & 4 \end{bmatrix}\) and \(H = \begin{bmatrix} 1 & 0 & 2 \\ -1 & 3 & 1 \end{bmatrix}\)

  5. \(J = \begin{bmatrix} 1 & 2 \\ 3 & 4 \\ 5 & 6 \end{bmatrix}\) and \(K = \begin{bmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \end{bmatrix}\)

  1. Since \(A\) is \(2 \times 2\) and \(B\) is \(2 \times 2\), the product \(AB\) is defined and will be \(2 \times 2\): \[ AB = \begin{bmatrix} 19 & 22 \\ 43 & 50 \end{bmatrix} \]

  2. Since \(C\) is \(2 \times 3\) and \(D\) is \(3 \times 2\), the product \(CD\) is defined and will be \(2 \times 2\): \[ CD = \begin{bmatrix} 22 & 28 \\ 49 & 64 \end{bmatrix} \]

  3. Since \(E\) is \(3 \times 2\) and \(F\) is \(2 \times 3\), the product \(EF\) is defined and will be \(3 \times 3\): \[ EF = \begin{bmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \\ 14 & 19 & 24 \end{bmatrix} \]

  4. Since \(G\) is \(2 \times 2\) and \(H\) is \(2 \times 3\), the product \(GH\) is defined and will be \(2 \times 3\): \[ GH = \begin{bmatrix} 3 & -3 & 3 \\ -1 & 12 & 10 \end{bmatrix} \]

  5. Since \(J\) is \(3 \times 2\) and \(K\) is \(2 \times 3\), the product \(JK\) is defined and will be \(3 \times 3\): \[ JK = \begin{bmatrix} 9 & 12 & 15 \\ 19 & 26 & 33 \\ 29 & 40 & 51 \end{bmatrix} \]

Exercise 2: Vectors in higher dimensions

In this exercise, we will work with vectors in \(\mathbb{R}^4\) and \(\mathbb{R}^5\) to get comfortable with higher-dimensional vector algebra. All the rules we learned for vectors in \(\mathbb{R}^2\) and \(\mathbb{R}^3\) extend naturally to higher dimensions.

For vectors \(\mathbf{u}\) and \(\mathbf{v}\) in \(\mathbb{R}^n\), recall that:

  • Vector addition and subtraction are performed componentwise.
  • Scalar multiplication is performed by multiplying each component by the scalar.
  • The dot product (inner product) is \(\langle \mathbf{u}, \mathbf{v} \rangle = u_1v_1 + u_2v_2 + \cdots + u_nv_n\).
  • The norm (length) of \(\mathbf{u}\) is \(\|\mathbf{u}\| = \sqrt{\langle \mathbf{u}, \mathbf{u} \rangle}\).

Let

\[ \mathbf{u} = \begin{bmatrix} 1 \\ 2 \\ -1 \\ 3 \end{bmatrix}, \quad \mathbf{v} = \begin{bmatrix} 0 \\ -1 \\ 2 \\ 1 \end{bmatrix}, \quad \text{and} \quad \mathbf{w} = \begin{bmatrix} 2 \\ 0 \\ 1 \\ -2 \end{bmatrix} \]

be vectors in \(\mathbb{R}^4\).

  1. Compute \(\mathbf{u} + \mathbf{v}\).

  2. Compute \(2\mathbf{u} - 3\mathbf{v}\).

  3. Compute \(\langle \mathbf{u}, \mathbf{v} \rangle\).

  4. Compute \(\|\mathbf{u}\|\) and \(\|\mathbf{v}\|\).

  5. Compute \(\mathbf{u} + \mathbf{v} + \mathbf{w}\).

  6. Are \(\mathbf{u}\) and \(\mathbf{w}\) orthogonal? Explain.

  1. \(\begin{bmatrix} 1 \\ 1 \\ 1 \\ 4 \end{bmatrix}\)

  2. \(\begin{bmatrix} 2 \\ 7 \\ -8 \\ 3 \end{bmatrix}\)

  3. \(-1\)

  4. \(\sqrt{15}\), \(\sqrt{6}\)

  5. \(\begin{bmatrix} 3 \\ 1 \\ 2 \\ 2 \end{bmatrix}\)

  6. To check if \(\mathbf{u}\) and \(\mathbf{w}\) are orthogonal, we compute their dot product: \[ \langle \mathbf{u}, \mathbf{w} \rangle = (1)(2) + (2)(0) + (-1)(1) + (3)(-2) = 2 + 0 - 1 - 6 = -5. \] Since the dot product is not zero, \(\mathbf{u}\) and \(\mathbf{w}\) are not orthogonal.

Exercise 3: Standard basis vectors in higher dimensions

Recall that the standard basis vectors in \(\mathbb{R}^n\) are the vectors \(\mathbf{e}_1, \mathbf{e}_2, \ldots, \mathbf{e}_n\), where \(\mathbf{e}_i\) has a 1 in the \(i\)-th position and 0s elsewhere. For example, in \(\mathbb{R}^4\),

\[ \mathbf{e}_1 = \begin{bmatrix} 1 \\ 0 \\ 0 \\ 0 \end{bmatrix}, \quad \mathbf{e}_2 = \begin{bmatrix} 0 \\ 1 \\ 0 \\ 0 \end{bmatrix}, \quad \mathbf{e}_3 = \begin{bmatrix} 0 \\ 0 \\ 1 \\ 0 \end{bmatrix}, \quad \mathbf{e}_4 = \begin{bmatrix} 0 \\ 0 \\ 0 \\ 1 \end{bmatrix}. \]

Any vector

\[ \mathbf{v} = \begin{bmatrix} v_1 \\ v_2 \\ v_3 \\ v_4 \end{bmatrix} \]

in \(\mathbb{R}^4\) can be written as a linear combination of the standard basis vectors:

\[ \mathbf{v} = v_1\mathbf{e}_1 + v_2\mathbf{e}_2 + v_3\mathbf{e}_3 + v_4\mathbf{e}_4. \]

This was called resolving a vector into the standard basis.

  1. Resolve the vector \[ \mathbf{v} = \begin{bmatrix} 3 \\ -2 \\ 5 \\ 1 \end{bmatrix} \] as a linear combination of the standard basis vectors in \(\mathbb{R}^4\).

  2. Let \(\mathbf{w} = 2\mathbf{e}_1 - 4\mathbf{e}_2 + \mathbf{e}_3 - 3\mathbf{e}_4\). Write \(\mathbf{w}\) in column vector form.

  1. \(\mathbf{v} = 3\mathbf{e}_1 - 2\mathbf{e}_2 + 5\mathbf{e}_3 + \mathbf{e}_4\)

  2. \(\mathbf{w} = \begin{bmatrix} 2 \\ -4 \\ 1 \\ -3 \end{bmatrix}\)

Exercise 4: Matrix-vector multiplication as a function

In class, we learned that every \(m \times n\) matrix \(A\) defines a function \(T:\mathbb{R}^n \to \mathbb{R}^m\) by the rule \(T(\mathbf{v}) = A\mathbf{v}\). This means that \(T\) takes an \(n\)-dimensional vector as input and produces an \(m\)-dimensional vector as output.

Let \(A = \begin{bmatrix} 1 & 2 \\ 3 & 4 \\ 5 & 6 \end{bmatrix}\).

  1. What is the domain of the function \(T\) defined by \(T(\mathbf{v}) = A\mathbf{v}\)? What is the codomain?

  2. Compute \(T\left(\begin{bmatrix} 1 \\ 0 \end{bmatrix}\right)\).

  3. Compute \(T\left(\begin{bmatrix} 0 \\ 1 \end{bmatrix}\right)\).

  4. Compute \(T\left(\begin{bmatrix} 2 \\ -1 \end{bmatrix}\right)\).

  1. The matrix \(A\) is \(3 \times 2\), so it multiplies vectors in \(\mathbb{R}^2\) and produces vectors in \(\mathbb{R}^3\). Therefore, the domain of \(T\) is \(\mathbb{R}^2\) and the codomain is \(\mathbb{R}^3\). We write \(T:\mathbb{R}^2 \to \mathbb{R}^3\).

  2. \(T\left(\begin{bmatrix} 1 \\ 0 \end{bmatrix}\right) = \begin{bmatrix} 1 & 2 \\ 3 & 4 \\ 5 & 6 \end{bmatrix} \begin{bmatrix} 1 \\ 0 \end{bmatrix} = \begin{bmatrix} (1)(1) + (2)(0) \\ (3)(1) + (4)(0) \\ (5)(1) + (6)(0) \end{bmatrix} = \begin{bmatrix} 1 \\ 3 \\ 5 \end{bmatrix}\)

  3. \(T\left(\begin{bmatrix} 0 \\ 1 \end{bmatrix}\right) = \begin{bmatrix} 1 & 2 \\ 3 & 4 \\ 5 & 6 \end{bmatrix} \begin{bmatrix} 0 \\ 1 \end{bmatrix} = \begin{bmatrix} (1)(0) + (2)(1) \\ (3)(0) + (4)(1) \\ (5)(0) + (6)(1) \end{bmatrix} = \begin{bmatrix} 2 \\ 4 \\ 6 \end{bmatrix}\)

  4. \(T\left(\begin{bmatrix} 2 \\ -1 \end{bmatrix}\right) = \begin{bmatrix} 1 & 2 \\ 3 & 4 \\ 5 & 6 \end{bmatrix} \begin{bmatrix} 2 \\ -1 \end{bmatrix} = \begin{bmatrix} (1)(2) + (2)(-1) \\ (3)(2) + (4)(-1) \\ (5)(2) + (6)(-1) \end{bmatrix} = \begin{bmatrix} 0 \\ 2 \\ 4 \end{bmatrix}\)

Exercise 5: Computing determinants

The determinant of a \(2 \times 2\) matrix \(A = \begin{bmatrix} a & b \\ c & d \end{bmatrix}\) is defined as

\[ \det(A) = ad - bc. \]

The determinant of a \(3 \times 3\) matrix \(A = \begin{bmatrix} a & b & c \\ d & e & f \\ g & h & i \end{bmatrix}\) is defined as

\[ \det(A) = a(ei - fh) - b(di - fg) + c(dh - eg). \]

  1. Compute the determinant of \(A = \begin{bmatrix} 3 & 5 \\ 2 & 4 \end{bmatrix}\).

  2. Compute the determinant of \(B = \begin{bmatrix} -1 & 2 \\ 3 & 6 \end{bmatrix}\).

  3. Compute the determinant of \(C = \begin{bmatrix} 1 & 0 & 2 \\ -1 & 3 & 1 \\ 2 & 4 & -2 \end{bmatrix}\).

  4. Compute the determinant of \(D = \begin{bmatrix} 2 & 1 & 3 \\ 0 & 4 & 1 \\ 0 & 0 & 5 \end{bmatrix}\).

  1. \(\det(A) = (3)(4) - (5)(2) = 12 - 10 = 2\)

  2. \(\det(B) = (-1)(6) - (2)(3) = -6 - 6 = -12\)

  3. Using the formula: \[ \begin{align*} \det(C) &= 1[(3)(-2) - (1)(4)] - 0 + 2[(-1)(4) - (3)(2)]\\ &= 1[-6 - 4] + 2[-4 - 6]\\ &= -10 + 2(-10) = -10 - 20 \\ &= -30 \end{align*} \]

  4. Using the formula: \[ \begin{align*} \det(D) = &= 2[(4)(5) - (1)(0)] - 1[(0)(5) - (1)(0)] + 3[(0)(0) - (4)(0)] \\ &= 2(20) - 1(0) + 3(0) \\ &= 40 \\ \end{align*} \]

Exercise 6: Determinants and geometric interpretations

The absolute value of the determinant of a \(2 \times 2\) matrix gives the area of the parallelogram formed by its column vectors. Similarly, the absolute value of the determinant of a \(3 \times 3\) matrix gives the volume of the parallelepiped (a 3D generalization of a parallelogram) formed by its column vectors.

  1. Find the area of the parallelogram with vertices at \((0, 0)\), \((3, 1)\), and \((4, 5)\).

  2. Find the area of the parallelogram formed by the vectors \[ \mathbf{v}_1 = \begin{bmatrix} 2 \\ 3 \end{bmatrix} \quad \text{and} \quad \mathbf{v}_2 = \begin{bmatrix} 1 \\ 4 \end{bmatrix}. \]

  3. Find the volume of the parallelepiped with one vertex at the origin and vertices including \((2, 0, 0)\), \((1, 3, 0)\), and \((1, 1, 2)\).

  4. Find the volume of the parallelepiped formed by the vectors \[ \mathbf{u}_1 = \begin{bmatrix} 1 \\ 0 \\ 1 \end{bmatrix} \quad \text{and} \quad \mathbf{u}_2 = \begin{bmatrix} 0 \\ 2 \\ 1 \end{bmatrix} \quad \text{and} \quad \mathbf{u}_3 = \begin{bmatrix} 1 \\ 1 \\ 0 \end{bmatrix}. \]

  5. Determine whether the vectors \[ \mathbf{a} = \begin{bmatrix} 1 \\ 2 \\ 3 \end{bmatrix} \quad \text{and} \quad \mathbf{b} = \begin{bmatrix} 2 \\ 4 \\ 6 \end{bmatrix}\quad \text{and} \quad \mathbf{c} = \begin{bmatrix} 1 \\ 0 \\ 1 \end{bmatrix} \] lie in the same plane.

  1. The parallelogram has sides from \((0,0)\) to \((3,1)\) and from \((0,0)\) to \((4,5)\). The area is the absolute value of the determinant: \[ \left|\det\begin{bmatrix} 3 & 4 \\ 1 & 5 \end{bmatrix}\right| = |(3)(5) - (4)(1)| = |15 - 4| = 11 \]

  2. The area is: \[ \left|\det\begin{bmatrix} 2 & 1 \\ 3 & 4 \end{bmatrix}\right| = |(2)(4) - (1)(3)| = |8 - 3| = 5 \]

  3. The volume is the absolute value of the determinant of the matrix with these vectors as columns: \[ \left|\det\begin{bmatrix} 2 & 1 & 1 \\ 0 & 3 & 1 \\ 0 & 0 & 2 \end{bmatrix}\right| = 12. \]

  4. The volume is: \[ \left|\det\begin{bmatrix} 1 & 0 & 1 \\ 0 & 2 & 1 \\ 1 & 1 & 0 \end{bmatrix}\right| = 3 \]

  5. To check if the vectors are coplanar, we check if the determinant of the matrix with these vectors as columns is zero: \[ \det\begin{bmatrix} 1 & 2 & 1 \\ 2 & 4 & 0 \\ 3 & 6 & 1 \end{bmatrix} = 0 \] Since the determinant is zero, the vectors lie in the same plane.