| ID | 8fe1b088-409b-49a4-bd28-3d44ac3f6b1f |
|---|---|
| DeertopiaVisibility | public |
Completing the square
"Completing the square" refers to an intuitive geometric approach to solving a quadratic. The famous quadratic formula is derived from this method. The equation is rewritten into an expression of form , and the roots are found by solving for using plain ol' algebra. The quadratic formula is simply the result of completing the square (as an expression, it is known as vector form) solved for .
TL;DR
Given a quadratic equation , this will be .
Derivation
The method of completing the square is best understood graphically. We will begin with an input polynomial of form . Then, taking advantage of a geometric analogue, we will rewrite the equation into a form solvable with basic algebraic manipulations alone.
Fun fact, I'd initially taken a bunch of graphical, pretty notes where I derive the method by hand! Accidentally overwrote the file. Nice! They were fucking great notes, too. Illustrations and all. What follows is a second write-up from scratch. }:(
We start things off by rewriting our equation such that sits on the right-hand side of the equals sign:
If we wish to adapt this equation into something solvable with algebra, we must first speak a bit of geometry. Observe the correspondence between rectangles and products: any product of two real numbers and is, from a geometric perspective, a rectangle of area and side lengths and . Within this metaphor, the distribution of multiplication over addition fades to reveal a geometric analogue to the distributive law: juxtaposition of similarly-sided rectangles.
The geometric metaphor we've described is applied to our equation as so: firstly, the terms and are translated to rectangles:
Remember that the goal here is to get rid of the term while leaving an that we can solve for. This is accomplished in two steps: first, we geometrically rearrange the left-hand side into a square, making way for us to take the square root of both sides, finally allowing us to solve for in terms of . This rearrangement relies upon the similar side (shared factor) of the blue and red terms, and applies the aforementioned distributive law:
The second step to squarehood is to split the red term in half, and glue it to an adjacent side of the blue term, as in
This transformation is sane because the expression's area — its value — is preserved.
Our figure finally resemble a square, ignoring the little missing "chunk" in the corner; however, this much is sufficient for our purposes! we can simply identify the total area of the blue and red portions as minus the area of the corner chunk, denoted in dashed green (dashed lines because it is not counted in the total value of the expression).
We are finally ready to move back to algebra. To recap, the entire preceding process, in algebra, has been
Now we solve:
If and are known, this is a trivial solve from here. Otherwise, we can proceed to rearrange this equation into a simplified version of the the quadratic formula that does not account for any leading coefficient:
(We neglected the leading coefficient for simplicity's sake).