Linear Algebra and Its Applications, Exercise 2.6.16

Exercise 2.6.16. Consider the space of 2 by 2 matrices. Any such matrix can be represented as the linear combination of the matrices

\begin{bmatrix} 1&0 \\ 0&0 \end{bmatrix} \qquad \begin{bmatrix} 0&1 \\ 0&0 \end{bmatrix} \qquad \begin{bmatrix} 0&0 \\ 1&0 \end{bmatrix} \qquad \begin{bmatrix} 0&0 \\ 0&1 \end{bmatrix}

that serve as a basis for the space. Find a matrix A corresponding to the linear transformation of transposing 2 by 2 matrices, and explain why A^2 = I.

Answer: Each of the elementary 2 by 2 matrices can be considered as equivalent to one of the elementary vectors in \mathbb{R}^4

e_1 = \begin{bmatrix} 1 \\ 0 \\ 0 \\ 0 \end{bmatrix} \qquad e_2 = \begin{bmatrix} 0 \\ 1 \\ 0 \\ 0 \end{bmatrix} \qquad e_3 = \begin{bmatrix} 0 \\ 0 \\ 1 \\ 0 \end{bmatrix} \qquad e_4 = \begin{bmatrix} 0 \\ 0 \\ 0 \\ 1 \end{bmatrix}

(Simply read off the entries in the 2 by 2 matrices starting with the first row left to right and then the second row left to right.)

We want A to transpose each of the elementary 2 by 2 matrices into the following matrices:

\begin{bmatrix} 1&0 \\ 0&0 \end{bmatrix} \qquad \begin{bmatrix} 0&0 \\ 1&0 \end{bmatrix} \qquad \begin{bmatrix} 0&1 \\ 0&0 \end{bmatrix} \qquad \begin{bmatrix} 0&0 \\ 0&1 \end{bmatrix}

corresponding to the following vectors in \mathbb{R}^4

\begin{bmatrix} 1 \\ 0 \\ 0 \\ 0 \end{bmatrix} \qquad \begin{bmatrix} 0 \\ 0 \\ 1 \\ 0 \end{bmatrix} \qquad \begin{bmatrix} 0 \\ 1 \\ 0 \\ 0 \end{bmatrix} \qquad \begin{bmatrix} 0 \\ 0 \\ 0 \\ 1 \end{bmatrix}

In other words we must have Ae_1 = e_1, Ae_2 = e_3, Ae_3 = e_2, and Ae_4 = e_4.

Since Ae_1 = e_1 when multiplying the first row of A by the entries of e_1 (which produces the first entry in the resulting vector) we must produce 1, and when multiplying the second through fourth row of A by the entries of e_1 we must produce 0. This means A must look as follows:

A = \begin{bmatrix} 1&?&?&? \\ 0&?&?&? \\ 0&?&?&? \\ 0&?&?&? \end{bmatrix}

Note that we don’t care what the other entries in A are, since when multiplying e_1 those entries will end up multiplying zeroes:

Ae_1 = \begin{bmatrix} 1&?&?&? \\ 0&?&?&? \\ 0&?&?&? \\ 0&?&?&? \end{bmatrix} \begin{bmatrix} 1 \\ 0 \\ 0 \\ 0 \end{bmatrix} = \begin{bmatrix} 1 \\ 0 \\ 0 \\ 0 \end{bmatrix} = e_1

Since Ae_2 = e_3 when multiplying the first row of A by the entries of e_2 we must produce 0,  and similarly when multiplying the second and fourth rows of A by the entries of e_2. However when multiplying the third row of A by the entries of e_2 (which produces the third entry in the resulting vector) we must produce 1. This means A must look as follows:

A = \begin{bmatrix} ?&0&?&? \\ ?&0&?&? \\ ?&1&?&? \\ ?&0&?&? \end{bmatrix}

Note again that we don’t care what the other entries in A are, since when multiplying e_2 those entries will end up multiplying zeroes:

Ae_2 = \begin{bmatrix} ?&0&?&? \\ ?&0&?&? \\ ?&1&?&? \\ ?&0&?&? \end{bmatrix} \begin{bmatrix} 0 \\ 1 \\ 0 \\ 0 \end{bmatrix} = \begin{bmatrix} 0 \\ 0 \\ 1 \\ 0 \end{bmatrix} = e_3

We next have Ae_3 = e_2 so when multiplying the second row of A by the entries of e_3 we must produce 1,  and when multiplying the other rows of A by the entries of e_3 must produce 0. This means A must look as follows:

A = \begin{bmatrix} ?&?&0&? \\ ?&?&1&? \\ ?&?&0&? \\ ?&?&0&? \end{bmatrix}

so that

