welcome back in this shorter lesson we are going to take a look at some linear algebra concepts that we're gonna need in order to analyze systems of differential equations so I like to call this the linear algebra crash course so we'll just talk about some of the essentials that we need in order to move forward so first of all and the most important concept in linear algebra is a the concept of a vector and we've seen some of these already but to more formally define them a vector is a directed line segment whose tale begins at the origin and whose tip terminates at the coordinates specified by the vector for example x equals I notice how you're talking about vectors as opposed to the variable ax when you have a letter lowercase letter with a arrow over it that implies that it has more than one component and we can typically think about these as the x and y components so even though we still are thinking about this value here as the x value and this value as the y value we can still call the vector X with an arrow over it and that's different than we're calling the component X so this vector here has its tail and its tip right at this point and you can see that it starts at the origin and terminates at the point 1 2 now that's in standard form you could also have vectors that start somewhere else for example let's say at the point 1 3 and as long as its displacement is 1 in the X direction and 2 in the Y direction we could say that that vector has the it has the same that's the same vector as the one we're analyzing that's down here at the origin that's over 1 up 2 so these are actually identical vectors they don't have to be at the origin we can perform operations on vectors we can add them we can subtract them and scale them for example if we took 3 times the 1 2 vector we get the 3 6 vector an important thing to notice is the change in Y over change in X on a scale vector for here it's 2 over 1 for the scaled version of that vector we have six to three which is still two to one so that means that the slope of this vector has not changed it's still going to point in the same direction but it's going to it's going to triple the length of that vector so here we have both of those vectors plotted we can see that the one two vector is on the same line as a three six vector so that effectively just creates a scale effect and not a rotation of any sort and we can find the magnitude of a vector or the length of a vector of x equals let's say its components are a and B we can write that as absolute value of x now absolute value just means length of and so even when you're talking about numbers music what's the absolute value of negative two and you say it's two that just means that negative two is two units away from relative zero and so to find the magnitude of a vector it's equal to the square root of its components squared to see why that's the case if you look at this vector here and you triangulate it you make a right triangle where its two sides are its X component Y component this component is one unit long this component is two units long we can think about this as the hypotenuse and we know from Pythagorean theorem that the square of the sides equals the square of the sum of the square of the sides equals the square of the hypotenuse and so C is effectively referring to as the length of that vector so because C squared equals 1 squared plus 2 squared C is equal to the square root of the components squared so that's how you can write the magnitude of or those will often call it the magnitude of a vector but the length of a vector will suffice because we're not going to be dealing with higher dimensions where links doesn't make sense so we said we can scale vectors but it doesn't have to be by a constant the scalar could be a a function so if we buy scalar we just mean it's a number and e to the 3t even though it's a variable a variable is still just a number so if we scale the one two vector by e to the 3t we're gonna scale both of its components by e to the 3t just like when we multiplied the vector by three so that's about all we need to know about vectors for the current moment a matrix is effectively a collection of vectors for example we can write a equals 3 1 1 2 1 and that is a matrix full of two vectors you can think about them as the vectors 3 1 and vectors 2 1 now this is a row this is a matrix that has two rows and two columns so we call it a 2x2 and we always say rows by columns that's just the convention so if I say 2x3 nobody ever confuses that to mean 2 columns and 3 rows we always are in the convention of saying rows by columns so matrices can be added and scaled as well whatever whenever you add two vectors you might imagine that if I took one two plus three five I would just add their components they would have to be the same size so this would be 4 7 and if I were to add two matrices together for example 1 2 3 4 + 5 6 7 8 that would simply be 1 + 5 2 + 6 3 + 7 + 4 + 8 so that's how we would add matrices if we scaled a matrix by a constant so if we took 3 times 1 2 3 4 we would scale as components and that would be 3 6 9 12 so when we actually multiply when we conduct the matrix multiplication it's a little bit strange it's not the way we add vectors or scale vectors or even add matrices or scalar matrices you would think that they would have to first of all be the same size but here I have a 2 by 2 matrix multiplying a 2 by 1 vector and what I end up with is a vector that has two columns one called the column is remember this is just one number 3x plus 2 by a single number even though it has two terms this is still two rows with just one column and the way matrix multiplication takes place in a visual form is the elements of the second Matrix multiply or scale the vectors of the first matrix so here the if you notice that this is the first element in here if you were to tip over this vector on top you would see that the X is going to multiply the first column the Y is going to multiply the second column and then by definition we're gonna add those two together so x times the three one vector Y times the two one vector add those together that's how matrix multiplication is defined we get 3 x + 2 y + 1 x + 1 line so already this is giving us a way to represent the system of equations where we could have a matrix that has coefficients in it and then a vector that has the variables and maybe we're trying to solve for as another example here is a system of equations that is written as a matrix equation right now so a matrix equation just means that it has matrices and vectors in it potentially both may be just one or the other and so if we do the multiplication for this so again think about it this way the first second and third columns are going to get scaled by x y&z respectively and then those scalar multiples are going to get added together so X times the 1 4 7 y times the 2 5 8 Z times the 3 6 9 those get added together now to add that together X multiplies all the top components so 1 X 4 X 7 X Y multiplies to 5 + 8 so up to y 5 y 8 y + Z will multiply 3 Z 3 6 6 z 9 Z and then we're going to add those together add the vectors so we just add the components of the vector so 1 X will add with 2y + 3 Z 4 X will add with 5y + 6z and then 7x we'll add with 8y and 9z remember that's equal to this vector here which is this vector over here and so as a system of equations section means that if two vectors by the way and this is three rows but only in one column because 1x plus 2y plus 3z is just a single number that has to equal 7 the second row has to equal the second row the third row has to equal a third row in order for two vectors to be equal to each other so if we remove the brackets now and we write it what's called scalar form this is just now our system of equations that was being represented as a matrix equation up here so let's practice this a little bit write the system of differential equations DX DT equals 3x plus 2y and dy DT equals 2x minus 4y as a matrix equation so the first thing I'm going to do is I'm going to write these two equations above one another like this and now I'm going to wrap them with basically working backwards from where we ended up in our little example here so now I'll put some parentheses around needs to say this is a 2 by 1 vector equals another 2 by 1 vector and now what I can do is I can actually think about lifting again working in complete reverse we can now split this apart into the vector 3 X 2x plus the vector 2 Y negative 4y and then we can we can factor out an X from the first vector we can factor out a Y from the second vector and now we can again work backwards where in this step from from here to here we conducted the multiplications so if we were to sort of think about this XY and Z is lifting back up into the X Y Z vector the analogy here would be that the XY lift back up into an X Y vector and before those columns got scaled they were part of a matrix with 3/2 is the first column and 2 negative 4 is the second column so our final answer here to write this in matrix form would be to say that the vector DX DT dy DT equals 3 to 2 negative 4 times X Y and it's gonna be important to actually write a system of equations in the matrix form because we're gonna be doing something with this matrix here again this matrix that contains all of the coefficients this is just called the coefficient matrix sometimes you'll see this that's really the derivative matrix you'll see it often written like this DX DT so it's the derivative of a vector we'll talk more about that soon and then we'll just call this here the X vector that is the vector without the derivatives of X and Y in it so a lot of times you'll see this written as DX a system written as DX DT equals this coefficient matrix usually people write capital y times the vector X so now let's let's work work the opposite way we have a matrix equation you want to convert it into scalar form so we want to have x equals equation y equals equation so the first thing we're gonna do is to bring this into scalar form we're gonna combine all of this stuff into one vector so scaling 1 and negative 2 by 2 e to the 16 will give me 2 e to the 60 and negative 4 e to the 16 up and then I'll scale 0 by negative 3 either 2 which is just going to be plus zero up here and negative three e to the 2t times 2 will give me a negative 6 e to the 2t and now I can add these two vectors so 2 e to the 16 plus 0 is just 2 e the 16 negative 4 e to the 6t minus e to the 2t has to stay like that because I don't have e to the 2t e to the 60 or not like terms and so now I can see that X is equal to the top component because the top component needs to equal the top component in the vector so X is going to equal to e to the 6t y is going to equal negative 4 e to the 6 t minus 6 e to the 2t and there we have written our answer in scalar form so now that we know how to work forward and backward let's look at something a little that looks at first a little more complex define V 1 to be the vector 1 1 V to be the vector 2 1/2 lambda 1 this is a Greek symbol called lambda will see this arised kind of often this is lambda and lambda 1 equals negative 2 lambda 2 equals 3 the vector x equals just these two scalar components x and y k 1 equals 5 k 2 equals 7 write the equation vector x equals K 1 e to the lambda T and x forget this V 1 in here so I just put this in times V 1 plus K 2 e to the lambda 2 T V 2 you will see this quite often this this expression here so to write x equals K 1 e to the lambda 1 T V 1 plus K 2 e to the lambda 2 T V 2 at first it looks kind of scary a little bit intimidating all I'm gonna do here is just replace the components with what they are so the back to X contains x and y in it k1 is given to us as 5 so 5 e to the lambda 1 is negative 2 T V 1 is the vector that contains 1 1 in it plus K 2 which is 7 e to the lambda 2 T which is 3 3 T V 2 is the vector 2 1/2 and so now we need to continue to expand this out so really the purpose of this problems is just to show that we can express it in this we can express a matrix equation written in this symbolic form and then we can convert it into actual components so like like before we're going to write the distribute to the 5 e to the negative 2t and the 7 e to the 3t so this will come out to give us 1 times 5 e to the 2t and then 1 times 5 to the 2t again plus and then here we'll have 14 into the 3t and 1/2 of 7 I'll just go ahead and write it as 3.5 e to the 3t and now we add these together giving us 5 to the 2t plus 4 T to the 3t equals X so the X component is going to be the sum of those and the Y component is going to be the sum of those and so X will be 5 e to the 2t plus 14 eetu the 3 of T and Y is gonna be 5 e to the 2t plus 3 and 1/2 e to the 3t and there's our scalar form of that vector of that matrix equation another thing we can do with vectors and we can take derivatives and integrals this might sound scary but really whenever we whenever we perform calculus on vectors the derivative of a vector is just the derivative of the components so if we had x and y in here we take the derivative of X with respect to T that River Y with respect and also the integral of the vector would be integral of the component and the integral the other component so just as a quick example here find the derivative of this so the derivative of t squared sine of T is just going to be the derivative of T squared the derivative of T squared between o is 2t T squared and then down here we'll have the derivative of sine of T which we know is cosine of T so we'll have the vector two T cosine T simple as that now integral the integral of this vector will be the integral of the vector T squared sine of T will be with respect to T will be the integral of T squared with respect to T and integral of sine of T with respect to T and of course the integral of T squared is 1/3 T cubed and the integral of sine of T is negative cosine of T so that's that's how we can perform calculus on vectors that's pretty much all the algebra we're going to be doing on vectors for now and that's why we call this a crash-course there's a lot of details of Rome inning but we really just care about having enough to be able to move forward with solving systems of differential equations so let's take a look at the geometric meaning of multiplying a matrix by a vector when we multiply a matrix by a vector we transform it and transform means just that if you physically change it in some way now in terms of how a vector can change and say two-dimensional space or even in three-dimensional space is it can get scaled so I can get stretched or I can get you know if that's my original vector and then you can get scaled but I could also get rotated so so maybe what happens to that vector when it gets multiplied by a matrix is it gets rotated and maybe scale so here we have matrix a and the matrix multiplication we defined above works here just we have a coefficient matrix and this vector just has numerical components instead of having symbols in it so what we want to do here is find a times X and plot both the new vector and the original vector so that being said let's go ahead and start our plot here since we already have one of the vectors and so here we'll just say that let's kind of scale this we'll say here's the 1 1 vector right there there's our original X and then now I'm going to perform the multiplication of a by X and see you in what way that's going to transform X so to do that I have to take 1 2 3 negative 1 and multiply it by the 1 vector so we know from our past experience that this vector and this vector are going to get scaled by this and this respectively and the results are going to added together so we'll have 1 times the 1 3 vector plus 1 times the 2 negative 1 vector and really I'm just adding a cross here because the scalars are 1 so 1 plus 2 and 3 minus 1 so you can see here that now this new vector is at the location 3 2 which we can see that both of those effects have taken place that we have both scaled and we have rotated the vector so 1 1 that has a length of the square root of 1 squared plus 1 squared which is the square root of 2 but this guy the square root of 9 plus 4 this guy has a length of the square root of 13 so that green vector is a little bit longer so we have a scale and a rotation now when you're other class we talked about different types of transformations and and how do you rotate a certain number of degrees or certain number of radians and how to get a matrix to scale your vector for you in a very specific way what we need to get in that into that here now there are special types of vectors that every matrix has so every square matrix n by n so we say square matrix we mean things like 2 by 2 3 by 3 4 by 4 where there's the same number of rows and columns every such matrix has a special set of vectors called eigenvectors and associated scaler is called eigenvalues so how do we know if a vector is an eigenvector well if when you multiply the matrix a by this special vector V if you only get a vector that a scale but not rotated that's that's the key here is if it doesn't get rotated but it only gets scaled that vector is called an eigenvector the value that is more that it is x is called the eigenvalue often call lambda so from from above what we what we did is we said take that vector multiply it by the matrix a if what you get on the output side is a scaled V without rotation then because we've already learned that when we scale a vector you're basically just going to stretch it or or potentially shrink it but we rotate it's change direction then that would be considered an eigenvector so an eigenvector of the matrix 2 4 4 2 is 1 1 and we want to show that it's an eigenvector and calculated eigenvalue so the question we have to ask ourselves is if we take a V do we get a scaled version of the original V so if we multiply a times V that's gonna be the 2 4 4 2 matrix times the 1 1 vector and that equals again we're going to multiply the 2 4 column and the 4 2 column by 1 and 1 and add them together so 1 times 2 4 plus 1 times 4 2 we add those together we get 6 now if you look at these two vectors in two-dimensional space one one is here and six six is out here it's they both have the same rights to run ratio and in fact if you factored out a six you could see that hey yeah that is just a scaled version of the original vector V there's the original vector V lambda therefore must be equal to six so we basically all we did when we multiply a by V as we noticed that we ended up with a longer vector so lambda equals six is the eigenvalue it sounds like a fancy name but all it is is just a scalar it's the scalar by which that vector gets multiplied when it's transformed okay let's do a couple more examples we're almost done here and let's let's show that negative 1 1 is also an eigen vector to that so again what we're going to do is we're going to multiply it and see if what comes out is just a scalar version of what went in so 2 4 or 2 multiplied by negative 1 1 so the negative one's gonna multiply the 2 for vector the positive 1 is going to multiply the 4 2 vector and when you add those together you're going to get negative 2 I'm sorry 2 which is negative 2 plus 4 and then negative 4 plus 2 is negative 2 and at first sight it looks like okay so it's still one of them is negative when I was positive and the components are the same if i factor out a negative 2 from this then I can see that that will leave me with a negative 1 1 vector behind so negative 2 times negative 1 is still 2 negative 2 times positive 1 is still negative 2 and we see that what came out is a scaled version of our original vector and so therefore I can say lambda equals negative 2 is also an eigenvalue one of the last things that o in and then not only vector is in the be an eigenvector so I didn't I just to show you that I didn't pick a a special matrix that just does this to every vector it multiplies if we took if we took this vector to one which is not really an eigenvector but I'll just go ahead and just check this out 2 4 4 2 times the 2 1 vector so once again the 2 is gonna scale the 2 4 vector add that to 1 times the 4 2 vector so 4 plus 4 is 8 and 8 plus 2 is 10 and you can see that these two vectors they don't lie along the same line in fact if I wanted to make this component a 2 you might say well I can factor out of 4 and that this component would be 2 and that's the only thing I could factor out to try to make it look like this original vector V but then if I divide out a 4 from 10 I get 2 and a half and that is clearly this is this right here is not equal to the original vector so we can also make this argument that if we were to plot these two vectors that we would observe they do not lie along the same line there's a rotation and a scale that took place so 2 1 is this vector here but 8/10 3 4 5 6 7 8 2 3 4 5 6 7 8 9 10 so 810 would be the specter up here and it's kind of hard to draw them to make them not look well they don't look parallel good ok so you can see that this is an eight ten vector and there was a rotation that took place and a scale effect oops well you get the idea here and this vector here to one so we didn't in fact just scale the vector so the vector to was scaled and rotated and by definition and eigenvector is one that only gets scaled now it turns out that these that eigenvectors are not unique that you can find more than one eigenvector so we earlier argued that one one was an eigenvector but we could have had tried to two or three three or four four or any vector where the x and y components are the same and let's just show that for any any nonzero real number C that C C will be an eigenvector of the two four four two matrix so if I multiply these together what I should see is okay I'll take C times 2 4 plus C times 4 - I will get 2 C + 4 C is 6 C + 4 C + 2 C is 6 C and already I could see that I could factor out a scalar of 6 therefore this is an eigen vector this is the lambda and that's the same as the vector that went in just scaled by a factor of 6 so lambda equals 6 is the eigenvalue any eigen vector the equals C C and we can make the same argument for negative C and positive see that that would also be an eigenvector but if we make you aware that there's there's more than one possible eigenvector the important part is that you should say all maintain the same ratio so 1 2 1 2 2 2 3 2 3 4 4 all have a ratio of 1 to 1 and we're going to wrap this lesson up with just saying that every square n by n matrix is going to have n eigenvalues and n vectors so that means a two by two if we had a two by two we would have two eigenvalues and two eigenvectors and we're not going to go through how we find these they would come down to solving the equation AV equals lambda V solving it for the lambdas and for the fees we're not gonna get into it it's not worthwhile and there's some concepts there that just will turn it into a process and it'll be hard to make sense of in a meaningful way without really digging into linear algebra so we just need to find out how to calculate them and we'll see how they end up applying in the next lesson so they are values that are vectors hidden in the matrix that give us important features of that matrix to find that we can use Wolfram Alpha and so we'll form a Lakers which you would enter in you do eigen values and you always check your input when it comes out but we use these curly brackets one to open and one to close the matrix and then another pair for each row so the first row is this is for the row 2 comma 4 that will give me the 2 and the 4 so those two values are those two values and this for 2 which is now notice a comma another pair of brackets 4 comma 2 close bracket that will give us the second row and then these two outer brackets open and close our matrix and lo and behold years and we get we get lambda 1 equals 6 that's the first eigen value the eigenvector that goes with that it's it's got a buddy and it's buddy is the vector 1 1 for the eigenvalue lambda 2 equals negative 2 the eigenvector is negative 1 1 and we showed this earlier but we can see the Wolfram Alpha will give us the same answer very nice so again we kind of pointed out that eigen values are unique will be the same across all software eigenvectors are not unique but it is the case that the ratio of Y to X across any given eigenvectors is the same from one instance of an eigenvector to another for instance if I say hey the eigenvector is 12.7 3:05 and you said well no my eigenvector is 0.34 three seven two and zero point nine three nine zero seven if you looked at the rise to run ratio in both instances it's still two point seven three zero five so it shouldn't be concerning if you're using something other than Wolfram Alpha you don't get exactly the same vectors then I do you can just say oh oh I got five five well five five has a one-to-one ratio just like one comma one does so that's it for this video in the next lesson once you get into how we solve differential equations with this stuff see you there