# Solving and factorizing quadratic equations for Math AA SL IB
## Context
This note is for explaining and preparing my teacher notes in
* Factorizing
* Completing the square
The base elements that I've used are
https://www.youtube.com/watch?v=wwCrL1X0gl0
{%youtube wwCrL1X0gl0%}
https://www.youtube.com/watch?v=QtkPzG_Sp9s
{%youtube QtkPzG_Sp9s%}
and the textbook.
## Factorizing
Why do we factor?
We usually want to pass from the general form of an quadratic ($ax^2+bx+c=0$) to a factorized ($(x-p)(x-q)=0$)version to find the solutions (if they exist) of the quadratic, or (what is the same) the intersections in the x axis of the function.
There are several ways to do it. I'm going to show you the most general ones and then the more particular ones.
### The previous you already know version
1) Use the general solutions of the quadratic equation.
$$x = {-b \pm \sqrt{b^2-4ac} \over 2a}$$
2) Write the solutions ($x_1=p, \ x_2=q$) as a factorized version ($(x-p)(x-q)=0$)
#### Example
$$x^2-2x-8=0$$
Applying the formula: $a=1 \ b=-2 \ c=-8$
$$x = {-b \pm \sqrt{b^2-4ac} \over 2a}= {-(-2) \pm \sqrt{(-2)^2-4·1·(-8)} \over 2·1} = {2 \pm \sqrt{4+32} \over 2} = {6 \pm \sqrt{36} \over 2} $$
So we have 2 possible solutions:
$$x_1= {2 + \sqrt{36} \over 2} ={2 +6 \over 2} = 4$$
$$x_2= {2 - \sqrt{36} \over 2} ={2 -6 \over 2} = -2$$
With this 2 solutions we can write it in general form like this
$$(x-4)(x+2)=0$$
:warning: Remember that this version is x - the solution. That's why we write $(x+2)$ :warning:
With this we have a handy version to know where the expression if written as a function is equal to 0.

:::info
:information_source:
If you use a plot system like a GDC or desmos.com it doesn't matter the way you write the function is going to be plot equally
:::
:::danger
The problem of this solution is that even if it's appliable to all possible cases, sometimes takes more time to be calculated and the space for error, unless you have trained long enough is high
:::
### Factorizing with common factor
* Pros: very fast
+ Cons: the conditions to use it are narrow
#### Conditions to be applied
In the general form, $c = 0$
#### Procedure
We take the common factor of x and then each factor we equal it to 0.
#### Example
$$x^2+40x=0$$
We take common factor
$$x(x+40)=0$$
**This is already the factorized version**. If we want to find the solutions, we write each factor as equal to zero (because if something multiplied by something is equal to zero one of those somethings has to be zero)
$$x_1=0$$
$$x_2+40=0; \ x_2= -40$$
#### A bit complex example
Sometimes here there can be numbers that are also multiplying more. Look at this:
$$5x^2+40x=0$$
If we take common factor just for the x we're going to have:
$$x(5x+40)=0$$
In this cases we usually try to leave that number that multiplies the x in the parenthesis ($5$) out of that parenthesis. To do that we need to divide $40$ over $5$
$$5x(x+8)=0$$
Since we know that $5$ is _never_ going to be zero, either $x$ or $(x+8)$ has to be equal to zero. Then we can take it out from the equation
$$x(x+8)=0$$
And we can write the solutions ($x_1=0;\ x_2=-8$)
:::info
You can also deduce that $(5x+40)=0$ and find that it's the same as writing $(x+8)=0$
:::
### Difference of quadratics
* Pros: very fast
+ Cons: the conditions to use it are narrow
#### Conditions to be applied
It's something squared minus something squared, but to be precise:
In the general form, $a=1$, $b=0$ and $c$ is the negative version of a [perfect square](https://www.cuemath.com/algebra/perfect-squares/).
#### Procedure
Here we only need to take the square root of the positive version of c. Both solutions will be our roots.
The factorized version will be expressed as
$$(x+\sqrt{c})(x-\sqrt{c})=0$$
Let's do the example
#### Example
$$x^2 - 49=0$$
If we do the short version the factorized solution will be:
$$(x+7)(x-7)=0$$
Also we conclude that $x_1=-7$ and $x_2=7$
To explain it better let's do the long version (that it's not that long)
$$x^2 - 49=0;$$$$x^2= 49$$
If we take square roots of both terms of the equation:
$$\sqrt{x^2}= \sqrt{49}$$ $$x=\sqrt{49}$$
And the possible solutions of this is $x_1= 7$ and $x_2=-7$
### Perfect squares
* Pros: Faster than light!
+ Cons: conditions are a bit narrow and, from my experience is a bit difficult to see if you're not used to the expansions of $(x-a)^2$
#### Conditions to be applied
In the general form, $a=1$, $c$ is a perfect square (positive) and $b = 2\sqrt{c}$ (positive or negative!)
What we mean by this is that this is an expanded form of $(x+p)^2$ or $(x-p)^2$. If you remember that because you have already the tattoo that I suggested you to have you would remember it!