Ae_3 = \begin{bmatrix} ?&?&0&? \\ ?&?&1&? \\ ?&?&0&? \\ ?&?&0&? \end{bmatrix} \begin{bmatrix} 0 \\ 0 \\ 1 \\ 0 \end{bmatrix} = \begin{bmatrix} 0 \\ 1 \\ 0 \\ 0 \end{bmatrix} = e_2

Finally since Ae_4 = e_4 when multiplying the first, second, and third rows of A by the entries of e_4 we must produce 0, and when multiplying the fourth row of A by the entries of e_4 we must produce 1. This means A must look as follows:

A = \begin{bmatrix} ?&?&?&0 \\ ?&?&?&0 \\ ?&?&?&0 \\ ?&?&?&1 \end{bmatrix}

with

Ae_4 = \begin{bmatrix} ?&?&?&0 \\ ?&?&?&0 \\ ?&?&?&0 \\ ?&?&?&1 \end{bmatrix}\begin{bmatrix} 0 \\ 0 \\ 0 \\ 1 \end{bmatrix} = \begin{bmatrix} 0 \\ 0 \\ 0 \\ 1 \end{bmatrix} = e_4

Combining the above results we see that

A = \begin{bmatrix} 1&0&0&0 \\ 0&0&1&0 \\ 0&1&0&0 \\ 0&0&0&1 \end{bmatrix}

Note that we could have achieved the same result by having each column of A be the vector into which the corresponding elementary vector should be transformed. In other words, the first column of A should be e_1 (since A transforms e_1 into e_1), the second column should be e_3 (since A transforms e_2 into e_3), and similarly the third and fourth columns should be e_2 and e_4 respectively.

When multiplying A by itself we see that

A^2 = \begin{bmatrix} 1&0&0&0 \\ 0&0&1&0 \\ 0&1&0&0 \\ 0&0&0&1 \end{bmatrix} \begin{bmatrix} 1&0&0&0 \\ 0&0&1&0 \\ 0&1&0&0 \\ 0&0&0&1 \end{bmatrix} = \begin{bmatrix} 1&0&0&0 \\ 0&1&0&0 \\ 0&0&1&0 \\ 0&0&0&1 \end{bmatrix} = I

In other words, applying A twice to a given vector leaves that vector unchanged. This effect can be explained in multiple ways.

First, when applied to vectors in \mathbb{R}^4 the matrix A permutes the second and third entries of the vectors but leaves the first and fourth entries unchanged:

A = \begin{bmatrix} 1&0&0&0 \\ 0&0&1&0 \\ 0&1&0&0 \\ 0&0&0&1 \end{bmatrix} \begin{bmatrix} v_1 \\ v_2 \\ v_3 \\ v_4 \end{bmatrix} = \begin{bmatrix} v_1 \\ v_3 \\ v_2 \\ v_4 \end{bmatrix}

Applying A again reverses the effect of the permutation of the second and third entries, again leaving the first and fourth entries unchanged, and thus restores the original vector.

Second, when applied to our original space of 2 by 2 matrices A has the effect of transposing a matrix, transforming

\begin{bmatrix} v_1&v_2 \\ v_3&v_4 \end{bmatrix}

into

\begin{bmatrix} v_1&v_3 \\ v_2&v_4 \end{bmatrix}

Applying A twice has the effect of taking the transpose of the transpose. Since (B^T)^T = B for any matrix B this has the effect of restoring the original 2 by 2 matrix.

NOTE: This continues a series of posts containing worked out exercises from the (out of print) book Linear Algebra and Its Applications, Third Edition by Gilbert Strang.

If you find these posts useful I encourage you to also check out the more current Linear Algebra and Its Applications, Fourth Edition, Dr Strang’s introductory textbook Introduction to Linear Algebra, Fourth Edition and the accompanying free online course, and Dr Strang’s other books.

 Buy me a snack to sponsor more posts like this!

Posted in linear algebra | Leave a comment

The composition of linear transformations is a linear transformation

In doing the answers to exercise 2.6.14 in Gilbert Strang’s Linear Algebra and Its Applications, Third Edition I noticed one of the downsides of the book: While Strang’s focus on practical applications is usually welcome, sometimes in his desire to avoid abstract concepts and arguments he hand waves his way through important points and leaves the reader somewhat confused. At least, I was confused in his discussion of rule 2V on page 123, in which he doesn’t really provide a lot of background (let alone a real proof) for why the composition of two linear transformations should itself be a linear transformation.

As I’ve done before in a couple of cases, I thought it was worth stopping and reviewing the basic definition and consequent properties of linear transformations, ignoring the connection with matrices and focusing just on the abstract concept.

