 So in this video I want to show you just how easy it is to get the inverse of a matrix. Let's change this first code cell into a markdown cell. Remember I'm just going to do the keyboard shortcut escape and you notice that this bar turned blue. I'm going to hit M for markdown and you see this drop down change to markdown and I'm going to hit enter on a PC or Linux machine or return on a Mac and it turns green so I can just type in there. I'm going to use single pound sign or hashtag for an h1 sized title and let's say matrix inverse inverse. Shift enter, shift return and beautifully there I have my title for my notebook. You'd also notice that I changed the name here to just inverse. Now I'm going to use the from import. I'm going to say from simply import the following. All I want here is the matrix function and the init printing function. Init printing. There we go. I'm just going to hold shift enter, shift return and those two only those two functions are going to be imported. I'm going to use init printing. I just typed init and underscore and hit the tab key for auto completion. I'm using it as a function so open close parentheses, shift enter, shift return and now we'll have the pretty large tick printing to the screen. So what am I trying to to solve here? Let me show you something. I'm going to change this code cell again into a markdown cell so escape enter, escape m return and I'm going to hit the double dollar sign so that shift for my keyboard and that enters this markdown cell for LaTeX. In case you know a bit of LaTeX or tech you can just type that in directly here. Let me show you. It's not part of this video series but let me just show you. If I say a and then I want an x with an underline I'm going to say backslash underline and then in curly places x and so there's a x equals and then I want an underline b, underline b close that and then two dollar signs. The two dollar signs will center this LaTeX on the on the screen. If it was just a single dollar sign on each side it would be to the left. I'm going to hold down shift and enter, shift return and you see beautiful LaTeX there to print it to the screen. So this is not code this is just me writing in a normal tech cell, a normal markdown cell and I can write something like that. The matrix A times the column vector x equals the column vector b. We're trying to solve for that and if I have A being an n by n matrix of coefficients so I have the same number of unknowns and the same number of equations that's a square matrix and it's easy to solve and what we are after is the following. Let me do that again escape m enter I'm going to do two dollar signs again so I'm after A inverse the way that you would do that is the following so I'm going to solve for underline x so that's going to place an underline over the x and then to have an A I'm going to have A and then shift six on my keyboard which is the carrot sign and then negative one inside of its curly braces so that says A to the power negative one and then I have underline and then I have underline b again so LaTeX is quite easy if you if you look at that and there we go x equals A inverse b so I'm after that inverse now there's two ways in which you can get the inverses here using some pi the first one is to create this matrix of coefficients so let's do that and and add the element add the identity matrix let me show you so escape m returner enter let's do two pound signs there because I want an h2 heading let's say inverse by elementary row operations okay let's do that one by elementary row operations let's create a matrix I'm going to call mine A1 that's my computer variable it's going to hold a SMPI matrix object I've already imported matrix as a function from SMPI so I can simply type matrix it's a function so arguments go inside of parentheses square brackets and for the whole matrix and then each row has to go in in its own set of square brackets or another set of square brackets so let's make the matrix three and four and I add to that the one in the zero from the identity matrix go outside my square brackets another a comma for the next row and another set of square brackets for that row let's make it four comma five and I'm adding to that zero and one so let's just hit enter return and then A1 again to print that to the screen so you see I actually have this two by two matrix three and four and four and five but I add to that on the right hand side the identity matrix of size two by two since my matrix three four four five the two by two matrix I'm adding the identity matrix two by two identity matrix on the right hand side and now if I use my row reduced function here our row reduced echelon form and I do that it is going to give to me the identity matrix on the left hand side the one zero zero one and on the right hand side what I have left here is the inverse of three four four five so it's negative five four four and three so you can do that to get the inverse let me show you the more convenient way escape m enter and two pound signs because we're going to do inverse through using just the dot i and v function I'm going to make this little apostrophe which is way up on the left top of my keyboard under the escape key and I'm going to type i and v open close parentheses and that little sign again so what that does is if you have marked on and you want it to appear as as you have written code inside of a code cell hide them in those little and those little little signs that shift enter and you can see it's sort of colored that in and it looks different the text looks different let's just to show that I you know it's it's just one way to show that that's actual code and that's what the section is going to be about so let's just create matrix a two again that's just going to be a matrix a matrix and my parentheses my square brackets my set of square brackets three comma four and my second row was four comma five all the way to the end enter return a to print to the screen by shift enter shift return and that was my initial matrix that that I had to solve to all get the inverse four at least matrix of coefficients square matrix a two and a very easy way to do that is referred to a two and then the dot notation and just i and v and open and close parentheses and that immediately is just going to give me the inverse of that matrix should one exist and I see there the negative five four and the four negative three just as I could have read from the reduced echelon form there so the way that some pie does this is just through Gaussian elimination but you can specify a different way so if you're really dealing with large matrices you can ask some pie to use a different algorithm I just want to make you aware of that it's not of particular interest here with these small matrices I could say i and v and then I'm going to pass an argument to this function and I'm going to call it method equals and then in quotation marks lu so it's going to use lu decomposition to get the the inverse of this matrix exact same inverse that we're going to see but under circumstances that might be a better method to use than the default which is this Gaussian elimination so you see there really how easy it is to do to get an inverse using some pie if you have some some work to do that you have to check your own hard work which you do in pencil and paper or pen and paper then use some pie just to check whether whether your solutions are correct very very easy to do