_Don't tattoo yourself something that you don't like it. I'm using this as a joke, because people usually tatto themselves stuff that they want to remember_
:::warning
:warning: Remember that in the formula booklet you don't have this formula that I recommend to tattoo, so you need to internalize it. Unless you want to use the general binomial theorem formula (not recommended):warning:
:::
So if you have $(x+5)^2=0$ this would be the same, if you expand it as write $x^2+10x+25=0$. And if we have $(x-5)^2=0$ this would be the same, if you expand it as write $x^2-10x+25=0$.
#### Procedure
The roots are both the same. We need to use $b$ instead of $c$. The factorized version would be
$$(x+({b\over2}))^2=0$$
So the solutions would be only one: $x_1=-{b\over2}$
#### Example
$$x^2+14x+49=0$$
We recognize that 49 is a perfect square and the root is 7. 14 is twice that number so we can apply all this stuff.
The square that we need to do is
$$(x+7)^2=0$$
And the solution will be $x=-7$
### Factorizing by hand (a = 1)
* Pros: sometimes is faster than general way. We don't have to deal with square roots.
+ Cons: if the roots are not integers we have a problem
#### Conditions to be applied
In the general form, $a=1$. That's it!
#### Procedure
We write $a$, $b$ and $c$
We write the value of $a·c$ and the value of $b$
We find (by guessing) a couple of numbers that if we multiply them we get $a·c$ and if we add them we get $b$
Those are our solutions.
#### Example
Here we're going to use the mentioned video example
$$x^2-2x-8=0$$
We have $a=1$, $b=-2$ and $c=-8$.
With that we can write that $a·c = -8$ (the multypling condition) and that $b=-2$ the adding condition.
We can try different solutions here. For example 2 numbers that you can multiply and get -8 are 8 and -1. But if you add them together you get -7.
If you try 4 and -2 (that multiply -8) they add +2, so it's not the number
Finally if we try -4 and 2 (we just changed the signs) we get the -2 as the sum.
:::info
In the video they do a graphical version like this. It might be helpful for you