1) Definition of a linear transformation. First, a linear transformation is a function from one vector space to another vector space (which may be itself). So if we have two vector spaces V and W, a linear transformation A takes a vector v in V and produces a vector w in W. In other words w = A(v) using function notation. (For clarity I’ll continue to use function notation for the rest of this post.)

What makes a linear transformation linear is that it has the property that

A(ax+by) = aA(x) + bA(y)

for any x and y in V and any scalars a and b that could be used to multiply vectors in V and W.

2) Alternate definition of a linear transformation. Note that the property above is often expressed instead in the form of two simpler properties:

A(ax) = aA(x)

A(x+y) = A(x) + A(y)

for any x and y in V and any scalars a and b that could be used to multiply vectors in V and W.

This alternate definition is equivalent to the definition in (1) above, as shown by the following argument:

Suppose we have A(ax+by). Since x and y are vectors in V and a and b are scalars, by the definition of a vector space we know that ax and by are also vectors in V. (Vector spaces are closed under scalar multiplication.) By the alternate definition we thus have A(ax+by) = A(ax) + A(by). By the same definition we also have A(ax) = aA(x) and A(by) = bA(y) so that A(ax) + A(by) = aA(x) + bA(y). Combining the equations we see that A(ax+by) = aA(x) + bA(y).

Note also that the original property A(ax+by) = aA(x) + bA(y) reduces to A(ax) = aA(x) if b = 0 and reduces to A(x+y) = A(x)+A(y) if a = b= 1.

3) Applying a linear transformation to an arbitrary linear combination of vectors. Suppose we have a linear transformation A from V to W, an arbitrary set of vectors v_1, v_2, through v_m in V and an arbitrary set of scalars c_1, c_2, through c_m. Then we have

A(\sum_{i=1}^{m} c_iv_i) = \sum_{i=1}^{m} c_iA(v_i)

This is easily proved using induction: First, for m = 2 from the definition in (1) above we have

A(\sum_{i=1}^{2} c_iv_i) = A(c_1v_1 + c_2v_2)

= c_1A(v_1) + c_2A(v_2) = \sum_{i=1}^{2} c_iA(v_i)

Now suppose for some k \ge 2 we have

A(\sum_{i=1}^{k} c_iv_i) = \sum_{i=1}^{k} c_iA(v_i)

Then for k+1 we have

A(\sum_{i=1}^{k+1} c_iv_i) = A(\sum_{i=1}^{k} c_iv_i + c_{k+1}v_{k+1})

= A(\sum_{i=1}^{k} c_iv_i) + c_{k+1}A(v_{k+1})

= \sum_{i=1}^{k} c_iA(v_i) + c_{k+1}A(v_{k+1})

= \sum_{i=1}^{k+1} c_iA(v_i)

Since the proposition is true for m=2 and is also true for k+1 for any k \ge 2, it is true for all m \ge 2.

4) The composition of two linear transformations. Suppose A is a linear transformation from a vector space V to a vector space W and B is a linear transformation from a vector space U to V. We define their composition AB to be A(B(u)) for all u in U; the result w = A(B(u)) is a vector in W.

We can show that AB is a linear transformation as follows: Given x and y in U we have

A(B(ax)) = A(aB(x))

A(B(x+y)) = A(B(x)+B(y))

since B is a linear transformation and

A(aB(x)) = aA(B(x))

A(B(x)+B(y)) = A(B(x)) + A(B(y))

since A is a linear transformation.

Since

A(B(ax)) = aA(B(x))

A(B(x+y)) = A(B(x)) + A(B(y))

we see that AB is a linear transformation as well.

Finally, if we have a third linear transformation C from a vector space X to U then the result of applying C and then AB to form the composition (AB)C is the same as applying BC then A to form the composition A(BC). (In other words, composition of linear transformations is associative.) For the proof of this see the answers to exercise 2.6.14.

NOTE: This continues a series of posts containing worked out exercises from the (out of print) book Linear Algebra and Its Applications, Third Edition by Gilbert Strang.

If you find these posts useful I encourage you to also check out the more current Linear Algebra and Its Applications, Fourth Edition, Dr Strang’s introductory textbook Introduction to Linear Algebra, Fourth Edition and the accompanying free online course, and Dr Strang’s other books.

 Buy me a snack to sponsor more posts like this!

Posted in linear algebra | Leave a comment

Linear Algebra and Its Applications, Exercise 2.6.15

Exercise 2.6.15. Suppose that T is a linear transformation from \mathbb{R}^3 to itself, or more generally from any vector space V to itself. Show that T^2 is also a linear transformation.

Answer: If T is a linear transformation from some vector space V to itself then by rule 2V on page 123 the composition TT of two linear transformations is also a linear transformation, again from V to itself. So T^2 = TT is a linear transformation if T is.

