# Understanding Quadratics

Not getting quadratics? Same! With today's mental gym sesh we're doing leg day, focusing on quadratics. I know, the dreaded quadratic. Fuck them. But we need to understand them to move onto the other cool shit in math. Lets see whether we can get it to click!

import MailingList from ”@/components/blog/NewsletterForm”; import Latex from ’@/components/Latex’;

## What Are Quadratics

Quadratics are second degree polynomials identified by the squared exponent

This is where the term “quadratic” comes from. “quad,” meaning square, because the variable is squared.

These equations are the gateway drug into the world of non-linearity. A quadratic is a U-shaped curve called a parabola. Depending on the sign of

### Syntax Breakdown

Firstly, the quadratic coefficient

The *linear coefficient*

The *constant term*

As you can see w/ this example the right side of the parabola intercepts the y-axis at `c = 9`

### Vertex

The highest or lowest point on the parabola is called the vertex. A vertical line can be drawn through the vertex to indicate the axis of symmetry: where the left side of the parabola is reflected on the right side.

### Roots

We solve for the x-values we call the **roots** where the parabola intersects the x-axis where the function equals 0. This can be either 0, 1 or 2. 0 where the axis isn’t touched at all, 1 where only the vertex touches the x-axis and 2 where the vertex is below the x-axis, causing 2 distinct points to be intersected.

To determine the roots we either use factoring, completeting the square, or the quadratic formula, which we’ll go over shortly.

### Discriminant

…

## Why Quadratics?

For any problem that is in a single dimension and not linear then we’d use quadratics. A perfect example that is heavily used in AI for minimising functions is **gradient descent**! With this we keep adjusting our value to get closer to the vertex by assessing the tangent of our coordinates.

For example, this following graph represents how we minimise a quadratic, convex problem. Lets say we start at the 1st point and notice that the tangent line tells us decreasing our value is how we get closer to the global minimum and since it’s so steep we use a larger number to change our value.

This overshoots but gets closer to the global min but now our tangent has switched so we increase our value by a little bit and we reach the 3rd point. Then we keep repeating this process until our tanget of the point we land on is, or very close, to being horizontal.

When we get into the multi-dimensional world we’ll encounter objects like a paraboloid where we would try and optimise to get to the lowest point of it. Since there is only a single minimum point we know it’s a convex problem and can use quadratics!

Anything non-convex means there’s no longer a single minimum but multiple, which we label local (not the lowest we can go) and global minimum (lowest we can possibly go). This is where the representation of optimising multi-variable systems, *cough* AI, would come into play.

And so obviously, we need to truly understand quadratic systems before we can go into the realm of non-convex systems. Don’t worry, anon. There are tons of opportunities to apply convex optimising, especially in finance. This is like our gateway drug into calculus!

## Factoring

### Easy

Lets say we for the general quadratic formula

have the following quadratic

To factor it we must find two numbers that have the multiplicative sum of `c`

, `-12`

and additive sum of `b`

, `4`

.

Our options for multiplication start from `1`

and end at `3`

:

# | Multiples of 12 | Additive Sum |
---|---|---|

1 | ||

2 | ||

3 | ||

4 | ||

5 | ||

6 |

We can see that `#4`

meets both requirements of being multiples of `-12`

and having the sum equal `4`

!

And so we represent this as the factored version

### Medium

But what if we had the coefficient not `1`

and instead `3`

:

We would first factor out the `a`

coefficient `3`

and then we would have to extract multiples of `3`

from `b`

and `c`

:

And we’re left with our result from the last quadratic we did which would be represented as

### Hard

Immediately, you notice we cannot factor our the `a`

coefficient because `b = 10`

doesn’t have multiples of `3`

and neither does `c = -8`

.

So wtf do we do here?

There’s a really cool technique NancyPi spoke about here, but I’ll try to explain it in my own words.

It’s quite similar to the strategy we had before it’s just multiplying factors of `a * c`

and requiring the additive sum to be `b`

instead of multiplying factors of `c`

and additive sum being `b`

.

So we solve for

# | Multiples of `a * c` | Additive Sum `= b` |
---|---|---|

1 | ||

2 | ||

3 |

So we have `-2`

and `12`

.

Then next part is to divide both of them by our `a`

coefficient to create
<Latex e=“\dfrac{-2}{3}”/ > and <Latex e=“\dfrac{12}{3}”/ > and since we can simplify the latter our final result will be:

And then we create our quadratic solution by using the `denominator * x + numerator`

, creating:

### Cannot Factor

There will come to a time where you will not be able to factor a quadratic. For example,

# | Multiples of `a * c` | Additive Sum `= b` |
---|---|---|

1 | ||

2 | ||

3 | ||

3 |

There are no solutions! And that’s kind of it…

## Completeing the Square

### Standard

The first step is to move the constant onto the right side

Then we need to add the result of

Why do we do this though? So we can have a perfect square:

And we can solve for the `x`

s by square rooting both sides

Why is there a plus-minus? Whenever we square root a constant we get a positive and a negative version (because a negative squared is a positive too!).

And so our result becomes

Then we solve for 2 equations, one for the positive and negative, as so:

For the positive,

And the negative,

And we get our two solutions

### 1 < `a`

Coefficient

Lets say we have

Our first step is the same by moving the 3 to the other side

Next we want to get rid of that pesky `a`

coefficient, which we do by dividing everything by `a`

Now we want to add a new `c`

to the left side of the equation and we must do the same to the right to make them equal.

And as we’ve done before this magic number is

Which in our case would be

This, again, is the term that enables us to create a perfect square.

And to get to our `x`

solutions we

### Negative `a`

Coefficient

Holy shit, a negative `a`

coefficinet! Wtf will we ever do?!

Don’t worry, anon. The first still is always to move the `c`

coefficient to the other side (oh that poor `c`

).

We don’t want our `a`

coefficient to be negative so we divide every term by `-1`

to flip the negative into a positive :)

Now that we got that frown upside down we just continue on our day. The left side is however lonely so we’re gonna need to give them a new fren,

And we’re back at the same answer as the solution we found in `#Standard`

.

## Vertex Form

## Resources

Share this Article