:::
With this we have that $x_1=-4$ and $x_2=2$, and if we write the equation in a factorized version we would get
$$(x-4)(x+2)=0$$
:::success
This is the same equation that we did in the general way with the [general solution.](https://hackmd.io/_8tCBjWnQkuijwCP3aBcS#Example) Was this option faster for you?
:::
### Factorizing by hand $(a \neq 1)$
* Pros: sometimes is faster than general way. We don't have to deal with square roots.
+ Cons: if the roots are not integers we have a problem. In my opinion is too long and too messy. I prefer the general method.
#### Conditions to be applied
None
#### Procedure
TL;DR
We do the same as the previous version but once we have the values we need to divide by $a$.
##### Complete version
We write $a$, $b$ and $c$
We write the value of $a·c$ and the value of $b$
We find (by guessing) a couple of numbers that if we multiply them we get $a·c$ and if we add them we get $b$
Then we write the factorized version with $a$ multiplying the x in both terms and we divide it (the whole thing) by $a$. We try to put this number inside one of the parenthesis or split it.
#### Example
:::info
You can see this in video version exactly here: https://youtu.be/wwCrL1X0gl0?si=qBZ3wUf3K61u8m2w&t=505
:::
$$6x^2+7x-3=0$$
We have $a=6$, $b=7$ and $c=-3$.
With that we can write that $a·c = -18$ (the multypling condition) and that $b=7$ the adding condition.
We conclude that the option of the 2 numbers that comply with both solutions are 9 and -2. (same procedure as before)
We write the solution as a factorized version with the a before the x.
In this case:
$${(6x+9)(6x-2)\over 6}=0$$
In this case we cannot do it in just one step so we split the number since the $(6x+9)$ is easily divided by 3 and $(6x-2)$ is easily divided by 2. Let me write it properly
$${(6x+9)(6x-2)\over 3·2}=0= {(6x+9)\over 3}{(6x-2)\over 2}$$
And we operate
$${(6x+9)\over 3}{(6x-2)\over 2}= (2x+3)(3x-1)=0$$
And from this we conclude
$$x_1= -{3\over 2}; \ x_2={1 \over 3}$$
:::success
With other student, try to do one of the example from the book, page 156:
$$2x^2-7x-4=0$$
One of you do it using the general formula. The other student with this procedure of factorization. What conclusions do you get?
(the solution is in the book! don't look at them until you need to check!)
:::
## Completing the square
If we factorize to make explicit the intersections with the x axis, the completing the square procedure is to find **fast and furious** the vertex form. (and the vertex)

(now imagine that Toretto instead of saying "Family" says "we complete the squares")
Remember that the vertex form is like this
$$f(x)= a(x-k)+h$$ and the coordinates of the vertex
We can apply this to any version from the general form $f(x)= ax^2+bx+c$
### Procedure
We think for a moment that we have a "complete square" and bx is the middle term.
#### Example
$$f(t) = t^2 -6t+2$$
If we take only the part of the terms on $t$, we get $t^2 -6t$, if this would be a perfect square we would need to add $(-6/2)^2=9$ and the expression that fits that would be $(t-3)^2$ ([if you don't remember here you can find a link to the proper tattoo](https://hackmd.io/_uploads/r1NMkX_Ukx.png))
Now if we say that
$$f(t)=(t-3)^2+2$$
it would be a lie. Because if we expand it, we're going to get:
$$f(t) = (t^2 -6t + 9) +2$$
And that's **not** our function!
So to compensate it we just substract that 9 like this
$$f(t) = (t^2 -6t + 9) -9 +2$$
To put it back as a square, we write it back again
$$f(t)=(t-3)^2 -9+2$$
If we operate the constant terms (the terms that doesn't have a variable, t in this case) we get:
$$f(t)=(t-3)^2 -7$$
And that's a VERTEX FORM
(when I think of vertex form I think of the vertex view of 3d modelling)

Where is the vertex? in the (3,-7)
Here you can see it in desmos

### What if $a\neq1$?
We need to take out the $a$ first with common factor. Then we proceed as usual.
When we need to find the substract element we need to multiply it back by a.
#### Example with a=2
$$y= 2x^2+8x+7$$
First we take common factor with that 2
$$y= 2(x^2+4x)+7$$
Here this would be (x+2)^2 and we need to substract 4. Since it's inside that 2 multplier we need to substract 8
$$y= 2(x+2)^2-8+7$$
Then we do the same procedure
$$y= 2(x+2)^2-1$$
So we can see that the coordinates of the vertex is (-2,-1). Here you can see it in desmos

### The other procedure to find the vertex form
Find the vertex. You know that the axis of simitry (it's in the booklet) is the vertical line $x=-{b\over 2a}$ so that's the x position. The y coordinate would be $f(-{b\over 2a})$
Once you have it, you write it is a the vertex form.
So if you have:
$$y= 2x^2+8x+7$$
you know that $x=-{b\over 2a}= - {8\over 2·2}= -2$
And then we just input that number in the function $$y=f(2)=2·(-2)^2+8·(-2)+7=8-16+7=-1$$
So the coordinates are the expected $(-2,-1)$ and the writing of the VERTEX FORM would be the same that we did before:
$$y= 2(x+2)^2-1$$
## Appendix: what do you have in the formula booklet?
Just this, so better have more tools!
