### Video Transcript

A girl bought 37 kilograms of flour and four kilograms of butter for 340 Egyptian pounds, and her friend bought 13 kilograms of flour and 12 kilograms of butter for 236 Egyptian pounds. Using matrices, find the price per kilogram of both flour and butter.

In order to be able to answer this question, letβs begin by defining some variables. Letβs let the variable π₯ represent in Egyptian pounds the price per kilogram of flour. And in a similar way, weβll let π¦ be the price in Egyptian pounds per kilogram of butter. Now, we can use these variables to set up a system of linear equations. Weβre told that a total of 37 kilograms of flour and four kilograms of butter have a total cost of 340 Egyptian pounds. Since π₯ is the price per kilogram of flour, the total price of 37 kilograms of flour is 37π₯. And in a similar way, the total price of four kilograms of butter is four π¦. So the first equation that we can form is 37π₯ plus four π¦ equals 340.

Next, we know that 13 kilograms of flour and 12 kilograms of butter cost 236 Egyptian pounds. So 13π₯ plus 12π¦ equals 236. We now have a system of linear equations, which we need to solve for π₯ and π¦. And in fact, weβre told to do this using matrices. So weβll set up a matrix equation in the form π΄π equals π΅. In this matrix equation, π΄ is going to be a two-by-two matrix containing numbers. π is going to be a column matrix containing the variables π₯ and π¦. And π΅ is going to be another constant matrix. This time, thatβs going to be a column matrix.

And due to the way matrix multiplication works, π is the value of the coefficient of π₯ in our first equation. Similarly, π is the coefficient of π¦ in our first equation, π is the coefficient of π₯ in our second equation, and π is the coefficient of π¦ in our second equation. Then the constant matrix π, π is given by the elements 340 and 236. So the equivalent matrix equation to our system of linear equations is the two-by-two matrix 37, four, 13, 12 times the column matrix π₯, π¦ is equal to the matrix with elements 340 and 236. So now we have our matrix equation, letβs recall how to solve it.

We multiply both sides by the inverse of matrix π΄. And since the inverse of a matrix times itself is the identity matrix, weβre actually just left with π₯ is equal to the inverse of π΄ times π΅. So if our matrix π΄ is this two-by-two matrix 37, four, 13, 12, it follows that weβre going to need to begin by finding the inverse of this matrix. And so we recall that given a two-by-two matrix π, π, π, π, its inverse is one over the determinant of that matrix times the matrix with elements π, negative π, negative π, π, where the determinant is the product of elements ππ minus the product of elements π and π. And of course, if this determinant is equal to zero, the inverse of the matrix doesnβt exist.

So letβs begin by finding the determinant of our two-by-two matrix. Itβs the product of the elements in the top left and bottom right, so 37 times 12, minus the product of the elements in the top right and bottom left, so minus four times 13, which is 392. So we know that the inverse of our two-by-two matrix is going to be one over 392 multiplied by some other two-by-two matrix. To find this two-by-two matrix, we switch the elements defined as π and π. And we change the signs of the remaining two. So we have the inverse of our matrix. We know that weβre going to multiply both sides of our equation by this matrix. So letβs clear some space and do that.

The left-hand side simply becomes π₯, π¦. And the right-hand side is as shown. Weβre now going to multiply the two-by-two matrix with the column matrix. And our result will be, in fact, another column matrix. We begin by finding the dot product of the elements in the first row of the first matrix and of our column. Thatβs 12 times 340 plus negative four times 236. Thatβs 3136. Next, we repeat this process, but this time we use the elements in the second row of our first matrix. So itβs negative 13 times 340 plus 37 times 236. Thatβs 4312.

Our matrix π₯, π¦ then is equal to one over 392 times the column matrix with these entries. And so all we need to do to find the column matrix π₯, π¦ and hence the values of π₯ and π¦ is divide each term in our matrix by 392. 3136 divided by 392 is eight, and 4312 divided by 392 is 11. Since we defined π₯ to be the price per kilogram of flour in Egyptian pounds and π¦ to be the price per kilogram of butter, we see that one kilogram of flour costs eight Egyptian pounds and one kilogram of butter costs 11.