Note that the assumption that T maps from V to itself is critical. If T were a linear transformation from V to a different vector space W then it would not make sense to apply T again to the result w = Tv since w is in W not V.

Another slightly longer proof that does not rely on rule 2V:

For clarity we use function notation, so that T(v) is the result of applying T to a vector v in V. We also take T^2(x) to mean T(T(x)). In other words, T^2 is a composition of T with itself. Since T maps from V to itself T^2 does also.

Since T is a linear transformation we have T(ax+by) = aT(x)+ bT(y) for any x and y in V and any two scalars a and b. Combining this with the definition of T^2 we have

T^2(ax+by) = T(T(ax+by)) = T(aT(x)+bT(y))

= aT(T(x))+bT(T(y)) = aT^2(x) + bT^2(y)

Since T^2(ax+by) = aT^2(x) + bT^2(y) we see that T^2 is also a linear transformation.

NOTE: This continues a series of posts containing worked out exercises from the (out of print) book Linear Algebra and Its Applications, Third Edition by Gilbert Strang.

If you find these posts useful I encourage you to also check out the more current Linear Algebra and Its Applications, Fourth Edition, Dr Strang’s introductory textbook Introduction to Linear Algebra, Fourth Edition and the accompanying free online course, and Dr Strang’s other books.

 Buy me a snack to sponsor more posts like this!

Posted in linear algebra | Leave a comment

Linear Algebra and Its Applications, Exercise 2.6.14

Exercise 2.6.14. Suppose that A, B, and C are linear transformations, with A taking vectors from V to W, B taking vectors from U to V, and C taking vectors from X to U. Consider the product (AB)C of these transformations. It starts with a vector x in X and produces a new vector u = Cx in U. It then follows 2V on page 123 to apply the product linear transformation AB to u producing a final vector w in W representing the result (AB)Cx.

i) Is the result of this process the same as separately applying C followed by B followed by A?

ii) Is the final result of this process the same as applying BC followed by A? In other words, does the associative law apply to linear transformations, so that (AB)C = A(BC)?

Answer: i) In computing (AB)Cx we start with a vector x in X and apply the linear transformation C to produce a new vector u = Cx in U. We then apply the product transformation AB to the vector u to produce a vector w = (AB)u in W.

But by rule 2V the linear transformation AB is simply the composition of the two linear transformations A and B. So applying the product transformation AB to the vector u to produce a vector w = (AB)u in W is equivalent to first applying the transformation B to the vector u to produce a vector v = Bu in V and then applying the transformation A to the vector v to produce a vector w = Av in W. In other words, (AB)u = A(Bu).

So the final result w is the same whether we apply AB to u or apply B to u and then apply A to Bu. Since the first step, namely applying C to x to produce u, is the same in both cases, the result of (AB)Cx (applying C and then AB) is the same as applying first C, then B, and then A. In other words, (AB)Cx = A(B(Cx)).

ii) Just as A and B can be composed together to form a linear transformation AB from V into W, so can B and C can be composed together to create a linear transformation BC from X into V. By rule 2V we know that this is the same as applying C to a vector x in X to produce a vector u in U and then applying B to u to produce a vector v in V. In other words, (BC)x = B(Cx).

In either case we can then take the resulting vector v and transform it using A to produce a vector w in W. In other words, w = A(BC)x = A(B(Cx)). But from the previous answer we also know that (AB)Cx = A(B(Cx)). From the two equations together we see that (AB)Cx = A(BC)x and thus that the linear transformations A, B and C obey the law of associativity.

BONUS: As noted in the text, associativity of linear transformations implies associativity of matrix multiplication.

Suppose that we choose sets of basis vectors in the vector spaces X, U, V, and W. (Our choice is arbitrary; any basis sets will do.) We can then represent the transformation C by a matrix [C] constructed using the chosen basis vectors in X and U. We can represent the transformation B by a matrix [B] constructed using the chosen basis vectors in U and V. Finally, we can represent the transformation A by a matrix [A] constructed using the chosen basis vectors in V and W.

By rule 2V composition of two linear transformations creates a new linear transformation that can be represented by a matrix that is the product of the matrices representing the original linear transformations. Since we have (AB)Cx = A(BC)x we then also have ([A][B])[C]x = [A]([B][C])x. Any matrix can represent a linear transformation, so we then have ([A][B])[C] = [A]([B][C]) for any three matrices [A], [B], and [C] that can be multiplied together.

NOTE: This continues a series of posts containing worked out exercises from the (out of print) book Linear Algebra and Its Applications, Third Edition by Gilbert Strang.

