12 minutes read

When you understand linear equations, quadratic equations are the next step because they let you model even more complex problems.

Quadratic equations can be applied in different fields, from financial issues involving interest rates to free fall problems in physics.

In machine learning, the linear regression model is based on linear equations, which seems like a very rigid structure. In contrast, quadratic regression is based on quadratic equations, which allows it to capture more complicated relationships and therefore, can have a better performance in real-life problems.

In this topic, you will:

  • Understand what quadratic equations are,

  • Learn a simple method to determine their solutions (roots) and

  • Discover a formula to find them all.

You will also use a simple method for the resolution of these equations.

What is a quadratic equation?

A typical quadratic equation looks like this:

ax2+bx+c=0ax^2 + bx + c = 0 where aa, bb, and cc are real numbers. Some examples of quadratic equations are:

  • 4x2+3x+1=04x^2 + 3x + 1 = 0

  • 3x2+7=03x^2 + 7 = 0

  • 12x2=012x^2 = 0

You can notice that the values b=0b=0 and c=0c=0 are perfectly valid. But, what would happen if a=0a=0? In this case, the equation would be reduced to bx+cbx + c and you would go back to linear equations. You already know how to handle them and do not need to add anything new!

So, to be sure that you are dealing with quadratic equations, you must always check that a0a \neq 0. This is the reason equations like 5x+3=05x + 3 = 0 or x4=0x-4 =0 are not quadratic equations.

The roots of a quadratic equation are the solutions of the equation: ax2+bx+c=0ax^2 + bx + c = 0.

Finding the roots can be useful for solving practical problems involving quadratic equations.

Here is an example: if you throw a ball vertically upward with an initial speed vv ft/s, it will reach a height of hh ft after tt seconds. In mechanics, there is a formula that describes hh in terms of tt by the quadratic equation: h=16t2+vth = -16t^2+vt.

In this situation, you might be interested in knowing when the ball would fall to the ground (h=0)(h=0) after being thrown. This question translates into the equation:

0=16t2+vt0= -16t^2+vt

In this example, a solution can be a negative number. However, in the context of the problem, it would be absurd to consider such a solution. That is why you must always remember that in applications, you must be clear about the context of the problem you are solving: the context is pivotal!

Quadratic formula and number of roots

When dealing with linear equations ax+b=0ax +b =0 it is easy to get the unique solution x=bax = \frac{-b}{a}. However, when you work with quadratic equations ax2+bx+c=0ax^2 + bx +c = 0, there may be up to two solutions or even no solutions at all!

Fortunately, you can detect how many roots a quadratic equation has by its discriminant, which is defined as:

d=b24acd = b^2 -4ac

We use the discriminant dd as follows:

  • If d<0d<0, then, there is no root,

  • If d=0d=0, then, there is only one root,

  • If d>0d>0, then, there are two different roots.

You can give a geometric interpretation of the discriminant if you note that finding the roots of the equation ax2+bx+c=0ax^2 +bx+c=0 is the same as finding the points where the function f(x)=ax2+bx+cf(x)=ax^2 +bx+c intersects the horizontal axis.

The function is a parabola and if the coefficients are all positive, then the parabola opens up. If the discriminant is positive then the parabola is below the horizontal axis, while when it is equal to zero the parabola cuts the axis at a single point. Finally, when the discriminant is negative, the parabola is completely above the axis. The same reasoning applies when the coefficients are negative, but in this case the parabola opens downward.

Positive, negative or zero discriminant

Let's use the discriminant in the following equation: x2+2x+3=0x^2 + 2x + 3 =0. We identify that a=1a=1, b=2b=2 and c=3c=3, so the discriminant is d=224(1)(3)=412=8d = 2^2 - 4(1)(3) = 4 - 12 = -8. Since the discriminant is negative, we are completely confident that the equation has no solutions.

Once you have calculated the discriminant and know that there is at least one root, you can find them all using the quadratic formula:

