 In the previous lecture, we looked at equations and we solved for x. Now that we have those building blocks, let's concentrate on quadratic equations. We're even going to develop a formula which we can use to solve all quadratic equations. So quadratic equations. So I'll put inverted commas solving for x. Eventually we're going to do some, let's call it proper algebra, we're going to solve for x. Let's remind ourselves of what a quadratic equation is. So let's do things a little bit different. Let's start with our little marker there. Let's say this is a definition for quadratic equations. So a quadratic equation, you will remember that is just a second-order polynomial. So in previous lectures, we would have written a sub 2 x to the power 2 plus a sub 1 times x to the power 1 plus a sub 0 x to the power 0, which is just 1 equals 0. It's an equation left hand side, right hand side. Now here we're just going to change, we won't use a sub 2, a sub 1, and a sub 0, we'll just say ax squared plus bx plus c equals 0. That's just something that we use more commonly when we talk about second order. We just have to have here that say a sub 2 is not equal to 0, or here a is not equal to 0. We can't have the leading coefficient 0, otherwise that term falls away and then we have a first-degree polynomial. And do notice here that I'm just replacing these constants, so it's a the coefficients, a sub 2 is equal to a, a sub 1 is equal to b, a sub 0 is equal to c. I'm just using different symbols rewriting it here. We also note that a and b and c, they are all members of the real numbers. So let's talk about solutions. Solutions, I'm going to say for the unknown, that looks horrible, solutions for the unknown x. Another way to talk about this is the roots. So when the right hand side is 0, what values of x would be 0 on the left hand side? Those would be the roots of our equation. Now later on we'll see that these roots, they can be elements or members of the real numbers, but they can also be, roots can also be elements of the complex numbers. Now that's quite interesting, but for most part we're going to stick to the real numbers. Let's have a little example. So let's have something like x squared, let's have plus 5x plus 6 equals 0. Now we know this has to be two of these factors, and there's a leading coefficient one there, so we'll have an x in the next such that we get x squared. Now we have to think of two integers that if we multiply them we get to 6, and somehow combine the two of them with addition and subtraction so that we get to 5. Now I think what would work for us here is positive 3 and positive 2. The more of these that you do, the easier this becomes. So x times x is x squared, and then 3 times 2 is 6, so I do have those, but I also have 2x, and I also have here 3x. So 2x plus 3x gives me the 5x. Now we have to make use of something called the zero product property, so let's put a little green marker there, because that is something else I want for you to remember. We call this the zero product or zero multiplication property, and that says the following. If I have two numbers, say p and q, and I multiply them and I get 0, then either we have to have that p equals 0 or q equals 0. If I have 3 times 0, that's 0, or 0 times 3 is 0. One of the two must be 0 if I multiply two numbers to be 0, and look at this. If I plug in a value for x, I'll have one number here, I'll have another number there. So one of the two of them better be 0, so if I multiply this by this, that I do get 0. There's no other way to do that. And so we're going to have that x plus 3 is equal to 0, this term equal to 0, or this fact equal to 0, or x plus 2 is equal to 0. One of these two must sum to 0 for me to have 0 times something or something times 0. And so here we're just going to subtract 3 from both sides, so 0 minus 3. So I've just subtracted 3 from both sides, and positive 3, negative 3, that's just x plus 0, and that's just x. And on this side we're going to have our negative 3, so we have x equals negative 3. On this side we have x plus 2, I'm just going to subtract 2 from this side, and I'm going to subtract 2 from the right-hand side, so nothing changes. And again plus 2, negative 2 is to 0, so I'll just keep a step and just leave that x on its own on the left-hand side, and negative 2 on the right-hand side. And that is fantastic. Now what can we do? Well, what we can do is to verify the solution. And it's lovely that we can verify these solutions, and we do that by substitution, because I can plug in these values for x right there in my original equation. It's an equation, I've got a left-hand side equal to right-hand side, and if this left-hand side is equal to 0, then I have 0 equals 0, which is exactly a nice verification of my results. So let's start with the first one. x equals negative 3. Let's start with that. x equals negative 3. So there's my equation. Instead of x, I'm substituting negative 3, so there'll be a negative 3 squared plus 5 times, instead of x, I have negative 3 plus 6 equals 0. Negative 3 times negative 3 is 9, 5 times negative 3 is negative 15, and I have positive 6, and that equals 0, and indeed 9 plus 6 is 15. Minus 15 is 0 equals 0. Absolutely, I verified that that solution is correct. Let's do x equals negative 2. Let's substitute that in. So I'm going to have negative 2 squared plus 5 times negative 2 plus 6 equals 0. Negative 2 times negative 2 is 4. 5 times negative 2 is negative 10, plus that 6 equals 0, and 4 plus 6 is 10, minus 10, 0 equals 0. This solution is correct as well. Let's do another example. Let's have 4x squared. Let's do plus 5x minus 6 equals 0. It's a quadratic equation. I'm going to have 2 factors equal to 0. Now I've got a leading 4, so I've got to multiply two integers to get 4. I've got to multiply two integers to get negative 6. How can I use that to get to 5? The more of these you do, the better. What if I think about 8 and 3, because with an 8 and with a 3 I can get 5. 8 minus 3 is 5. How can I get 8? Well, what if I make this a 4x and an x? What if I do positive 2 and a negative 3? How about that? 4x times x is 4x squared, and now look at this. I have positive 8x, negative 3x, that gives me my 5x, and negative 3 and positive 2 gives me the negative 6. Isn't that great? Now I'm going to make use of the zero product property again. So 4x minus 3 equals 0, or x plus 2 equals 0. One of these two must be 0, because I have, if I plug in a value for x, this is going to be a single number. If I plug in a value for x, this is going to be a single number. So that would be like p times q. One of the two of them has got to be 0. If I multiply anything by 0, I get 0. Both of them can be 0. That's fine as well. So let's do the following. I've got 4x, negative 3. I'm going to add 3 to both sides, 0 plus 3. Negative 3 plus positive 3, that's the 0, so I'm left with 4x on this side. On this side, I am left with 3. Now what do I do? Well, I can multiply both sides by a quarter. 1 over 4 multiplied 1 over 4. Remember, that's over 1. That's over 1. And now I have 1 times 4 and 4 times 1. This is 4 over 4, which is just 1. Otherwise, we say we cancel these two 4s, 1, 4 in the numerator, 1, denominator. And I'm just left with x. And on this side, I'm left with 3 over 4. What about this side? Well, I've got x plus 2. Let's subtract 2 from both sides. Here's my negative 2. My negative 2, I have not changed anything. That just gives me 0. So I have x on the left-hand side equals negative 2. So I've got these two solutions. Let's verify. You can always get 100% for these kind of problems in an exam because you can verify your solution. Let's start with x equals 3 over 4, 3 quarters. Let's do that. There's a 4. I'm going to put it over 1 and then multiply by, instead of x, I'm putting 3 over 4 squared plus, let's put 5 over 1. And instead of x, I'm putting 3 over 4 minus, let's put 6 over 1 equals 0. Now let's rewrite this one. This is going to be 4 times 3 in the numerator. Let's get the trusty n-video ruler. And in the denominator, I've got 4 times 4. 4 times 4. 16. I could have done it on its own. Now remember there's another 3 there. See how easy it is to forget things. There's my 4 over 1 and then 2 3s and then 2 4s. So I could also put a 1 and a dot. So 1 times 4 times 4. Plus, 5 times 3 is 15 in the numerator. 1 times 4 is 4 in the denominator. Minus 6 over 1 equals 0. So now look at this. That 4 and that 4 can cancel each other out because that would just be 4 divided by 4. That's just 1. And I have multiplication here. There's no addition subtraction. This is one single term. So I can do this cancellation. So 3 times 3 is 9 over 4 plus 15 over 4. Now I can add these two because the denominator is the same. But look at the 6. The denominator is 1. So now I have a problem. But let's do it on the side. I've got negative 6 over 1. How can I get this denominator to be 4? Well, let's just take this and multiply it by 1. Anything multiplied by 1 is just 1. I don't have to worry about doing something to the right-hand side because I haven't changed nothing. I'm just going to rewrite this. And instead of 1, I'm writing this as 4 over 4. That's just still 1. And that is negative 24 over 4. And 24 divided by 4 is indeed 6. So I have changed nothing. So minus 24 over 4. That's great. Equals 0. And now I've got 4 in the denominator. I can just have a common denominator now. They're all the same. Meaning I can do this. 9 plus 15 is 24 minus 24. Well, that's the 0. 0 over 4 is 0. 0 divided by 4 is 0. 0 equals 0. I have verified that this solution is indeed correct. Now let's check on the other one. Let's check on the other root. So these two solutions, remember another word for them are the roots of this equation. So let's check x equals negative 2. Let's do that substitution. So I've got 4 times negative 2 squared plus 5 times negative 2 minus 6 equals 0. Negative 2 times negative 2 is 4. 4 times 4 is 16. 5 times negative 2 is negative 10. And another negative 6 equals 0. Negative 6, negative 10, negative 6 is negative 16 plus 16. Well, that's the 0 equals 0. And indeed the solution is correct as well. Now wasn't that just a little bit of fun? Now I really want you to do as many of those as is possible. But we don't have time to do thousands of them in a lecture like this. So the next thing I want to talk to you about is completing the square. And I'm going to put a little arrow there. So that's going to be a definition for us, completing the square. So now we're going to get to more complicated quadratics that are not so easy to solve that we can have our two factors and something very simple such as this. What about if it's more complicated than that? Now I want you to think of the following situation. What if we have x squared plus bx? Now we're going to do a little bit of drawing and this is quite a bit of fun. How do I talk about x squared and bx? Now let's add these two things together. And we're going to use a little drawing. So there we go. Imagine I have this square and the side. So you've got to imagine that's a square that I have the sides x and x. So that would be x squared. Don't you think the area of that would be x squared? And let's have another little shape there. So that is also x, but let's make this b. So surely that should be bx. So that's x squared for an area and that's b times x. So I'm looking at x squared plus bx as two of these little shapes. Now if I combine these two, that was a square. So please imagine that these sides are all equaling. That's a square. If I add this, it's no longer a square. If I put them together, I no longer have a square. What if I still want a square though? What would I do? Now look at this. Just follow along. So imagine here I still have my x squared. So I still have that this is x and this is x. But let's do the following. Let's chop this into a half. If I chop that into a half, let's have them here. I'm trying my best to draw here. Now it's in half. And what if I lay another half out here? So now I've split that into two and I've laid them down here. Now this side and that side, those are both b over two and this side is b over two. That side is still x. I've just cut it in half. So that was b. Now this is a half b and that's a half b. And what is left here? Well if I want to complete the square, I have to add another little square there. And look at this square. That's b over two for this side and b over two for this side. And now look at this. If I combine those four together, I have completed the square. Now I have a proper square again because this side there's an x and a b over two. So that would be that length. And here we have an x and a b over two. So the both sides would be equal and I have completed the square. But let's think about what we have here. We have an x squared. Definitely we have an x squared. Now we still have a bx because there is the half of that bx. There's the other half of that bx. I combine them. I still have my bx. And what do I have here? I have b over two squared. There's the two sides, b over two squared. And now if I add all of them, I have a new square. And that's what we call completing the square. Now hopefully you followed along with my little attempt at a drawing. So let's do an example where this becomes absolutely necessary for us to solve this quadratic. I've got x squared plus bx plus c is equal to zero. So in our example I'm going to have for this I'm going to have x squared plus let's make it 6x plus 7. Now you're going to struggle if you want to find integer values with a 7 and a 6 such that with a 1 and a 7 such that you get 6. That's going to be very difficult. So let's complete the square. So I'm going to have x squared plus 6x. Now look at this. There's my b. My b. So b is 6 in this instance. It's 6. And what do I want for completing the square? Well I want to take b which is 6 and I want to divide it by 2 and I want to square that. So there's my b divided by 2 and I want to square that. But because I've added it I've also got a subtracted. Or at the very least let's add it to the other side. So that was my original problem. I've got to have my plus 7 there. So let's just do everything in one step. Let's bring that 7 over to the side. So I'm subtracting 7 from both sides. I'm going to have a negative 7 on the side. But I've added this to the left hand side so I better add that to the right hand side as well. Hopefully you followed along. I've just skipped a step. And I don't like doing that so let's do that right here. I've got x squared plus 6x plus 7. I'm subtracting 7 from this side and I'm subtracting 7 from this side. That's how I got the negative 7 on this side and the 7 has disappeared from this side. But because I've completed the square on this side I have to add that to that side as well. Plus 6 over 2 squared plus 6 over 2 squared. I still have my equation. I haven't changed anything. But now we have something very special. Look at this x squared plus 6x plus 6 over 2 which is this 3 squared. Now isn't that something special? Let's just rewrite it just to make it clear. x squared plus 6x, 6 divided by 2 is 3. So I've got plus 3 squared equals and here I've got negative 7 plus 6 times 2 is 36 divided by 4. Now we can simplify that a little bit. We'll do that shortly. But what I want to do is concentrate on this left hand side. This is now what we call a perfect square. Look at this x plus 3x plus 3. Look at that. x times x is x squared. 3 times 3 is 9. There's 9. 3x plus 3x, 6x. So what I have here is x plus 3 squared on the left hand side and that is why we want to complete the square so that we can get to this step. Having x plus something squared. So instead of being able not to work with that, I'm only going to work with this section here. Let's do that. That section there. I'm completing the square such that I can get to this step. That's a very good step to get. Let's do the right hand side. I want to take the negative 7 over 1 and I want 4 in the denominator. So I'm just going to multiply it by 1. So I'm not changing anything there plus 36 over 4. So here we're going to have on this side we have 4 in our denominator and in the numerator we're going to have negative 28 plus 36. Negative 28 plus 36. On this side I still have x plus 3 squared and on the right hand side let's just add that here. Negative 28 plus 36 is 8 over 4 and 8 over 4 is just 2. Now look at this equation versus the problem that we started with. It's much simpler. Why is it simpler? Because what I can now do is take the square root of both sides. I'm going to take the square root of both sides. Now remember if I have x plus 3 and I square that what I'm doing with the square root is I'm doing this to the power a half and 2 times a half is 1. So on this side I just have left x plus 3 and on this side I must remember that it must be positive or negative square root of 2 because if this was a negative out front if I square that I would get the positive side of that. So I've got to have x plus 3 and on this side I've got to have the positive negative 2. I'm taking the square root so I must get positive negative. Now I'm just going to subtract 3 from both sides and so I've got negative 3 plus or minus square root of 2. Now I've just done the negative 3 on this side negative 3 on this side positive 3 negative 3 is 0 so it's just the x on this side and here I've got negative 3 plus or minus square root of 2. So I've got two solutions x equals negative 3 plus square root of 2 or x equals negative 3 minus the square root of 2 and isn't that an absolute thing of beauty? That is absolutely beautiful and there is no way that you would have been able to find these values to plug them in there to get a solution straight from there. Completing the square would be your only solution and what I want to leave for you as a task is to plug this value into x plug this value into x into x and you'll see you get 0 on the left hand side, 0 on the right hand side and both of these solutions are absolutely correct. Do that for me as an exercise. And so now that we've seen completing the square and I want you to do more of those examples we're going to do the quadratic formula and this really is a thing of beauty. We're going to make use of the completing the square and that's going to help us deliver or create a formula, derive a formula that will help us solve all quadratic equations. Every quadratic equation doesn't matter how difficult it gets so let's do that derivation. I'm going to start with ax squared plus bx plus c equals 0. Now you can follow along with this but you certainly need to know this derivation for you in order just to use the final solution in your solving of your quadratic equations but go with me on this one it's quite a bit of fun. So I'm going to have ax squared plus bx now I've got positive c here I'm just going to have negative c on this side negative c on this side which means I'm just going to skip a step by now I'm sure you'll allow me to skip these steps I'm just taking the c bringing it over to the other side which means I've got a negative and why well forgive me let's do this positive c I'm going to subtract c from this side and I'm going to subtract c from this side so on this side all my c's disappear and on the right hand side I now have a c so I think you can see that now what I need to do is to get rid of this coefficient because what if it's not one what if it's two or three and so how can I get rid of this well I can multiply both sides by one over a so I'm going to multiply this side by one over a and I'm going to multiply that side by one over a I've changed nothing and so if I multiply I have got to do distribution so one over a one over a times ax squared over one plus I've got one over a and I've got bx over one and on the left hand side I'm going to have negative c over a great so these two a's can cancel so I'm left with x squared on it so now it has a coefficient of one and that's great that's what I need for completing the square on this side I'm going to have b divided by ax so there's bx bx divided by a I'm just writing it in a different way and on this side I'm going to have negative c over a so can I now complete the square yes because look at this this is just what we have before x squared plus bx now it's a bit more complicated I've x squared over ba that is still in essence my b so I have this and what I want to do is to divide it by two and then to square it that is how we complete the square we take whatever value is the coefficient of this x to the power one this thing and we divide it by two and another way to write this would be b over two a squared so make sure you can see why I'm writing it like this b over a divided by two is b over two a those two things are exactly the same so let's complete the square I've got x squared plus b over ax and I'm going to complete the square by adding b over two a squared and that equals negative c over a and I'm adding it to the side as well b over two a squared great stuff what do I have I have a b of a b over two a this is a absolutely beautiful complete square so I can write x plus b over two a squared if you write this term twice and you do your distribution you're going to end up right there and that's exactly what we want now on this side we've got to do a bit of work so I've got a negative c over a plus let's do this it's b squared over two a squared is four a squared so I can't do this addition because I've got an a in the denominator and a four a squared on that side so let's do a little bit of work on the side and this is something you really have to get used to in algebra doing work on the side so I've got a four a squared here b squared over four a squared plus how do I change this into a four a squared well I can take this negative c over a and I can multiply it by four a over four a so this is just one so I'm taking this in a value and I'm multiplying it by one so nothing changes and now look at this I'm going to have negative four ac in the numerator numerator negative four ac over a times four times a is four a squared plus b squared over four a squared now I've got four a squared look at that as a common as a common denominator on this side I still have x plus b over two a squared and that's just such a lovely way to go from there by completing the square such that I can write it like this isn't that beautiful so let's have x plus b over two a and I've got that squared equals let's just rewrite this with a common denominator come here you trust the n video ruler there we go I've got four a squared as my common denominator so I'm just going to rewrite this in a different order let's have b squared minus four ac now what can we do well we can get rid of the square by taking the square root of this side and I've also got to take the square root of this side I just have to remember that on one of the sides it's plus or minus and so I've gotten rid of the square root this side would just be x plus b over two a and on the right hand side I can do the following look at this I can rewrite this as b squared minus four ac now you've got to think back at these rules that we discussed many lectures ago divided by the square root of four a squared I am allowed to rewrite this as two square roots and what happens here look at this denominator let's do some side work here it's two times two times a times a and so what do we have here well we have two squared to the power a half times a square to the power a half and what is this left here two times a half two times a half that's one one I'm left with two a so here we are left with the square root of b squared minus four ac divide by and you can just see it from there four a squared the square root of all of that has got to be two a so I'm going to have a two a there I just have to remember that I still have to have my plus minus somewhere just to remember that I am taking the square root so I have to somewhere have this plus or minus because remember if we take the square root of nine that is going to equal positive or negative three great and now all I want to do is isolate x on this side so I'm going to subtract b over two a from both sides I'm going to do that in one step so I get rid of the b over two a on this side now I have a negative b over two a on this side plus or minus the square root of b squared minus four ac all divided here over two a and look at this I've got the same denominator so I can rewrite this as the following x equals minus b plus or minus the square root of b squared minus four ac let's close our square root there all over two a and look at what we have look at what we have I'm I'm definitely going to put a green marker there because this is so beautiful and I want you to remember this this is the quadratic formula if I give you any problem ax squared plus bx plus c a will be a specific value b will be a specific value c will be a specific value you plug them in there's b there's b there's a there's c there's a you plug them in there's there's a positive and a negative so let's be clear about this we're going to have x equals minus b plus the square root of b squared minus four ac over two a let's just put our lines in or we're going to have x equals minus b minus the square root of b squared minus four ac divided by two a so I'm going to get two solutions for x now with this quadratic formula I can solve any example problem that you give me isn't this a thing of beauty as I say you can enjoy this see if you can do it on your own but this is where you need to get I can now solve for any quadratic formula so let's do an example using that quadratic formula let's do two x squared let's do two x squared plus eight x plus seven equals zero let's do that it's going to be very difficult for you to write this out as some factors of x and you have a leading coefficient there so that's going to be a problem but look at this a equals two b equals eight and c equals seven so let's use that quadratic formula and I'm going to write it out here let's do two separate ones we're going to have x equals minus b plus the square root of b squared minus four ac whereas my ruler there we go over two a and we're going to have or x equals minus b minus the square root of b squared minus four ac c divided by two a and so let's just plug in let's just substitute negative b so that'd be negative eight negative eight plus the square root of b squared that'll be eight squared minus four times a is two times c is seven so there we go divided by divided by two times a is two times two or on this side we're going to have x equals negative b that's still negative eight minus the square root of eight squared minus four times two times seven and that is all going to be over two times two two times two isn't that beautiful x equals negative eight plus the square root of eight times eight is 64 and now four times two is eight eight times seven is 56 so minus 56 divided by we have two times two is four and on this side we have or x equals negative eight minus the square root now we can do this this is exact same as that so 64 we've taken 64 minus 56 well that's just eight and we're going to divide that by four now we just have to simplify a couple of things let's think about what happens to the square root of eight the square root of eight is two times two times two so there's two of those so that will be just two I can bring two out square root of two why because I've got two squared there and I'm doing that to the half there is another two there to the half and that cancels out so I'm just left with a two so I can bring one of those twos out as a single value and the square root of eight equals two square root of two so x equals negative eight plus square root of two so let's put the other two in there over four or x equals negative eight minus two square root of two divided by four and you can leave it there but we can simplify just a little bit and so let's do this x equals now you can do this all in one step and I really want you to understand that you can do this in one step I've got something plus something divided by four and I've got this common denominator so on this one let's just do this step by step this will be the same as negative eight over four plus two square root of two over four remember that's the same denominator I can rewrite it in this sense I'm just breaking that apart and so here I'm going to have negative two eight divided by four that's negative two and two divided by four that's a half plus one half square root of two