If you find these posts useful I encourage you to also check out the more current Linear Algebra and Its Applications, Fourth Edition, Dr Strang’s introductory textbook Introduction to Linear Algebra, Fourth Edition and the accompanying free online course, and Dr Strang’s other books.

 Buy me a snack to sponsor more posts like this!

Posted in linear algebra | Leave a comment

Linear Algebra and Its Applications, Exercise 2.6.13

Exercise 2.6.13. Suppose that A is a linear transformation from the xy plane to itself. If a transformation A^{-1} exists such that A^{-1}(Ax) = A(A^{-1}x) = x show that A^{-1} is also linear. Also show that if M is the matrix representing A then the matrix representing A^{-1} must be M^{-1}.

Answer: Consider the expression cA^{-1}x + dA^{-1}y for any x and y. We know from the definition of A^{-1} that

cA^{-1}x + dA^{-1}y = A^{-1}[A(cA^{-1}x + dA^{-1}y)]

Since A is a linear transformation we then have

A^{-1}[A(cA^{-1}x + dA^{-1}y)] = A^{-1}[cA(A^{-1}x) + dA(A^{-1}y)]

and using the definition of A^{-1} we have A(A^{-1}x) = x and A(A^{-1}y) = y so that

A^{-1}[cA(A^{-1}x) + dA(A^{-1}y)] = A^{-1}(cx + dy)

From our final result and initial expression we have

A^{-1}(cx + dy) = cA^{-1}x + dA^{-1}y

for all x and y. So if A is a linear transformation and A^{-1} exists then A^{-1} is a linear transformation also.

Now suppose that M is the matrix representing A and N is the matrix representing A^{-1}. By 2V on page 123 the composition of A and A^{-1} is itself a linear transformation, with AA^{-1} represented by the product matrix MN and A^{-1}A represented by the product matrix NM.

But since  A^{-1}(Ax) = A(A^{-1}x) = x for all x we know that the compositions of A and A^{-1} are equivalent to the identity transformation represented by the identity matrix I. We therefore have MN = I and NM = I which implies that N = M^{-1}.

So if M is the matrix representing A then M^{-1} is the matrix representing A^{-1}.

NOTE: This continues a series of posts containing worked out exercises from the (out of print) book Linear Algebra and Its Applications, Third Edition by Gilbert Strang.

If you find these posts useful I encourage you to also check out the more current Linear Algebra and Its Applications, Fourth Edition, Dr Strang’s introductory textbook Introduction to Linear Algebra, Fourth Edition and the accompanying free online course, and Dr Strang’s other books.

 Buy me a snack to sponsor more posts like this!

Posted in linear algebra | 2 Comments

Linear Algebra and Its Applications, Exercise 2.6.12

Exercise 2.6.12. If H is the reflection matrix in the xy plane, show that H^2 = I using the trigonometric identity \cos^2 \theta + \sin^2\theta = 1 (c^2+s^2=1 for short).

Answer: We have

H = \begin{bmatrix} 2c^2 -1&2cs \\ 2cs&2s^2-1 \end{bmatrix}

so that

H^2 = \begin{bmatrix} 2c^2 -1&2cs \\ 2cs&2s^2-1 \end{bmatrix} \begin{bmatrix} 2c^2 -1&2cs \\ 2cs&2s^2-1 \end{bmatrix}

= \begin{bmatrix} (2c^2 -1)(2c^2 -1)+(2cs)(2cs)&2cs(2c^2-1)+2cs(2s^2-1) \\ 2cs(2c^2-1)+2cs(2s^2-1)&(2cs)(2cs)+(2s^2 -1)(2s^2 -1) \end{bmatrix}

= \begin{bmatrix} 4c^4-4c^2+1+4c^2s^2&2cs(2c^2+2s^2-2) \\ 2cs(2c^2+2s^2-2)&4c^2s^2+4s^4-4s^2+1 \end{bmatrix}

= \begin{bmatrix} 4c^2(c^2+s^2-1)+1&4cs(c^2+s^2-1) \\ 4cs(c^2+s^2-1)&4s^2(c^2+s^2-1)+1 \end{bmatrix}

Since c^2+s^2 =1 this can be simplified to

H^2 = \begin{bmatrix} 4c^2(1-1)+1&4cs(1-1) \\ 4cs(1-1)&4s^2(1-1)+1 \end{bmatrix}

= \begin{bmatrix} 4c^2 \cdot 0+1&4cs \cdot 0 \\ 4cs \cdot 0&4s^2 \cdot 0+1 \end{bmatrix} = \begin{bmatrix} 1&0 \\ 0&1 \end{bmatrix} = I

NOTE: This continues a series of posts containing worked out exercises from the (out of print) book Linear Algebra and Its Applications, Third Edition by Gilbert Strang.