x=b±d2a=b±b24ac2ax = \frac{-b \pm \sqrt{d}}{2a} = \frac{-b \pm \sqrt{b^2 -4ac}}{2a}

When the discriminant is zero, the only root is: x=b2ax = \frac{-b}{2a}.

But when there are two solutions, they are given by: x1=b+d2ax_1 = \frac{-b + \sqrt{d}}{2a}, x2=bd2ax_2 = \frac{-b - \sqrt{d}}{2a}.

Let's see the quadratic formula in action with the following equation x23x+2=0x^2-3x+2=0. The first step is to compute the discriminant d=(3)24(1)(2)=98=1d = (-3)^2 -4(1)(2) = 9 - 8 = 1. Its value is positive, so we are certain that the equation has two different roots and its exact values are:

x1=b+d2a=(3)+12(1)=42=2x_1 = \frac{-b + \sqrt{d}}{2a} = \frac{-(-3) + 1}{2(1)} = \frac{4}{2} = 2x2=bd2a=(3)12(1)=22=1x_2 = \frac{-b - \sqrt{d}}{2a} = \frac{-(-3) - 1}{2(1)} = \frac{2}{2} = 1

Roots multiplication and sum

You can determine the two possible roots of the quadratic equation with the help of the quadratic formula. Fun fact: if you know the roots of the equation, you can get information about the relation between coefficients aa, bb, and cc of the original equation.

To get this, let's call the solutions of the quadratic equation x1x_1 and x2x_2. Using the quadratic formula, we get that the sum of the roots is:

x1+x2=b+d2a+bd2a=b+dbd2a=2b2a=ba\begin{align*} x_1 + x_2 = \frac{-b + \sqrt{d}}{2a} + \frac{-b - \sqrt{d}}{2a} = \frac{-b + \sqrt{d} -b - \sqrt{d}}{2a} = \frac{-2b}{2a} = \frac{-b}{a} \end{align*}Similarly, the product of the roots is:

x1×x2=b+d2a×bd2a=(b+d)(bd)4a2=b2+bdbdd4a2=b2d4a2=b2b2+4ac4a2=4ac4a2=ca\begin{align*} x_1 \times x_2 &= \frac{-b + \sqrt{d}}{2a} \times \frac{-b - \sqrt{d}}{2a} \\ &= \frac{\left(-b + \sqrt{d}\right) \left(-b - \sqrt{d}\right)}{4a^2} \\ &= \frac{b^2 +b \sqrt{d} -b \sqrt{d}-d}{4a^2} \\ &= \frac{b^2 -d}{4a^2} \\ &=\frac{b^2 -b^2 +4ac}{4a^2}\\ &=\frac{4ac}{4a^2} \\ &=\frac{c}{a} \end{align*}

You can use these relationships to find the roots of an equation. For the equation x24x+3=0x^2-4x+3 = 0 you have that:

x1+x2=ba=(4)1=4x_1 + x_2 = \frac{-b}{a}= \frac{-(-4)}{1}=4x1×x2=ca=31=3x_1 \times x_2 = \frac{c}{a} = \frac{3}{1} = 3Then look for two numbers such that their product is 33 and their sum is 44. Since the product is equal to 33, two candidates are x1=3x_1=3 and x2=1x_2=1. The sum of both numbers is equal to 44, so you have found the roots of the equation!

This method also helps verify that the solutions obtained by another method are the correct ones. If the sum of the calculated roots is not ba\frac{-b}{a} or their product is not ca\frac{c}{a}, then you did something wrong!

Method of completing the square

Here is the identity that you might remember from math classes:

(x+y)2=x2+2xy+y2\begin{align} (x + y)^2 = x^2 + 2xy + y^2 \end{align}The left side of the equality is more compact and has the advantage that xx appears only once: if you were trying to isolate xx, it would be easier and more direct to opt for the left side of the equation. If, for example, you had the equation x2+2xy+y2=0x^2 + 2xy + y^2 = 0, you would simply write (x+y)2=0(x+y)^2 = 0 and then x+y=0x+y=0 from which you can conclude that x=yx=-y.

