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.

Main content
Current time:0:00Total duration:14:26

Sum of squares of polynomial roots

Video transcript

in the last video we figure out how to figure out the sum of the roots of a polynomial what we're going to try to attempt to do in this video is think about the sum of the squares of the roots of a polynomial so let's think about that a little bit so let's say that I have a second degree polynomial that looks like this so it's x squared plus a 1 X plus a 2 and this is equal to 0 we saw in an octree I'll just redo some of what we did in the last video because it's going to be useful over here this thing is going to have two roots r1 and r2 two roots and that tells us that this thing can be rewritten as X minus r1 times X minus r2 is equal to zero and if you expand this out you get x squared minus r1 plus r2 r1 plus r2 x plus r1 r2 so that's what you get right over there now let's think about it we figured out from the last video that r1 plus r2 we figured out that r1 plus r2 which is right over here that needs to be equal to the negative of this coefficient this a 1 over here is equal to the negative of r1 plus r2 so r1 plus r2 is equal to the negative of a 1 is equal to the negative of a 1 so let's see if we can use that information right over there to figure out what to figure out let me do this in a new color to figure out what R 1 squared plus r2 squared is so let's see how we could get that well one place that we could start off with we could start off with r1 plus r2 squared so r1 plus r2 squared which is of course the same thing as negative a1 squared which would be the same thing as a1 squared a 1 squared I could put a negative here but a negative 1 times negative 1 is obviously a positive 1 this is going to be equal to r1 squared plus 2 r1 r2 plus r2 squared so this has the sum that we care about in it let's call this let me call this over here let's call this sum one we're just raising the roots to the first power let's call this over here let's call this some two so this over here we've written essentially that someone squared that sum S sub 1 squared is equal to this Plus this is S sub 2 is equal to s sub 2 plus 2 R 1 R 2 so plus plus 2 R 1 R 2 now can we figure out what R 1 R 2 is based on looking at the actual original polynomial well you look over here if you just did an expansion of course I forgot to write here that this is equal to 0 R 1 R 2 R 1 R 2 is in is essentially represented by a 2 over here it's represented so to take the first degree sum or the the roots raised to the first power something we looked at this coefficient now of a sudden we're involving the coefficient to the right of that we're going to degrees below the degree of the polynomial so this right over here is a 2 so R 1 R 2 is a 2 that's a 2 this right here this right here this whole expression is a 1 squared so if we want to solve for this sum if we want to solve for S sub 2 we would get S sub 2 is equal to a 1 squared a 1 squared that's this over here minus -2 times a sub 2 so we just figured out a fast way to figure out the sum of the squares of the roots of a just a second-degree quadratic right now so for example if I were to give you if I were to give you let me give you something strange so if I were to give you 7x squared minus pi X plus E is equal to 0 and someone said I want you to figure out the squares the sum of the squares of the roots of this polynomial first you want to make this the coefficient in front of the x squared 1 so divide everything by 7 so you get x squared minus PI over 7 x plus e over 7 is equal to 0 and then you can just use the result we just found thus the sum of the square of the root is this s2 over here whatever the roots are you square each of them you take their sum it's going to be equal to a 1 squared so it's going to be pi squared over 49 I'm just squaring this right over here or I can just square that the negative doesn't matter when I'm squaring minus 2 times this minus 2 times e over 7 and that's about as simplified as you can get this expression so it's PI squared over 49 minus 2 e over 7 which is by itself a pretty neat result because it would be very hard to find the roots of this you get some crazy numbers and then you'd have to square them and sum them but we just figured out a very fast way of doing it now let's see if we can extend this to the third degree in it actually turns out you can not only to the third degree you can extend this to the nth degree and I might do an induction proof it gets a little bit messier than when you just take the first degree sum right over here we take the sum of the roots to the first power but let's just see if it works for let's see if it works for the third power so let's say I have the polynomial X to the third plus a1 x squared plus a 2 X plus a 3 is equal to zero we have three roots r1 r2 r3 which tells us that we can rewrite this polynomial as X minus or this equation is X minus r1 times X minus r2 times X minus X minus r3 is equal to 0 now we already figured out we already figured out what this part right here is it's this thing over here we already multiplied it out it's this thing it is this over here so essentially to get this whole expression we just have to multiply this times this thing over here so we're essentially just use the distributive property multiply this thing times each of these terms so first let's multiply this whole thing by X so you get X to the third X to the third minus r1 plus r2 times x squared plus r1 r2x so I just multiplied this thing over here times X now I can just multiply this thing up here times negative R 3 so negative R 3 times x squared so it's negative R 3 x squared negative R 3 times this term over here gives us it will give us what's going to be a negative times a negative so it's going to be a positive so it's positive R three times this we can distribute them we're going to get R 1 R 1 so let me make sure I'm doing negative R 3 times this over here is going to be negative let me just write it like this negative I don't want to skip steps Oneg going to be the negative and the negative cancel out so negative r 3 times R 1 plus R 2 X and then finally you have the negative R 3 times R 1 R 2 so minus R 1 R 2 R 3 and all that's going to be equal to 0 but let's simplify it so this thing is going to be equal to X to the third minus R 1 plus R 2 plus R 3 we did that in the last video that shows us that the sum of our roots is this second coefficient here the coefficient on the second degree term x squared and then we go over here we have R 1 R 2 X so plus R 1 R 2 X then you have R 1 R 3 x plus R 1 R 3 I'm just distributing this and then you have R 3 times R 2 so plus R 2 R 3 all of that times X and then minus R 1 R 2 and R 3 now if we want to take the sum of the squares of the roots so if we want to take R 1 squared plus R 2 squared plus R 3 squared well we could try to do the same thing we could take R 1 plus R 2 plus R 3 which we know how to calculate we can square that and we're essentially going to get when you when you square this you're going to get let me see if I can write it neatly this is going to be equal to the R 1 times so I'm just going to let me just read this is equal to just to clarify this is equal to R 1 plus R 2 plus R 3 times R 1 plus R 2 plus R 3 so it's going to be I can start over here R 1 times R 1 is R 1 squared plus R 1 times R 2 so R 1 R 2 plus R 1 times R 3 R 1 times R 3 and then plus now we're in the R 2 R 2 times R 1 is plus R 1 R 2 same thing I'm just switching the order so it looks the same R 2 times R 2 is R 2 squared and then r2 times r3 is plus R 2 R 3 and then let's go to the R 3 R 3 times R 1 is just another R 3 R 1 I just switch the order R 3 times R 2 is another R 2 R 3 and then R 3 times R 3 is R 3 squared so what do we just get here when we squared just the straight up some you got you got R 1 squared plus r2 squared plus R 3 squared plus u Sencha Li got all of the different combinations but you got them twice you have 2 r 1 r 2 so you have 2 times R 1 R 2 R 1 R 2 then you have 2 R 1 s r3 so plus r1 r3 you have the 2 out front plus R 2 R 3 R 2 R 3 and this over here is equal to remember what we did this is equal to R 1 plus R 2 plus R 3 squared so we got essentially the same result remember this thing right over here let's make things clear this thing over here R 1 R all the combinations of the products of the roots if you look over here that's exactly what this thing is over here which must be what our a 2 coefficient is so this is our a 2 coefficient this R 1 plus R 2 plus R 3 that is we figured out multiple times that's this thing right over here which is going to be a 1 so this is going to be a negative or it's equal to negative a 1 but you take negative a1 squared that's the same thing is a one squared so this is a one squared and this is the sum that we care about this is the sum that we care about so we get we get r1 squared + r2 squared plus r3 squared is equal to this business over here it's equal to a 1 squared minus 2 minus 2 times a 2 so we got the exact same result we got the exact same result that we got for the second-degree case and it actually turns out this will be true of any degree I haven't proven to yes although I can make an induction argument now we've proven some base cases but just to make it clear how to apply it I give you crazy polynomial I gave you let's do a third-degree case let's let's say 10 X to the third minus 5 x squared plus 7x I'm making this up on the fly plus 2 plus 2 is equal to 0 and if I were to ask you the sum if I were to ask you are one squared plus r2 squared plus r3 squared if I were to ask you the square of the sum of the roots you just take the firt you just take well let me be careful you have to make sure that you have a 1 in front of the highest degree term so this thing over here has to be rewritten divide both sides by 10 X to the third minus 5 over 10 so minus 1/2 x squared plus 7 over 10 X plus 2 over 10 which is 1/5 is equal to 0 so I just divided both sides by 10 and yep I did that part right and now we can apply this as I almost made a careless mistake you have to have a 1 coefficient out here at least the way that we've derived this so this sum is going to be equal to it's going to be equal to a 1 squared so this you could 1/2 squared so a 1 is what a 1 is actually negative 1/2 but negative 1/2 squared is just 1/4 so it is going to be 1/4 minus minus 2 times a 2 minus 2 times a 2 so minus 2 times 7 over 10 so this is equal to 1/4 1/4 minus minus 14 over 10 minus 14 over 10 we could find a common denominator this is the same thing as 5 5 over 25 over 20 minus 14 over 10 and this is equal or sorry minus 28 over 20 I should do minus 28 over 20 which is equal to negative 23 over 20 and you might say hey Sal hang on I'm taking the square of a bunch of roots and adding them up and I'm getting a negative number I thought squares I thought when I square numbers I always get a positive number that would be true if you're dealing with real numbers but remember the roots of a polynomial can be complex and complex numbers squared can be negative numbers so this obviously is involving some type of complex roots but we know that the sum when you take the sum of the squares of those complex roots you get negative 23 over 20