If you find these posts useful I encourage you to also check out the more current Linear Algebra and Its Applications, Fourth Edition, Dr Strang’s introductory textbook Introduction to Linear Algebra, Fourth Edition and the accompanying free online course, and Dr Strang’s other books.

 Buy me a snack to sponsor more posts like this!

Posted in linear algebra | Leave a comment

Linear Algebra and Its Applications, Exercise 2.6.11

Exercise 2.6.11. Consider the vector space W of functions u in t for which d^2u/dt^2 = u. From the previous exercise we can express any such function as u = c_1u_1 + c_2u_2 where u_1 = e^t and u_2(t) = e^{-t} are basis vectors for W.

Suppose at t = 0 we have u = x and du/dt = y. Find c_1 and c_2 such that u = c_1u_1 + c_2u_2 fulfills these initial conditions. This can be considered a linear transformation from the vector space V of vectors \begin{bmatrix} x&y \end{bmatrix}^T into the vector space W. Find the matrix corresponding to this transformation assuming the basic vectors \begin{bmatrix} 1&0 \end{bmatrix}^T and \begin{bmatrix} 0&1 \end{bmatrix}^T for V and u_1 and u_2 for W.

Answer: At t = 0 we have

u(0) = c_1u_1(0) + c_2u_2(0)

= c_1 e^0 + c_2 e^{-0} = c_1 + c_2

We also have

du/dt = (d/dt) (c_1u_1 + c_2u_2)

= (d/dt) (c_1u_1) + (d/dt) (c_2u_2)

= c_1 \cdot du_1/dt + c_2 \cdot du_2/dt

= c_1 \cdot (d/dt) e^t + c_2 \cdot (d/dt) e^{-t}

= c_1 e^t + c_2(-e^{-t}) = c_1e^t - c_2e^{-t}

so that at t = 0 we have

du/dt = c_1e^0 - c_2e^{-0} = c_1 - c_2

From our initial conditions u = x and du/dt = y at t = 0 we then have

c_1+c_2 = x

c_1-c_2 = y

Adding the two equations we have 2c_1 = x+y  or

c_1 = (x+y)/2 = \frac{1}{2}x + \frac{1}{2}y

Subtracting the second equation from the first we have 2c_2 = x-y  or

c_2 = (x-y)/2 = \frac{1}{2}x - \frac{1}{2}y

The linear transformation from V into W can be represented by the following matrix:

A = \begin{bmatrix} \frac{1}{2}&\frac{1}{2} \\ \frac{1}{2}&-\frac{1}{2} \end{bmatrix}

so that if v = \begin{bmatrix} x&y \end{bmatrix}^T is in V we have

Av = \begin{bmatrix} \frac{1}{2}&\frac{1}{2} \\ \frac{1}{2}&-\frac{1}{2} \end{bmatrix} \begin{bmatrix} x \\ y \end{bmatrix} = \begin{bmatrix} \frac{1}{2}x+\frac{1}{2}y \\ \frac{1}{2}x-\frac{1}{2}y \end{bmatrix}

= (\frac{1}{2}x+\frac{1}{2}y) \begin{bmatrix} 1 \\ 0 \end{bmatrix} + (\frac{1}{2}x-\frac{1}{2}y) \begin{bmatrix} 0 \\ 1 \end{bmatrix}

= (\frac{1}{2}x+\frac{1}{2}y) u_1 + (\frac{1}{2}x-\frac{1}{2}y) u_2 = u

where u is in W.

NOTE: This continues a series of posts containing worked out exercises from the (out of print) book Linear Algebra and Its Applications, Third Edition by Gilbert Strang.

If you find these posts useful I encourage you to also check out the more current Linear Algebra and Its Applications, Fourth Edition, Dr Strang’s introductory textbook Introduction to Linear Algebra, Fourth Edition and the accompanying free online course, and Dr Strang’s other books.

 Buy me a snack to sponsor more posts like this!

Posted in linear algebra | Leave a comment

Linear Algebra and Its Applications, Exercise 2.6.10

Exercise 2.6.10. Consider the vector space of functions u in t for which d^2u/dt^2 = u. Find two functions that can serve as basic vectors for the space.

Answer: For a function to be in the space its second derivative with respect to t must be the original function. We know that the functions in the space cannot be polynomial functions in t (e.g., u(t) = t^n for some n) because differentiating a polynomial of degree n produces a polynomial of degree n-1 ((d/dt) t^n = nt^{n-1}) and taking the second derivative produces a polynomial of degree n-2 ((d^2/dt^2) t^n = (d/dt) nt^{n-1} = n(n-1)t^{n-2}).