However, in most cases, you will find expressions that contain both x2x^2 and xx, but do not have a quadratic term that allows the entire equation to be factored. An example is the equation 3x25x=03x^2 -5x = 0. In these cases, you want to be able to complete the expression by adding the term c2c^2 that would play the role of yy in the equation (1)(1).

In general, you have an expression of the form: x2+bxx^2 + bx.

Then, add a number c2c^2 so that x2+bx+c2x^2 + bx + c^2 has an easy simplification like equation (1)(1). Although you cannot add any number to the equation because it would unbalance it, you can add and take away the same number so that the original equation is not altered:

x2+bx=x2+bx+0=x2+bx+c2c2\begin{align*} x^2 + bx &= x^2 + bx + 0 = x^2 + bx + c^2 - c^2 \end{align*}So, all you have to do is to find the exact value for cc that makes x2+bx+c2x^2 + bx + c^2 look like equation (1)(1). The good thing is that this is easy because the only thing that the equation x2+bx+c2x^2 + bx + c^2 needs to become x2+2cx+c2x^2 + 2cx + c^2 is that b=2cb=2c, so you see that:

c=b2c = \frac{b}{2} Substituting c=b2c = \frac{b}{2}, you obtain that in the quadratic equation:

x2+bx=x2+bx+c2c2=x2+bx+(b2)2(b2)2=(x+b2)2(b2)2\begin{align*} x^2 + bx &= x^2 + bx + c^2 - c^2 \\ &= x^2 + bx + \left(\frac{b}{2}\right)^2 - \left(\frac{b}{2}\right)^2 \\ &= \left(x+\frac{b}{2}\right)^2 - \left(\frac{b}{2}\right)^2 \end{align*}Great job so far! It's time to summarize our work. To complete the square, you only have to add and subtract the term (b2)2\left( \frac{b}{2} \right)^2 and simplify, or directly use the formula:

x2+bx=(x+b2)2b24\begin{align} x^2 + bx &= \left(x+\frac{b}{2}\right)^2 - \frac{b^2}{4} \end{align}Here is an example of completing the square:

2x212x+11=2[x26x]+11=2[x26x+99]+11=2[(x3)29]+11=2(x3)27\begin{align*} 2x^2 - 12 x + 11 &= 2\left[x^2-6x\right] + 11 \\ &= 2[x^2-6x + 9 - 9] + 11 \\ &= 2\left[(x-3)^2 - 9\right] + 11 \\ &= 2(x-3)^2 -7 \end{align*}Here comes the great power of completing the square. Solving the equation 2x212x+11=02x^2 - 12 x + 11 = 0 is the same as solving the equation 2(x3)27=02(x-3)^2 -7 = 0, but the latter is much simpler because you only have to isolate xx. We get (x3)2=72(x-3)^2 = \frac{7}{2}, and finally x=3±72x= 3 \pm \sqrt{\frac{7}{2}}.

This technique is great because it can be applied to any equation, and so it helps find the roots of any quadratic equation.

Conclusion

  • Quadratic equations are present in different disciplines and finding their roots is very helpful. They have the form ax2+bx+c=0ax^2+bx+c = 0

  • When working with them, the first thing you should do is to determine how many roots it has using the discriminant dd, given by d=b24acd=b^2-4ac. When it is negative, there are no roots, while if it is zero, there is only one root, finally, when it is positive, there are two different roots.

  • The quadratic formula x=b±b24ac2ax = {-b \pm \sqrt{b^2-4ac} \over 2a} gives you all the roots, and you can verify that our results are correct by adding and multiplying the roots.

  • Finally, completing the square is a simple technique that greatly simplifies solving quadratic equations.

14 learners liked this piece of theory. 0 didn't like it. What about you?
Report a typo