Lecture 7: Linear Transformationa and their matrices Examples of linear transformations. (1) Rotation by π/2 in R2 followed by reflection about the x-axis. Remember that rotation by π/2 is given by x −y R = y x and reflection about the x-axis is accomplished by the linear transformation x x S = y −y One followed by the other is then the linear transformation x x x −y −y T = (S ◦ R) =S R =S = y y y x −x (2) Rotation in R2 by an angle α counterclockwise x x cos α − y sin α T = y y cos α + x sin α (3) Integration. V = Pn , W = Pn+1 . Define T : V −→ W Z T (p) = p(x) dx.
This is a linear transformation because of Z Z Z (p(x) + q(x))dx = p(x) dx + q(x) dx Z Z αp(x) dx = α p(x) dx if α ∈ R. (4) Shifting the graph of a function to the right. Let V = W = Pn and define T : V −→ W by (T p)(x) = p(x − 1) 2
For example if p(x) = x +3 then T p is the polynomial (T p)(x) = (x−1)2 +3. This is a linear transformation: (T (p + q))(x)
= =
(p + q)(x − 1) p(x − 1) + q(x − 1)
=
(T p)(x) + (T q)(x)
and (T (αp))(x) = (αp)(x − 1) = αp(x − 1) = α(T p)(x). Convince yourself that moving a graph up or down (T p)(x) = p(x) + 1 is not a linear transformation. 1
2
(5) Taking the transpose of a matrix. Let V = W = M2×2 and define a transformation T : M2×2 −→ M2×2 by T (A) = AT , i.e. a b a c T = c d b d This is a linear transformation because of ′ a b a b′ a + a′ b + b ′ T + = T c d c′ d′ c + c′ d + d′ a + a′ c + c′ = b + b′ d + d′ ′ a c a c′ = + b d b′ d′ ′ a b a b′ = T +T c d c′ d′ and a T α c
b d
= = = =
αb T αd αa αc αb αd a c α b d a b αT c d αa αc
Finding the matrix of a Linear Transformation between vector spaces. We begin the discussion by considering a linear transformation T : Rn → Rm , x1 where Rn consists as usual of all column vectors x = ... with real entries. In
xn the textbook they sometimes write (x1 , . . . , xn )T (to save space). We assume that ej are the standard basis vectors (the only nonzero entry being ’1’ in row #j) so that x = x1 e1 + · · · xn en . We write
T (e1 ) = a1 =
a11 a21 .. . am1
, T (e2 ) = a2 =
and we organize all the numbers aij a11 a12 a21 a22 A= . .. .. . am1
am2
a12 a22 .. . am2
, . . . , T (en ) = an =
into a matrix · · · a1n · · · a2n .. = [a1 , . . . , an ]. ··· . · · · amn
a1n a2n .. . amn
,
3
Then, since T is linear, we calculate T (x) = T (x1 e1 + · · · xn en ) = x1 T (e1 ) + · · · xn T (en ) = x1 a1 + · · · xn an = A·x recalling the definition of matrix-vector multiplication. Summarizing, In order to find the matrix A of a linear transformation T : Rn → Rm with respect to the standard bases on Rn and Rm we compute the vectors a11 a12 a1n a21 a22 a2n T (e1 ) = . , T (e2 ) = . , . . . , T (en ) = . , .. .. .. am1
am2
and collect them together in a matrix a11 a21 A= . .. am1
a12 a22 .. . am2
amn
··· ··· ··· ···
a1n a2n .. . amn
.
We will illustrate this on some of the previous examples.
Example (1): Rotation by π/2 in R2 followed by reflection about the x-axis. We get 1 0 0 −1 T = ,T = 0 −1 1 0 and the matrix of the transformation is given by 0 −1 −1 0 Example (2): Rotation in R2 by an angle α counterclockwise. We get 1 cos α 0 − sin α T = ,T = 0 sin α 1 cos α and the matrix of the transformation is given by cos α − sin α sin α cos α For further examples we need to discuss how to find the matrix of a linear transformation between general vector spaces. Assume that V, W are vector spaces with bases e1 , . . . , en and f1 , . . . , fm respectively. Moreover, let T : V −→ W be a linear transformation. The bottomline is that after choosing these bases, the linear transformation T can be described by an (m × n)-matrix.
4
Each vector T (ek ), 1 ≤ k ≤ n, can be written as a linear combination of the basis vectors f1 , . . . , fm , i.e. there are scalars ajk with 1 ≤ j ≤ m, 1 ≤ k ≤ n such that m X ajk fj (1) T (ek ) = j=1
(the double indices ajk are just a convenient way to keep track of the coefficients). Let now v ∈ V be a vector in V . We can represent it in terms of the basis vectors as follows: v = v1 e1 + · · · + vn en . We then compute ! n X T (v) = T vk ek k=1
= = = =
n X
T (vk ek )
k=1 n X
vk T (ek )
k=1 n X m X
ajk vk fj
k=1 j=1 m X
(aj1 v1 + · · · + ajn vn )fj
j=1
Using the bases of V and W we will write vectors in V and W as column vectors as follows: We will associate a column vector v1 .. n . ∈R vn
with a vector v = v1 e1 + · · · + vn en in V and similarly we will associate a column vector w1 .. m . ∈R wm
with a vector w = w1 f1 + · · · + wm fm ∈ W . We can then write v1 a11 v1 + · · · + a1n vn v1 a11 · · · a1n .. .. .. .. T ... = = . . . . vn am1 v1 + · · · + amn vn vn am1 · · · amn
Summarizing, we need to compute T (ek ), relate them to the basis vectors fk , and formula (1) yields the matrix of T .
5
Here are some examples: Reflection about the x-axis in R2 We choose V = W = R2 but we choose the following basis instead of the standard basis 1 1 h1 = , h2 = 0 1 In the previous notation we have n = m = 2 and ej = fj = hj . Let T : R2 → R2 be the linear transformation which is reflection about the x-axis, i.e. 1 0 x1 x1 x1 = = T x2 0 −1 −x2 x2
The above matrix is the matrix of T with respect to the standard basis. We want to compute the matrix of T with respect to the basis h1 , h2 . We calculate 1 1 T (h1 ) = T = = h1 0 0 and
1 1 −1 2 = = + = −h2 + 2h1 1 −1 −1 0 Comparing with formula (1) the matrix of T with respect to the basis h1 , h2 is given by 1 2 . 0 −1 Integration of polynomials Let V = P2 , W = P3 . Define T : V Z−→ W T (h2 ) = T
T (p) =
p(x) dx.
We pick the following bases for P2 and P3 :
{e1 , e2 , e3 } = {1, x, x2 } ⊂ P2 and {f1 , f2 , f3 , f4 } = {1, x, x2 , x3 } ⊂ P3 . We get by integrating 1 1 1 1 2 x = f3 , T (e3 ) = x3 = f4 2 2 3 3 Identifying all vectors with column vectors this amounts to 0 0 0 1 0 0 1 0 0 1 = 0 = T 0 = 0 ,T 1/2 , T 0 0 0 1 0 0 1/3 T (e1 ) = x = f2 , T (e2 ) =
and the matrix of T with respect to the bases {e1 , e2 , e3 } and {f1 , f2 , f3 , f4 } is given by 0 0 0 1 0 0 0 1/2 0 . 0 0 1/3 Note that different choices of bases lead to a different matrix.