What about exponential functions in t? We know that (d/dt) e^t = e^t (see for example the Wikipedia article on the exponential function) so if we choose u_1(t) = e^t we then have

(d^2/dt^2) u_1(t) = (d/dt) (d/dt) u_1(t)

(d/dt) (d/dt) e^t = (d/dt) e^t

= e^t = u_1(t)

so that d^2u_1/dt^2 = u_1.

Can we find a second function in the space? In general we have (d/dt) e^{kt} = k e^{kt} (this follows from the chain rule) so that

(d^2/dt^2) e^{kt} = (d/dt) k e^{kt}

= k (d/dt) e^{kt} = k \cdot k e^{kt} = k^2 e^{kt}

The function being differentiated on the left hand side of this equation will equal the function on the right hand side if k^2 = 1 which is true if k = 1 or k = -1. The case k = 1 corresponds to the function u_1(t) = e^t we discussed above. The case k = -1 corresponds to the function u_2(t) = e^{-t} for which we have

(d^2/dt^2) u_2(t) = (d/dt) (d/dt) u_2(t)

= (d/dt) (d/dt) e^{-t} = (d/dt) (-1 \cdot e^{-t})

= -(d/dt) e^{-t} = -(-1 \cdot e^{-t})

= -(-e^{-t}) = e^{-t} = u_2(t)

so that d^2u_2/dt^2 = u_2.

The functions u_1 and u_2 are linearly dependent (since one is not a scalar multiple of the other) and form a basis for the space. The vectors in the space consist of all functions u of the form c_1u_1 + c_2u_2. For all such functions we have

d^2u/dt^2 = (d^2/dt^2) (c_1u_1 + c_2u_2)

= (d^2/dt^2) (c_1u_1) + (d^2/dt^2) (c_2u_2)

= c_1 \cdot d^2u_1/dt^2 + c_2 \cdot d^2u_2/dt^2

= c_1u_1 + c_2u_2 = u

NOTE: This continues a series of posts containing worked out exercises from the (out of print) book Linear Algebra and Its Applications, Third Edition by Gilbert Strang.

If you find these posts useful I encourage you to also check out the more current Linear Algebra and Its Applications, Fourth Edition, Dr Strang’s introductory textbook Introduction to Linear Algebra, Fourth Edition and the accompanying free online course, and Dr Strang’s other books.

 Buy me a snack to sponsor more posts like this!

Posted in linear algebra | Leave a comment

Linear Algebra and Its Applications, Exercise 2.6.9

Exercise 2.6.9. Considering taking a polynomial from P_3, the space of cubic polynomials in t, and multiplying it by the polynomial 2+3t to produce a polynomial in P_4, the space of polynomials in t of degree four. Describe a matrix representing this multiplication by considering its effect on the basis vectors x_1 = 1 (representing the constant term), x_2 = t, x_3 = t^2, and x_4 = t^3.

Answer: The matrix A representing multiplying a member of P_3 by (2+3t) will have 4 columns because there are 4 basis vectors of P_3 and will have 5 rows because it must produce a member of P_4.

Multiplying the basis vectors of P_3 by (2+3t) we have

x_1 (2+3t) = 1 \cdot (2+3t) = 2 + 3t

x_2 (2+3t) = t (2+3t) = 2t + 3t^2

x_3 (2+3t) = t^2 (2+3t) = 2t^2 + 3t^3

x_4 (2+3t) = t^3 (2+3t) = 2t^3 + 3t^4

The resulting matrix A representing the multiplication is

A = \begin{bmatrix} 2&0&0&0 \\ 3&2&0&0 \\ 0&3&2&0 \\ 0&0&3&2 \\ 0&0&0&3 \end{bmatrix}

Consider the polynomial p = 1+t+t^2+t^3. Using matrix multiplication we have

Ap = \begin{bmatrix} 2&0&0&0 \\ 3&2&0&0 \\ 0&3&2&0 \\ 0&0&3&2 \\ 0&0&0&3 \end{bmatrix} \begin{bmatrix} 1 \\ 1 \\ 1 \\ 1 \end{bmatrix} = \begin{bmatrix} 2 \\ 5 \\ 5 \\ 5 \\ 3 \end{bmatrix}

Using normal multiplication we have

(2+3t)(1+t+t^2+t^3)

= (2+3t) \cdot 1 + (2+3t)t + (2+3t)t^2 + (2+3t)t^3

= 2 + 3t + 2t + 3t^2 + 2t^2 + 3t^3 + 2t^3 + 3t^4

= 2 + 5t + 5t^2 + 5t^3 + 3t^4

NOTE: This continues a series of posts containing worked out exercises from the (out of print) book Linear Algebra and Its Applications, Third Edition by Gilbert Strang.

