If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

## Linear algebra

### Course: Linear algebra>Unit 2

Lesson 3: Transformations and matrix multiplication

# Matrix product examples

Example of taking the product of two matrices. Created by Sal Khan.

## Want to join the conversation?

• How would I describe the solution set of a matrix geometrically where the set is:

x_1 = 1 + 2x_3
x_2 = 1 + 3x_3
x_3 = free variable

Thank you! • So, when you see a 2x4 matrix, you can go, ha, that's a composite transformation from R4 to R2? And similarly, if you saw a 2x100 matirx, you could say, that's a transformation from R100 to R2? (Crossing dimensions :) ? • I heard about the idea that matrix multiplication can be visualized as applying one transformation on the entire coordinate plane after another, and I can visualize it quite well. I also understand that matrix product is non-commutative because when applying transformation on the entire coordinate, the order matters. However, I don't quite understand the "non-existent" case. Analytically, it looks obvious that matrix (m x n) x (l x m) is not possible. But when looking at it geometrically, I don't know how a transformation would not apply.

I am wondering if this is the case: the transformation does apply, but the combined transformation is no longer linear.

I hope this make sense... Thank you in advance! • I'm not sure what exactly a "geometric" meaning here would be; the fact of the matter is that it's just not defined. Let's say we have two matrices A & B with a being a m by n matrix and B being a p by q matrix. Now AB is only defined when n = p, it's outside the domain of the function otherwise. Realize that the geometric interpretation is exactly that - an interpretation. It is however, not the transformation itself. It describes the transformation. There are concepts in math that seem to intuitively make sense, but when you get your hands dirty they make less and less sense - that is there is no reasonable way for some properties, operations, or sets to exist. An example of this is the set of all possible sets. It's a fun exercise to think why this can't possibly exist, but on a base level seems like it should.
• If I have two transformations, T and S, and T goes from R4 to R3, S from R3 to R2 (as in the video at ), and T is represented by the matrix B, S by matrix A.

Sal multiplies AB(x). Why is it in that order? Considering it would - at least logically - make more sense to multiply BA(x).

I know we can't in this example, because BA is not defined. But I'm only interested in why we choose to use the matrix of the second transformation before the matrix in the first transformation. • Function composition is evaluated right-to-left because of how function notation is written. If I want to apply the function g, then the function f to the number x, I write f(g(x)).

Because matrices are (representations of) functions, the same applies here. Sal multiplied AB(x) because he wanted to apply the function T, then the function S. Multiplying BA doesn't make sense because outputs of A are 2-dimensional, and inputs of B are 4-dimensional.

Matrix multiplication is undefined precisely when the domains and ranges of the corresponding functions don't match up.
• (At the end, around ): It seems pretty clear that S(T(x)) = A*(Bx), because (e.g., if B is 3X4 and A is 2x3) Bx is an R3 vector and A*(Bx) transforms Bx; but have we proved this? • Hi there,
I just wana know if Sal talks about matrix sum notation in any of his videos. Like for example in my degree level physics we're doing a course on linear algebra, but the matrices in there are all about some weird indexes and sums...and proving stuff just by manipulating indices. I dont get it at all...is there any videos that I can watch? • Why is matrix multiplication not commutative? • First of all, if A and B are matrices such that the product AB is defined, the product BA need not be defined. In this case, matrix multiplication is not commutative. Secondly, if it is the case that both AB and BA are meaningful, they need not be the same matrix. For instance, let m and n be distinct, positive integers. Let A be an m by n matrix, and let B be an n by m matrix. Then the product AB is an m by m matrix, but the product BA is an n by n matrix. Since m and n are distinct, ABBA, and the operation is not commutative, etc. However, there are examples where this operation commutes, but this does not hold in general.
• What is the difference between sum of transformation of a particular vector and composition of transformation ?I know how each of them is computed but what is the real difference • Well, I'm not sure what effect on the transformations direct addition would have. I doubt the result of the sum of transformation would have a direct relation to the individual transformations.

Linear transformation composition (multiplication) on the other hand is a way to join together multiple transformations into a single unit. The result is equal to the sequential application of the individual transformations.  