{"id":1791,"date":"2015-11-12T18:30:45","date_gmt":"2015-11-12T18:30:45","guid":{"rendered":"https:\/\/courses.candelalearning.com\/collegealgebra1xmaster\/?post_type=chapter&#038;p=1791"},"modified":"2015-11-12T18:30:45","modified_gmt":"2015-11-12T18:30:45","slug":"finding-the-product-of-two-matrices","status":"publish","type":"chapter","link":"https:\/\/courses.lumenlearning.com\/ivytech-collegealgebra\/chapter\/finding-the-product-of-two-matrices\/","title":{"raw":"Finding the Product of Two Matrices","rendered":"Finding the Product of Two Matrices"},"content":{"raw":"<p>In addition to multiplying a matrix by a scalar, we can multiply two matrices. Finding the <strong>product of two matrices<\/strong> is only possible when the inner dimensions are the same, meaning that the number of columns of the first matrix is equal to the number of rows of the second matrix. If [latex]A[\/latex] is an [latex]\\text{ }m\\text{ }\\times \\text{ }r\\text{ }[\/latex] matrix and [latex]B[\/latex] is an [latex]\\text{ }r\\text{ }\\times \\text{ }n\\text{ }[\/latex] matrix, then the product matrix [latex]AB[\/latex] is an [latex]\\text{ }m\\text{ }\\times \\text{ }n\\text{ }[\/latex] matrix. For example, the product [latex]AB[\/latex] is possible because the number of columns in [latex]A[\/latex] is the same as the number of rows in [latex]B[\/latex]. If the inner dimensions do not match, the product is not defined.\n\n[caption id=\"\" align=\"aligncenter\" width=\"154\"]<img src=\"https:\/\/s3-us-west-2.amazonaws.com\/courses-images-archive-read-only\/wp-content\/uploads\/sites\/924\/2015\/11\/25202142\/12.jpg\" alt=\"A has two rows and three columns and B has three rows and three columns. Because the number of columns in A matches the number of rows in B, the product of A and B is defined.\" width=\"154\" height=\"93\" data-media-type=\"image\/jpg\"\/><b>Figure 1<\/b>[\/caption]\n\nWe multiply entries of [latex]A[\/latex] with entries of [latex]B[\/latex] according to a specific pattern as outlined below. The process of <strong>matrix multiplication<\/strong> becomes clearer when working a problem with real numbers.\n\nTo obtain the entries in row [latex]i[\/latex] of [latex]AB,\\text{}[\/latex] we multiply the entries in row [latex]i[\/latex] of [latex]A[\/latex] by column [latex]j[\/latex] in [latex]B[\/latex] and add. For example, given matrices [latex]A[\/latex] and [latex]B,\\text{}[\/latex] where the dimensions of [latex]A[\/latex] are [latex]2\\text{ }\\times \\text{ }3[\/latex] and the dimensions of [latex]B[\/latex] are [latex]3\\text{ }\\times \\text{ }3,\\text{}[\/latex] the product of [latex]AB[\/latex] will be a [latex]2\\text{ }\\times \\text{ }3[\/latex] matrix.\n<\/p><div style=\"text-align: center;\">[latex]A=\\left[\\begin{array}{rrr}\\hfill {a}_{11}&amp; \\hfill {a}_{12}&amp; \\hfill {a}_{13}\\\\ \\hfill {a}_{21}&amp; \\hfill {a}_{22}&amp; \\hfill {a}_{23}\\end{array}\\right]\\text{ and }B=\\left[\\begin{array}{rrr}\\hfill {b}_{11}&amp; \\hfill {b}_{12}&amp; \\hfill {b}_{13}\\\\ \\hfill {b}_{21}&amp; \\hfill {b}_{22}&amp; \\hfill {b}_{23}\\\\ \\hfill {b}_{31}&amp; \\hfill {b}_{32}&amp; \\hfill {b}_{33}\\end{array}\\right][\/latex]<\/div>\nMultiply and add as follows to obtain the first entry of the product matrix [latex]AB[\/latex].\n<ol><li>To obtain the entry in row 1, column 1 of [latex]AB,\\text{}[\/latex] multiply the first row in [latex]A[\/latex] by the first column in [latex]B[\/latex], and add.\n<div style=\"text-align: center;\">[latex]\\left[\\begin{array}{ccc}{a}_{11}&amp; {a}_{12}&amp; {a}_{13}\\end{array}\\right]\\cdot \\left[\\begin{array}{c}{b}_{11}\\\\ {b}_{21}\\\\ {b}_{31}\\end{array}\\right]={a}_{11}\\cdot {b}_{11}+{a}_{12}\\cdot {b}_{21}+{a}_{13}\\cdot {b}_{31}[\/latex]<\/div><\/li>\n\t<li>To obtain the entry in row 1, column 2 of [latex]AB,\\text{}[\/latex] multiply the first row of [latex]A[\/latex] by the second column in [latex]B[\/latex], and add.\n<div style=\"text-align: center;\">[latex]\\left[\\begin{array}{ccc}{a}_{11}&amp; {a}_{12}&amp; {a}_{13}\\end{array}\\right]\\cdot \\left[\\begin{array}{c}{b}_{12}\\\\ {b}_{22}\\\\ {b}_{32}\\end{array}\\right]={a}_{11}\\cdot {b}_{12}+{a}_{12}\\cdot {b}_{22}+{a}_{13}\\cdot {b}_{32}[\/latex]<\/div><\/li>\n\t<li>To obtain the entry in row 1, column 3 of [latex]AB,\\text{}[\/latex] multiply the first row of [latex]A[\/latex] by the third column in [latex]B[\/latex], and add.\n<div style=\"text-align: center;\">[latex]\\left[\\begin{array}{ccc}{a}_{11}&amp; {a}_{12}&amp; {a}_{13}\\end{array}\\right]\\cdot \\left[\\begin{array}{c}{b}_{13}\\\\ {b}_{23}\\\\ {b}_{33}\\end{array}\\right]={a}_{11}\\cdot {b}_{13}+{a}_{12}\\cdot {b}_{23}+{a}_{13}\\cdot {b}_{33}[\/latex]<\/div><\/li>\n<\/ol>\nWe proceed the same way to obtain the second row of [latex]AB[\/latex]. In other words, row 2 of [latex]A[\/latex] times column 1 of [latex]B[\/latex]; row 2 of [latex]A[\/latex] times column 2 of [latex]B[\/latex]; row 2 of [latex]A[\/latex] times column 3 of [latex]B[\/latex]. When complete, the product matrix will be\n<div style=\"text-align: center;\">[latex]AB=\\left[\\begin{array}{c}\\begin{array}{l}{a}_{11}\\cdot {b}_{11}+{a}_{12}\\cdot {b}_{21}+{a}_{13}\\cdot {b}_{31}\\\\ \\end{array}\\\\ {a}_{21}\\cdot {b}_{11}+{a}_{22}\\cdot {b}_{21}+{a}_{23}\\cdot {b}_{31}\\end{array}\\begin{array}{c}\\begin{array}{l}{a}_{11}\\cdot {b}_{12}+{a}_{12}\\cdot {b}_{22}+{a}_{13}\\cdot {b}_{32}\\\\ \\end{array}\\\\ {a}_{21}\\cdot {b}_{12}+{a}_{22}\\cdot {b}_{22}+{a}_{23}\\cdot {b}_{32}\\end{array}\\begin{array}{c}\\begin{array}{l}{a}_{11}\\cdot {b}_{13}+{a}_{12}\\cdot {b}_{23}+{a}_{13}\\cdot {b}_{33}\\\\ \\end{array}\\\\ {a}_{21}\\cdot {b}_{13}+{a}_{22}\\cdot {b}_{23}+{a}_{23}\\cdot {b}_{33}\\end{array}\\right][\/latex]<\/div>\n<div class=\"textbox\">\n<h3>A General Note: Properties of Matrix Multiplication<\/h3>\nFor the matrices [latex]A,B,\\text{}[\/latex] and [latex]C[\/latex] the following properties hold.\n<ul><li>Matrix multiplication is associative: [latex]\\left(AB\\right)C=A\\left(BC\\right)[\/latex].<\/li>\n\t<li>Matrix multiplication is distributive: [latex]\\begin{array}{l}\\begin{array}{l}\\\\ C\\left(A+B\\right)=CA+CB,\\end{array}\\hfill \\\\ \\left(A+B\\right)C=AC+BC.\\hfill \\end{array}[\/latex]<\/li>\n<\/ul>\nNote that matrix multiplication is not commutative.\n\n<\/div>\n<div class=\"textbox shaded\">\n<h3>Example 8: Multiplying Two Matrices<\/h3>\nMultiply matrix [latex]A[\/latex] and matrix [latex]B[\/latex].\n<div style=\"text-align: center;\">[latex]A=\\left[\\begin{array}{cc}1&amp; 2\\\\ 3&amp; 4\\end{array}\\right]\\text{ and }B=\\left[\\begin{array}{cc}5&amp; 6\\\\ 7&amp; 8\\end{array}\\right][\/latex]<\/div>\n<\/div>\n<div class=\"textbox shaded\">\n<h3>Solution<\/h3>\nFirst, we check the dimensions of the matrices. Matrix [latex]A[\/latex] has dimensions [latex]2\\times 2[\/latex] and matrix [latex]B[\/latex] has dimensions [latex]2\\times 2[\/latex]. The inner dimensions are the same so we can perform the multiplication. The product will have the dimensions [latex]2\\times 2[\/latex].\n\nWe perform the operations outlined previously.\n\n[caption id=\"\" align=\"aligncenter\" width=\"487\"]<img src=\"https:\/\/s3-us-west-2.amazonaws.com\/courses-images-archive-read-only\/wp-content\/uploads\/sites\/924\/2015\/11\/25202143\/CNX_Precalc_Figure_09_05_0032.jpg\" alt=\"The first column of the product of A and B is defined as the result of matrix -vector multiplication of A and the first column of B. Column two of the product of A and B is defined as the result of the matrix-vector multiplication of A and the second column of B.\" width=\"487\" height=\"211\" data-media-type=\"image\/jpg\"\/><b>Figure 2<\/b>[\/caption]\n\n<\/div>\n<div class=\"textbox shaded\">\n<h3>Example 9: Multiplying Two Matrices<\/h3>\nGiven [latex]A[\/latex] and [latex]B:[\/latex]\n<ol><li>Find [latex]AB[\/latex].<\/li>\n\t<li>Find [latex]BA[\/latex].<\/li>\n<\/ol><div style=\"text-align: center;\">[latex]A=\\left[\\begin{array}{l}\\begin{array}{ccc}-1&amp; 2&amp; 3\\end{array}\\hfill \\\\ \\begin{array}{ccc}4&amp; 0&amp; 5\\end{array}\\hfill \\end{array}\\right]\\text{ and }B=\\left[\\begin{array}{c}5\\\\ -4\\\\ 2\\end{array}\\begin{array}{c}-1\\\\ 0\\\\ 3\\end{array}\\right][\/latex]<\/div>\n<\/div>\n<div class=\"textbox shaded\">\n<h3>Solution<\/h3>\n<ol><li>As the dimensions of [latex]A[\/latex] are [latex]2\\text{}\\times \\text{}3[\/latex] and the dimensions of [latex]B[\/latex] are [latex]3\\text{}\\times \\text{}2,\\text{}[\/latex] these matrices can be multiplied together because the number of columns in [latex]A[\/latex] matches the number of rows in [latex]B[\/latex]. The resulting product will be a [latex]2\\text{}\\times \\text{}2[\/latex] matrix, the number of rows in [latex]A[\/latex] by the number of columns in [latex]B[\/latex].\n<div style=\"text-align: center;\">[latex]\\begin{array}{l}\\hfill \\\\ AB=\\left[\\begin{array}{rrr}\\hfill -1&amp; \\hfill 2&amp; \\hfill 3\\\\ \\hfill 4&amp; \\hfill 0&amp; \\hfill 5\\end{array}\\right]\\text{ }\\left[\\begin{array}{rr}\\hfill 5&amp; \\hfill -1\\\\ \\hfill -4&amp; \\hfill 0\\\\ \\hfill 2&amp; \\hfill 3\\end{array}\\right]\\hfill \\\\ \\text{ }=\\left[\\begin{array}{rr}\\hfill -1\\left(5\\right)+2\\left(-4\\right)+3\\left(2\\right)&amp; \\hfill -1\\left(-1\\right)+2\\left(0\\right)+3\\left(3\\right)\\\\ \\hfill 4\\left(5\\right)+0\\left(-4\\right)+5\\left(2\\right)&amp; \\hfill 4\\left(-1\\right)+0\\left(0\\right)+5\\left(3\\right)\\end{array}\\right]\\hfill \\\\ \\text{ }=\\left[\\begin{array}{rr}\\hfill -7&amp; \\hfill 10\\\\ \\hfill 30&amp; \\hfill 11\\end{array}\\right]\\hfill \\end{array}[\/latex]<\/div><\/li>\n\t<li>The dimensions of [latex]B[\/latex] are [latex]3\\times 2[\/latex] and the dimensions of [latex]A[\/latex] are [latex]2\\times 3[\/latex]. The inner dimensions match so the product is defined and will be a [latex]3\\times 3[\/latex] matrix.\n<div style=\"text-align: center;\">[latex]\\begin{array}{l}\\hfill \\\\ BA=\\left[\\begin{array}{rr}\\hfill 5&amp; \\hfill -1\\\\ \\hfill -4&amp; \\hfill 0\\\\ \\hfill 2&amp; \\hfill 3\\end{array}\\right]\\text{ }\\left[\\begin{array}{rrr}\\hfill -1&amp; \\hfill 2&amp; \\hfill 3\\\\ \\hfill 4&amp; \\hfill 0&amp; \\hfill 5\\end{array}\\right]\\hfill \\\\ \\text{ }=\\left[\\begin{array}{rrr}\\hfill 5\\left(-1\\right)+-1\\left(4\\right)&amp; \\hfill 5\\left(2\\right)+-1\\left(0\\right)&amp; \\hfill 5\\left(3\\right)+-1\\left(5\\right)\\\\ \\hfill -4\\left(-1\\right)+0\\left(4\\right)&amp; \\hfill -4\\left(2\\right)+0\\left(0\\right)&amp; \\hfill -4\\left(3\\right)+0\\left(5\\right)\\\\ \\hfill 2\\left(-1\\right)+3\\left(4\\right)&amp; \\hfill 2\\left(2\\right)+3\\left(0\\right)&amp; \\hfill 2\\left(3\\right)+3\\left(5\\right)\\end{array}\\right]\\hfill \\\\ \\text{ }=\\left[\\begin{array}{rrr}\\hfill -9&amp; \\hfill 10&amp; \\hfill 10\\\\ \\hfill 4&amp; \\hfill -8&amp; \\hfill -12\\\\ \\hfill 10&amp; \\hfill 4&amp; \\hfill 21\\end{array}\\right]\\hfill \\end{array}[\/latex]<\/div><\/li>\n<\/ol><\/div>\n<div>\n<h3>Analysis of the Solution<\/h3>\nNotice that the products [latex]AB[\/latex] and [latex]BA[\/latex] are not equal.\n<div style=\"text-align: center;\">[latex]AB=\\left[\\begin{array}{cc}-7&amp; 10\\\\ 30&amp; 11\\end{array}\\right]\\ne \\left[\\begin{array}{ccc}-9&amp; 10&amp; 10\\\\ 4&amp; -8&amp; -12\\\\ 10&amp; 4&amp; 21\\end{array}\\right]=BA[\/latex]<\/div>\nThis illustrates the fact that matrix multiplication is not commutative.\n\n<\/div>\n<div class=\"textbox\">\n<h3>Q &amp; A<\/h3>\n<h3>Is it possible for <em>AB<\/em> to be defined but not <em>BA<\/em>?<\/h3>\n<em>Yes, consider a matrix A with dimension [latex]3\\times 4[\/latex] and matrix B with dimension [latex]4\\times 2[\/latex]. For the product AB the inner dimensions are 4 and the product is defined, but for the product BA the inner dimensions are 2 and 3 so the product is undefined.<\/em>\n\n<\/div>\n<div class=\"textbox shaded\">\n<h3>Example 10: Using Matrices in Real-World Problems<\/h3>\nLet\u2019s return to the problem presented at the opening of this section. We have the table below, representing the equipment needs of two soccer teams.\n<table id=\"Table_09_05_03\" summary=\"..\"><thead><tr><th\/>\n<th data-align=\"center\">Wildcats<\/th>\n<th data-align=\"center\">Mud Cats<\/th>\n<\/tr><\/thead><tbody><tr><td data-align=\"center\"><strong>Goals<\/strong><\/td>\n<td data-align=\"center\">6<\/td>\n<td data-align=\"center\">10<\/td>\n<\/tr><tr><td data-align=\"center\"><strong>Balls<\/strong><\/td>\n<td data-align=\"center\">30<\/td>\n<td data-align=\"center\">24<\/td>\n<\/tr><tr><td data-align=\"center\"><strong>Jerseys<\/strong><\/td>\n<td data-align=\"center\">14<\/td>\n<td data-align=\"center\">20<\/td>\n<\/tr><\/tbody><\/table>\nWe are also given the prices of the equipment, as shown in the table below.\n<table id=\"Table_09_05_04\" summary=\"..\"><tbody><tr><td><strong>Goal<\/strong><\/td>\n<td>$300<\/td>\n<\/tr><tr><td><strong>Ball<\/strong><\/td>\n<td>$10<\/td>\n<\/tr><tr><td><strong>Jersey<\/strong><\/td>\n<td>$30<\/td>\n<\/tr><\/tbody><\/table>\nWe will convert the data to matrices. Thus, the equipment need matrix is written as\n<div style=\"text-align: center;\">[latex]E=\\left[\\begin{array}{c}6\\\\ 30\\\\ 14\\end{array}\\begin{array}{c}10\\\\ 24\\\\ 20\\end{array}\\right][\/latex]<\/div>\nThe cost matrix is written as\n<div style=\"text-align: center;\">[latex]C=\\left[\\begin{array}{ccc}300&amp; 10&amp; 30\\end{array}\\right][\/latex]<\/div>\nWe perform matrix multiplication to obtain costs for the equipment.\n<div style=\"text-align: center;\">[latex]\\begin{array}{l}\\hfill \\\\ \\hfill \\\\ CE=\\left[\\begin{array}{rrr}\\hfill 300&amp; \\hfill 10&amp; \\hfill 30\\end{array}\\right]\\cdot \\left[\\begin{array}{rr}\\hfill 6&amp; \\hfill 10\\\\ \\hfill 30&amp; \\hfill 24\\\\ \\hfill 14&amp; \\hfill 20\\end{array}\\right]\\hfill \\\\ \\text{ }=\\left[\\begin{array}{rr}\\hfill 300\\left(6\\right)+10\\left(30\\right)+30\\left(14\\right)&amp; \\hfill 300\\left(10\\right)+10\\left(24\\right)+30\\left(20\\right)\\end{array}\\right]\\hfill \\\\ \\text{ }=\\left[\\begin{array}{rr}\\hfill 2,520&amp; \\hfill 3,840\\end{array}\\right]\\hfill \\end{array}[\/latex]<\/div>\nThe total cost for equipment for the Wildcats is $2,520, and the total cost for equipment for the Mud Cats is $3,840.\n\n<\/div>\n<div class=\"textbox\">\n<h3>How To: Given a matrix operation, evaluate using a calculator.<strong>\n<\/strong><\/h3>\n<ol><li>Save each matrix as a matrix variable [latex]\\left[A\\right],\\left[B\\right],\\left[C\\right],..[\/latex].<\/li>\n\t<li>Enter the operation into the calculator, calling up each matrix variable as needed.<\/li>\n\t<li>If the operation is defined, the calculator will present the solution matrix; if the operation is undefined, it will display an error message.<\/li>\n<\/ol><\/div>\n<div class=\"textbox shaded\">\n<h3>Example 11: Using a Calculator to Perform Matrix Operations<\/h3>\nFind [latex]AB-C[\/latex]\u00a0given\n<div style=\"text-align: center;\">[latex]A=\\left[\\begin{array}{rrr}\\hfill -15&amp; \\hfill 25&amp; \\hfill 32\\\\ \\hfill 41&amp; \\hfill -7&amp; \\hfill -28\\\\ \\hfill 10&amp; \\hfill 34&amp; \\hfill -2\\end{array}\\right],B=\\left[\\begin{array}{rrr}\\hfill 45&amp; \\hfill 21&amp; \\hfill -37\\\\ \\hfill -24&amp; \\hfill 52&amp; \\hfill 19\\\\ \\hfill 6&amp; \\hfill -48&amp; \\hfill -31\\end{array}\\right],\\text{and }C=\\left[\\begin{array}{rrr}\\hfill -100&amp; \\hfill -89&amp; \\hfill -98\\\\ \\hfill 25&amp; \\hfill -56&amp; \\hfill 74\\\\ \\hfill -67&amp; \\hfill 42&amp; \\hfill -75\\end{array}\\right][\/latex].<\/div>\n<\/div>\n<div class=\"textbox shaded\">\n<h3>Solution<\/h3>\nOn the matrix page of the calculator, we enter matrix [latex]A[\/latex] above as the matrix variable [latex]\\left[A\\right][\/latex], matrix [latex]B[\/latex] above as the matrix variable [latex]\\left[B\\right][\/latex], and matrix [latex]C[\/latex] above as the matrix variable [latex]\\left[C\\right][\/latex].\n\nOn the home screen of the calculator, we type in the problem and call up each matrix variable as needed.\n<div style=\"text-align: center;\">[latex]\\left[A\\right]\\times \\left[B\\right]-\\left[C\\right][\/latex]<\/div>\nThe calculator gives us the following matrix.\n<div style=\"text-align: center;\">[latex]\\left[\\begin{array}{rrr}\\hfill -983&amp; \\hfill -462&amp; \\hfill 136\\\\ \\hfill 1,820&amp; \\hfill 1,897&amp; \\hfill -856\\\\ \\hfill -311&amp; \\hfill 2,032&amp; \\hfill 413\\end{array}\\right][\/latex]<\/div>\n<\/div>","rendered":"<p>In addition to multiplying a matrix by a scalar, we can multiply two matrices. Finding the <strong>product of two matrices<\/strong> is only possible when the inner dimensions are the same, meaning that the number of columns of the first matrix is equal to the number of rows of the second matrix. If [latex]A[\/latex] is an [latex]\\text{ }m\\text{ }\\times \\text{ }r\\text{ }[\/latex] matrix and [latex]B[\/latex] is an [latex]\\text{ }r\\text{ }\\times \\text{ }n\\text{ }[\/latex] matrix, then the product matrix [latex]AB[\/latex] is an [latex]\\text{ }m\\text{ }\\times \\text{ }n\\text{ }[\/latex] matrix. For example, the product [latex]AB[\/latex] is possible because the number of columns in [latex]A[\/latex] is the same as the number of rows in [latex]B[\/latex]. If the inner dimensions do not match, the product is not defined.<\/p>\n<div style=\"width: 164px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/s3-us-west-2.amazonaws.com\/courses-images-archive-read-only\/wp-content\/uploads\/sites\/924\/2015\/11\/25202142\/12.jpg\" alt=\"A has two rows and three columns and B has three rows and three columns. Because the number of columns in A matches the number of rows in B, the product of A and B is defined.\" width=\"154\" height=\"93\" data-media-type=\"image\/jpg\" \/><\/p>\n<p class=\"wp-caption-text\"><b>Figure 1<\/b><\/p>\n<\/div>\n<p>We multiply entries of [latex]A[\/latex] with entries of [latex]B[\/latex] according to a specific pattern as outlined below. The process of <strong>matrix multiplication<\/strong> becomes clearer when working a problem with real numbers.<\/p>\n<p>To obtain the entries in row [latex]i[\/latex] of [latex]AB,\\text{}[\/latex] we multiply the entries in row [latex]i[\/latex] of [latex]A[\/latex] by column [latex]j[\/latex] in [latex]B[\/latex] and add. For example, given matrices [latex]A[\/latex] and [latex]B,\\text{}[\/latex] where the dimensions of [latex]A[\/latex] are [latex]2\\text{ }\\times \\text{ }3[\/latex] and the dimensions of [latex]B[\/latex] are [latex]3\\text{ }\\times \\text{ }3,\\text{}[\/latex] the product of [latex]AB[\/latex] will be a [latex]2\\text{ }\\times \\text{ }3[\/latex] matrix.\n<\/p>\n<div style=\"text-align: center;\">[latex]A=\\left[\\begin{array}{rrr}\\hfill {a}_{11}& \\hfill {a}_{12}& \\hfill {a}_{13}\\\\ \\hfill {a}_{21}& \\hfill {a}_{22}& \\hfill {a}_{23}\\end{array}\\right]\\text{ and }B=\\left[\\begin{array}{rrr}\\hfill {b}_{11}& \\hfill {b}_{12}& \\hfill {b}_{13}\\\\ \\hfill {b}_{21}& \\hfill {b}_{22}& \\hfill {b}_{23}\\\\ \\hfill {b}_{31}& \\hfill {b}_{32}& \\hfill {b}_{33}\\end{array}\\right][\/latex]<\/div>\n<p>Multiply and add as follows to obtain the first entry of the product matrix [latex]AB[\/latex].<\/p>\n<ol>\n<li>To obtain the entry in row 1, column 1 of [latex]AB,\\text{}[\/latex] multiply the first row in [latex]A[\/latex] by the first column in [latex]B[\/latex], and add.\n<div style=\"text-align: center;\">[latex]\\left[\\begin{array}{ccc}{a}_{11}& {a}_{12}& {a}_{13}\\end{array}\\right]\\cdot \\left[\\begin{array}{c}{b}_{11}\\\\ {b}_{21}\\\\ {b}_{31}\\end{array}\\right]={a}_{11}\\cdot {b}_{11}+{a}_{12}\\cdot {b}_{21}+{a}_{13}\\cdot {b}_{31}[\/latex]<\/div>\n<\/li>\n<li>To obtain the entry in row 1, column 2 of [latex]AB,\\text{}[\/latex] multiply the first row of [latex]A[\/latex] by the second column in [latex]B[\/latex], and add.\n<div style=\"text-align: center;\">[latex]\\left[\\begin{array}{ccc}{a}_{11}& {a}_{12}& {a}_{13}\\end{array}\\right]\\cdot \\left[\\begin{array}{c}{b}_{12}\\\\ {b}_{22}\\\\ {b}_{32}\\end{array}\\right]={a}_{11}\\cdot {b}_{12}+{a}_{12}\\cdot {b}_{22}+{a}_{13}\\cdot {b}_{32}[\/latex]<\/div>\n<\/li>\n<li>To obtain the entry in row 1, column 3 of [latex]AB,\\text{}[\/latex] multiply the first row of [latex]A[\/latex] by the third column in [latex]B[\/latex], and add.\n<div style=\"text-align: center;\">[latex]\\left[\\begin{array}{ccc}{a}_{11}& {a}_{12}& {a}_{13}\\end{array}\\right]\\cdot \\left[\\begin{array}{c}{b}_{13}\\\\ {b}_{23}\\\\ {b}_{33}\\end{array}\\right]={a}_{11}\\cdot {b}_{13}+{a}_{12}\\cdot {b}_{23}+{a}_{13}\\cdot {b}_{33}[\/latex]<\/div>\n<\/li>\n<\/ol>\n<p>We proceed the same way to obtain the second row of [latex]AB[\/latex]. In other words, row 2 of [latex]A[\/latex] times column 1 of [latex]B[\/latex]; row 2 of [latex]A[\/latex] times column 2 of [latex]B[\/latex]; row 2 of [latex]A[\/latex] times column 3 of [latex]B[\/latex]. When complete, the product matrix will be<\/p>\n<div style=\"text-align: center;\">[latex]AB=\\left[\\begin{array}{c}\\begin{array}{l}{a}_{11}\\cdot {b}_{11}+{a}_{12}\\cdot {b}_{21}+{a}_{13}\\cdot {b}_{31}\\\\ \\end{array}\\\\ {a}_{21}\\cdot {b}_{11}+{a}_{22}\\cdot {b}_{21}+{a}_{23}\\cdot {b}_{31}\\end{array}\\begin{array}{c}\\begin{array}{l}{a}_{11}\\cdot {b}_{12}+{a}_{12}\\cdot {b}_{22}+{a}_{13}\\cdot {b}_{32}\\\\ \\end{array}\\\\ {a}_{21}\\cdot {b}_{12}+{a}_{22}\\cdot {b}_{22}+{a}_{23}\\cdot {b}_{32}\\end{array}\\begin{array}{c}\\begin{array}{l}{a}_{11}\\cdot {b}_{13}+{a}_{12}\\cdot {b}_{23}+{a}_{13}\\cdot {b}_{33}\\\\ \\end{array}\\\\ {a}_{21}\\cdot {b}_{13}+{a}_{22}\\cdot {b}_{23}+{a}_{23}\\cdot {b}_{33}\\end{array}\\right][\/latex]<\/div>\n<div class=\"textbox\">\n<h3>A General Note: Properties of Matrix Multiplication<\/h3>\n<p>For the matrices [latex]A,B,\\text{}[\/latex] and [latex]C[\/latex] the following properties hold.<\/p>\n<ul>\n<li>Matrix multiplication is associative: [latex]\\left(AB\\right)C=A\\left(BC\\right)[\/latex].<\/li>\n<li>Matrix multiplication is distributive: [latex]\\begin{array}{l}\\begin{array}{l}\\\\ C\\left(A+B\\right)=CA+CB,\\end{array}\\hfill \\\\ \\left(A+B\\right)C=AC+BC.\\hfill \\end{array}[\/latex]<\/li>\n<\/ul>\n<p>Note that matrix multiplication is not commutative.<\/p>\n<\/div>\n<div class=\"textbox shaded\">\n<h3>Example 8: Multiplying Two Matrices<\/h3>\n<p>Multiply matrix [latex]A[\/latex] and matrix [latex]B[\/latex].<\/p>\n<div style=\"text-align: center;\">[latex]A=\\left[\\begin{array}{cc}1& 2\\\\ 3& 4\\end{array}\\right]\\text{ and }B=\\left[\\begin{array}{cc}5& 6\\\\ 7& 8\\end{array}\\right][\/latex]<\/div>\n<\/div>\n<div class=\"textbox shaded\">\n<h3>Solution<\/h3>\n<p>First, we check the dimensions of the matrices. Matrix [latex]A[\/latex] has dimensions [latex]2\\times 2[\/latex] and matrix [latex]B[\/latex] has dimensions [latex]2\\times 2[\/latex]. The inner dimensions are the same so we can perform the multiplication. The product will have the dimensions [latex]2\\times 2[\/latex].<\/p>\n<p>We perform the operations outlined previously.<\/p>\n<div style=\"width: 497px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/s3-us-west-2.amazonaws.com\/courses-images-archive-read-only\/wp-content\/uploads\/sites\/924\/2015\/11\/25202143\/CNX_Precalc_Figure_09_05_0032.jpg\" alt=\"The first column of the product of A and B is defined as the result of matrix -vector multiplication of A and the first column of B. Column two of the product of A and B is defined as the result of the matrix-vector multiplication of A and the second column of B.\" width=\"487\" height=\"211\" data-media-type=\"image\/jpg\" \/><\/p>\n<p class=\"wp-caption-text\"><b>Figure 2<\/b><\/p>\n<\/div>\n<\/div>\n<div class=\"textbox shaded\">\n<h3>Example 9: Multiplying Two Matrices<\/h3>\n<p>Given [latex]A[\/latex] and [latex]B:[\/latex]<\/p>\n<ol>\n<li>Find [latex]AB[\/latex].<\/li>\n<li>Find [latex]BA[\/latex].<\/li>\n<\/ol>\n<div style=\"text-align: center;\">[latex]A=\\left[\\begin{array}{l}\\begin{array}{ccc}-1& 2& 3\\end{array}\\hfill \\\\ \\begin{array}{ccc}4& 0& 5\\end{array}\\hfill \\end{array}\\right]\\text{ and }B=\\left[\\begin{array}{c}5\\\\ -4\\\\ 2\\end{array}\\begin{array}{c}-1\\\\ 0\\\\ 3\\end{array}\\right][\/latex]<\/div>\n<\/div>\n<div class=\"textbox shaded\">\n<h3>Solution<\/h3>\n<ol>\n<li>As the dimensions of [latex]A[\/latex] are [latex]2\\text{}\\times \\text{}3[\/latex] and the dimensions of [latex]B[\/latex] are [latex]3\\text{}\\times \\text{}2,\\text{}[\/latex] these matrices can be multiplied together because the number of columns in [latex]A[\/latex] matches the number of rows in [latex]B[\/latex]. The resulting product will be a [latex]2\\text{}\\times \\text{}2[\/latex] matrix, the number of rows in [latex]A[\/latex] by the number of columns in [latex]B[\/latex].\n<div style=\"text-align: center;\">[latex]\\begin{array}{l}\\hfill \\\\ AB=\\left[\\begin{array}{rrr}\\hfill -1& \\hfill 2& \\hfill 3\\\\ \\hfill 4& \\hfill 0& \\hfill 5\\end{array}\\right]\\text{ }\\left[\\begin{array}{rr}\\hfill 5& \\hfill -1\\\\ \\hfill -4& \\hfill 0\\\\ \\hfill 2& \\hfill 3\\end{array}\\right]\\hfill \\\\ \\text{ }=\\left[\\begin{array}{rr}\\hfill -1\\left(5\\right)+2\\left(-4\\right)+3\\left(2\\right)& \\hfill -1\\left(-1\\right)+2\\left(0\\right)+3\\left(3\\right)\\\\ \\hfill 4\\left(5\\right)+0\\left(-4\\right)+5\\left(2\\right)& \\hfill 4\\left(-1\\right)+0\\left(0\\right)+5\\left(3\\right)\\end{array}\\right]\\hfill \\\\ \\text{ }=\\left[\\begin{array}{rr}\\hfill -7& \\hfill 10\\\\ \\hfill 30& \\hfill 11\\end{array}\\right]\\hfill \\end{array}[\/latex]<\/div>\n<\/li>\n<li>The dimensions of [latex]B[\/latex] are [latex]3\\times 2[\/latex] and the dimensions of [latex]A[\/latex] are [latex]2\\times 3[\/latex]. The inner dimensions match so the product is defined and will be a [latex]3\\times 3[\/latex] matrix.\n<div style=\"text-align: center;\">[latex]\\begin{array}{l}\\hfill \\\\ BA=\\left[\\begin{array}{rr}\\hfill 5& \\hfill -1\\\\ \\hfill -4& \\hfill 0\\\\ \\hfill 2& \\hfill 3\\end{array}\\right]\\text{ }\\left[\\begin{array}{rrr}\\hfill -1& \\hfill 2& \\hfill 3\\\\ \\hfill 4& \\hfill 0& \\hfill 5\\end{array}\\right]\\hfill \\\\ \\text{ }=\\left[\\begin{array}{rrr}\\hfill 5\\left(-1\\right)+-1\\left(4\\right)& \\hfill 5\\left(2\\right)+-1\\left(0\\right)& \\hfill 5\\left(3\\right)+-1\\left(5\\right)\\\\ \\hfill -4\\left(-1\\right)+0\\left(4\\right)& \\hfill -4\\left(2\\right)+0\\left(0\\right)& \\hfill -4\\left(3\\right)+0\\left(5\\right)\\\\ \\hfill 2\\left(-1\\right)+3\\left(4\\right)& \\hfill 2\\left(2\\right)+3\\left(0\\right)& \\hfill 2\\left(3\\right)+3\\left(5\\right)\\end{array}\\right]\\hfill \\\\ \\text{ }=\\left[\\begin{array}{rrr}\\hfill -9& \\hfill 10& \\hfill 10\\\\ \\hfill 4& \\hfill -8& \\hfill -12\\\\ \\hfill 10& \\hfill 4& \\hfill 21\\end{array}\\right]\\hfill \\end{array}[\/latex]<\/div>\n<\/li>\n<\/ol>\n<\/div>\n<div>\n<h3>Analysis of the Solution<\/h3>\n<p>Notice that the products [latex]AB[\/latex] and [latex]BA[\/latex] are not equal.<\/p>\n<div style=\"text-align: center;\">[latex]AB=\\left[\\begin{array}{cc}-7& 10\\\\ 30& 11\\end{array}\\right]\\ne \\left[\\begin{array}{ccc}-9& 10& 10\\\\ 4& -8& -12\\\\ 10& 4& 21\\end{array}\\right]=BA[\/latex]<\/div>\n<p>This illustrates the fact that matrix multiplication is not commutative.<\/p>\n<\/div>\n<div class=\"textbox\">\n<h3>Q &amp; A<\/h3>\n<h3>Is it possible for <em>AB<\/em> to be defined but not <em>BA<\/em>?<\/h3>\n<p><em>Yes, consider a matrix A with dimension [latex]3\\times 4[\/latex] and matrix B with dimension [latex]4\\times 2[\/latex]. For the product AB the inner dimensions are 4 and the product is defined, but for the product BA the inner dimensions are 2 and 3 so the product is undefined.<\/em><\/p>\n<\/div>\n<div class=\"textbox shaded\">\n<h3>Example 10: Using Matrices in Real-World Problems<\/h3>\n<p>Let\u2019s return to the problem presented at the opening of this section. We have the table below, representing the equipment needs of two soccer teams.<\/p>\n<table id=\"Table_09_05_03\" summary=\"..\">\n<thead>\n<tr>\n<th>\n<\/th>\n<th data-align=\"center\">Wildcats<\/th>\n<th data-align=\"center\">Mud Cats<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td data-align=\"center\"><strong>Goals<\/strong><\/td>\n<td data-align=\"center\">6<\/td>\n<td data-align=\"center\">10<\/td>\n<\/tr>\n<tr>\n<td data-align=\"center\"><strong>Balls<\/strong><\/td>\n<td data-align=\"center\">30<\/td>\n<td data-align=\"center\">24<\/td>\n<\/tr>\n<tr>\n<td data-align=\"center\"><strong>Jerseys<\/strong><\/td>\n<td data-align=\"center\">14<\/td>\n<td data-align=\"center\">20<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>We are also given the prices of the equipment, as shown in the table below.<\/p>\n<table id=\"Table_09_05_04\" summary=\"..\">\n<tbody>\n<tr>\n<td><strong>Goal<\/strong><\/td>\n<td>$300<\/td>\n<\/tr>\n<tr>\n<td><strong>Ball<\/strong><\/td>\n<td>$10<\/td>\n<\/tr>\n<tr>\n<td><strong>Jersey<\/strong><\/td>\n<td>$30<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>We will convert the data to matrices. Thus, the equipment need matrix is written as<\/p>\n<div style=\"text-align: center;\">[latex]E=\\left[\\begin{array}{c}6\\\\ 30\\\\ 14\\end{array}\\begin{array}{c}10\\\\ 24\\\\ 20\\end{array}\\right][\/latex]<\/div>\n<p>The cost matrix is written as<\/p>\n<div style=\"text-align: center;\">[latex]C=\\left[\\begin{array}{ccc}300& 10& 30\\end{array}\\right][\/latex]<\/div>\n<p>We perform matrix multiplication to obtain costs for the equipment.<\/p>\n<div style=\"text-align: center;\">[latex]\\begin{array}{l}\\hfill \\\\ \\hfill \\\\ CE=\\left[\\begin{array}{rrr}\\hfill 300& \\hfill 10& \\hfill 30\\end{array}\\right]\\cdot \\left[\\begin{array}{rr}\\hfill 6& \\hfill 10\\\\ \\hfill 30& \\hfill 24\\\\ \\hfill 14& \\hfill 20\\end{array}\\right]\\hfill \\\\ \\text{ }=\\left[\\begin{array}{rr}\\hfill 300\\left(6\\right)+10\\left(30\\right)+30\\left(14\\right)& \\hfill 300\\left(10\\right)+10\\left(24\\right)+30\\left(20\\right)\\end{array}\\right]\\hfill \\\\ \\text{ }=\\left[\\begin{array}{rr}\\hfill 2,520& \\hfill 3,840\\end{array}\\right]\\hfill \\end{array}[\/latex]<\/div>\n<p>The total cost for equipment for the Wildcats is $2,520, and the total cost for equipment for the Mud Cats is $3,840.<\/p>\n<\/div>\n<div class=\"textbox\">\n<h3>How To: Given a matrix operation, evaluate using a calculator.<strong><br \/>\n<\/strong><\/h3>\n<ol>\n<li>Save each matrix as a matrix variable [latex]\\left[A\\right],\\left[B\\right],\\left[C\\right],..[\/latex].<\/li>\n<li>Enter the operation into the calculator, calling up each matrix variable as needed.<\/li>\n<li>If the operation is defined, the calculator will present the solution matrix; if the operation is undefined, it will display an error message.<\/li>\n<\/ol>\n<\/div>\n<div class=\"textbox shaded\">\n<h3>Example 11: Using a Calculator to Perform Matrix Operations<\/h3>\n<p>Find [latex]AB-C[\/latex]\u00a0given<\/p>\n<div style=\"text-align: center;\">[latex]A=\\left[\\begin{array}{rrr}\\hfill -15& \\hfill 25& \\hfill 32\\\\ \\hfill 41& \\hfill -7& \\hfill -28\\\\ \\hfill 10& \\hfill 34& \\hfill -2\\end{array}\\right],B=\\left[\\begin{array}{rrr}\\hfill 45& \\hfill 21& \\hfill -37\\\\ \\hfill -24& \\hfill 52& \\hfill 19\\\\ \\hfill 6& \\hfill -48& \\hfill -31\\end{array}\\right],\\text{and }C=\\left[\\begin{array}{rrr}\\hfill -100& \\hfill -89& \\hfill -98\\\\ \\hfill 25& \\hfill -56& \\hfill 74\\\\ \\hfill -67& \\hfill 42& \\hfill -75\\end{array}\\right][\/latex].<\/div>\n<\/div>\n<div class=\"textbox shaded\">\n<h3>Solution<\/h3>\n<p>On the matrix page of the calculator, we enter matrix [latex]A[\/latex] above as the matrix variable [latex]\\left[A\\right][\/latex], matrix [latex]B[\/latex] above as the matrix variable [latex]\\left[B\\right][\/latex], and matrix [latex]C[\/latex] above as the matrix variable [latex]\\left[C\\right][\/latex].<\/p>\n<p>On the home screen of the calculator, we type in the problem and call up each matrix variable as needed.<\/p>\n<div style=\"text-align: center;\">[latex]\\left[A\\right]\\times \\left[B\\right]-\\left[C\\right][\/latex]<\/div>\n<p>The calculator gives us the following matrix.<\/p>\n<div style=\"text-align: center;\">[latex]\\left[\\begin{array}{rrr}\\hfill -983& \\hfill -462& \\hfill 136\\\\ \\hfill 1,820& \\hfill 1,897& \\hfill -856\\\\ \\hfill -311& \\hfill 2,032& \\hfill 413\\end{array}\\right][\/latex]<\/div>\n<\/div>\n\n\t\t\t <section class=\"citations-section\" role=\"contentinfo\">\n\t\t\t <h3>Candela Citations<\/h3>\n\t\t\t\t\t <div>\n\t\t\t\t\t\t <div id=\"citation-list-1791\">\n\t\t\t\t\t\t\t <div class=\"licensing\"><div class=\"license-attribution-dropdown-subheading\">CC licensed content, Specific attribution<\/div><ul class=\"citation-list\"><li>Precalculus. <strong>Authored by<\/strong>: OpenStax College. <strong>Provided by<\/strong>: OpenStax. <strong>Located at<\/strong>: <a target=\"_blank\" href=\"http:\/\/cnx.org\/contents\/fd53eae1-fa23-47c7-bb1b-972349835c3c@5.175:1\/Preface\">http:\/\/cnx.org\/contents\/fd53eae1-fa23-47c7-bb1b-972349835c3c@5.175:1\/Preface<\/a>. <strong>License<\/strong>: <em><a target=\"_blank\" rel=\"license\" href=\"https:\/\/creativecommons.org\/licenses\/by\/4.0\/\">CC BY: Attribution<\/a><\/em><\/li><\/ul><\/div>\n\t\t\t\t\t\t <\/div>\n\t\t\t\t\t <\/div>\n\t\t\t <\/section>","protected":false},"author":276,"menu_order":4,"template":"","meta":{"_candela_citation":"[{\"type\":\"cc-attribution\",\"description\":\"Precalculus\",\"author\":\"OpenStax College\",\"organization\":\"OpenStax\",\"url\":\"http:\/\/cnx.org\/contents\/fd53eae1-fa23-47c7-bb1b-972349835c3c@5.175:1\/Preface\",\"project\":\"\",\"license\":\"cc-by\",\"license_terms\":\"\"}]","CANDELA_OUTCOMES_GUID":"","pb_show_title":"on","pb_short_title":"","pb_subtitle":"","pb_authors":[],"pb_section_license":""},"chapter-type":[],"contributor":[],"license":[],"class_list":["post-1791","chapter","type-chapter","status-publish","hentry"],"part":1784,"_links":{"self":[{"href":"https:\/\/courses.lumenlearning.com\/ivytech-collegealgebra\/wp-json\/pressbooks\/v2\/chapters\/1791","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/courses.lumenlearning.com\/ivytech-collegealgebra\/wp-json\/pressbooks\/v2\/chapters"}],"about":[{"href":"https:\/\/courses.lumenlearning.com\/ivytech-collegealgebra\/wp-json\/wp\/v2\/types\/chapter"}],"author":[{"embeddable":true,"href":"https:\/\/courses.lumenlearning.com\/ivytech-collegealgebra\/wp-json\/wp\/v2\/users\/276"}],"version-history":[{"count":1,"href":"https:\/\/courses.lumenlearning.com\/ivytech-collegealgebra\/wp-json\/pressbooks\/v2\/chapters\/1791\/revisions"}],"predecessor-version":[{"id":2259,"href":"https:\/\/courses.lumenlearning.com\/ivytech-collegealgebra\/wp-json\/pressbooks\/v2\/chapters\/1791\/revisions\/2259"}],"part":[{"href":"https:\/\/courses.lumenlearning.com\/ivytech-collegealgebra\/wp-json\/pressbooks\/v2\/parts\/1784"}],"metadata":[{"href":"https:\/\/courses.lumenlearning.com\/ivytech-collegealgebra\/wp-json\/pressbooks\/v2\/chapters\/1791\/metadata\/"}],"wp:attachment":[{"href":"https:\/\/courses.lumenlearning.com\/ivytech-collegealgebra\/wp-json\/wp\/v2\/media?parent=1791"}],"wp:term":[{"taxonomy":"chapter-type","embeddable":true,"href":"https:\/\/courses.lumenlearning.com\/ivytech-collegealgebra\/wp-json\/pressbooks\/v2\/chapter-type?post=1791"},{"taxonomy":"contributor","embeddable":true,"href":"https:\/\/courses.lumenlearning.com\/ivytech-collegealgebra\/wp-json\/wp\/v2\/contributor?post=1791"},{"taxonomy":"license","embeddable":true,"href":"https:\/\/courses.lumenlearning.com\/ivytech-collegealgebra\/wp-json\/wp\/v2\/license?post=1791"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}