If you find these posts useful I encourage you to also check out the more current Linear Algebra and Its Applications, Fourth Edition, Dr Strang’s introductory textbook Introduction to Linear Algebra, Fourth Edition and the accompanying free online course, and Dr Strang’s other books.

 Buy me a snack to sponsor more posts like this!

Posted in linear algebra | Leave a comment

Linear Algebra and Its Applications, Exercise 2.6.8

Exercise 2.6.8. If P_3 is the space of cubic polynomials in t, what matrix would represent d^2/dt^2? What are the nullspace and column space of this matrix? What polynomials would they represent?

Answer: P_3 consists of all polynomials of the form a_3t^3 + a_2t^2 + a_1t + a_0. The first derivative d/dt of such a polynomial is 3a_3t^2 + 2a_2t + a_1 and the second derivative d^2/dt^2 is 6a_3t + 2a_2.

If we choose as our basis the vectors p_1 = 1 (representing the constant term), p_2 = t, p_3 = t^2, and p_4 = t^3 then the polynomial a_3t^3 + a_2t^2 + a_1t + a_0 can represented as the vector p = \begin{bmatrix} a_0&a_1&a_2&a_3 \end{bmatrix}^T.

For the matrix corresponding to the second derivative d^2/dt^2 we must have Ap_1 = 0, Ap_2= 0, Ap_3 = 2p_1, and Ap_4 = 6p_2. The resulting matrix is

A = \begin{bmatrix} 0&0&2&0 \\ 0&0&0&6 \\ 0&0&0&0 \\ 0&0&0&0\end{bmatrix}

so that

d^2p/dt^2 = Ap = \begin{bmatrix} 0&0&2&0 \\ 0&0&0&6 \\ 0&0&0&0 \\ 0&0&0&0 \end{bmatrix} \begin{bmatrix} a_0 \\ a_1 \\ a_2 \\ a_3 \end{bmatrix} = \begin{bmatrix} 2a_2 \\ 6a_3 \\ 0 \\ 0 \end{bmatrix}

with the vector on the right corresponding to the polynomial 2a_2 + 6a_3t.

The matrix A has two pivots (in the third and fourth columns) so its rank r = 2.

The nullspace \mathcal{N}(A) is the set of all vectors x for which Ax = 0 or

\begin{bmatrix} 0&0&2&0 \\ 0&0&0&6 \\ 0&0&0&0 \\ 0&0&0&0\end{bmatrix} \begin{bmatrix} x_1 \\ x_2 \\ x_3 \\ x_4 \end{bmatrix} = 0

From the first row we have 2x_3 = 0 and from the second row 6x_4 = 0 so that x_3 = x_4 = 0. In this case x_1 and x_2 are free variables that can take on any value.  The null space is therefore the set of all vectors of the form

a_0 \begin{bmatrix} 1 \\ 0 \\ 0 \\ 0 \end{bmatrix} + a_1 \begin{bmatrix} 0 \\ 1 \\ 0 \\ 0 \end{bmatrix}

which corresponds to polynomials of the form a_1t + a_0. The nullspace has rank n-r = 4-2 = 2.

The column space \mathcal{R}(A) is the set of all linear combinations of the last two columns of A:

c_1 \begin{bmatrix} 2 \\ 0 \\ 0 \\ 0 \end{bmatrix} + c_2 \begin{bmatrix} 0 \\ 6 \\ 0 \\ 0 \end{bmatrix}

= (c_{1}/2) \begin{bmatrix} 1 \\ 0 \\ 0 \\ 0 \end{bmatrix} + (c_{2}/6) \begin{bmatrix} 0 \\ 1 \\ 0 \\ 0 \end{bmatrix}

This set is the same as the nullspace \mathcal{N}(A), namely the set of all vectors of the form

a_0 \begin{bmatrix} 1 \\ 0 \\ 0 \\ 0 \end{bmatrix} + a_1 \begin{bmatrix} 0 \\ 1 \\ 0 \\ 0 \end{bmatrix}

corresponding to polynomials of the form a_1t + a_0.

UPDATE: Corrected the paragraph discussing the effects of A when applied to the basis vectors p_1 through p_4. Thanks go to Abdalsalam Fadeel for pointing out a mistake with this.

NOTE: This continues a series of posts containing worked out exercises from the (out of print) book Linear Algebra and Its Applications, Third Edition by Gilbert Strang.

If you find these posts useful I encourage you to also check out the more current Linear Algebra and Its Applications, Fourth Edition, Dr Strang’s introductory textbook Introduction to Linear Algebra, Fourth Edition and the accompanying free online course, and Dr Strang’s other books.

 Buy me a snack to sponsor more posts like this!

Posted in linear algebra | 2 Comments