By clicking "accept cookies" you consent to the use of cookies on this website. More information

×
EN | DE
EN | DE


Quadratic Equation Solver (Quadratic Formula)

Introduction

The following equation is a quadratic equation:

\( a \cdot x^2+b \cdot x + c = 0 \)

\( a \), \( b \) and \( c \) are factors, \( x \) is the unknown variable in this equation. To solve a quadratic equation it has to be brought to this form.

The following calculator calculates the unknown variable \( x \) with the factors \( a \), \( b \) and \( c \) as inputs. The result of \( x \) can have two different values (\( x_{2} \)). For some values of \( a \), \( b \) and \( c \) no solution to the quadratic equation in real numbers \( \mathbb{R} \) exists. Then there are solutions in the complex numbers \( \mathbb{C} \) with the imaginary unit i (in electrical engineering often j).

Calculation

\( a \cdot x^2+b \cdot x + c = 0 \)

\( a= \)
\( b= \)
\( c= \)
\( x_{1}= \)
\( x_{2}= \)

Formula

Two popular formulas exist to solve a quadratic equation. Solving a quadratic equation is the same as finding the zeros of this function.

abc-Formula, Midnight-Formula)

The abc-formula is valid for an equation of the following form: \( a \cdot x^2+b \cdot x + c = 0 \).
\( x_{1,2} = \frac{-b \pm \sqrt{b^2 - 4ac}}{2 \cdot a} \) is the solution to this formula. The name abc-formula comes from the often used coefficients a, b and c in this formula. Sometimes this formula is called midnight formula. Teachers often demand from their students that they know this formula at any time - even when waking up at midnight.

\( x_{1,2} = \frac{-b \pm \sqrt{b^2 - 4ac}}{2 \cdot a} \)

pq-Formula

The pq-formula is valid for an equation of the following form: \( x^2+p \cdot x + q = 0 \).
The solution to this formula is \( x_{1,2} = -\frac{p}{2} \pm \sqrt{\frac{p^2}{4} - q} \). The name pq-formula comes, like with the abc-formula, from the often used coefficients p and q in this formula. It is not necessary to memorize both formulas. The abc-formula is able to solve all quadratic equations. The pq-formula requires a 1 as coefficient in front of the term \( x^2 \). To achieve this, the whole equation can be divided by the coefficient in front of \( x^2 \). Then also the pq-formula can be used to solve every quadratic equation.

\( x_{1,2} = -\frac{p}{2} \pm \sqrt{\frac{p^2}{4} - q} \)

Possible Solutions

There are three different possible solution cases to the equation \( a \cdot x^2+b \cdot x + c = 0 \). This gets obvious when looking at the abc-formula \( x_{1,2} = \frac{-b \pm \sqrt{b^2 - 4ac}}{2 \cdot a} \). The value under the root, which is also called discriminant \( D = b^2 - 4ac \), can be positive, 0 or negative.

Two real solutions \( D > 0 \)

For \( D > 0 \) the root can be calculated in real numbers. Because of the + and - in front of the root, there are now two different real solutions to the quadratic equation (one with the + and one with the -).

\( 2 \cdot x^2 + 5 \cdot x + c = 0 \) with the coefficients \( a = 2 \), \( b = 5 \) and \( c = 1 \) is an example of this case. The discriminant obviously is positive: \( D = 5^2 - 4 \cdot 2 \cdot 1 = 17 > 0 \).

The two solutions to this equations are:

\( x_{1} = -0.2192 \)
\( x_{2} = -2.2808 \)

One real solution \( D = 0 \)

The square root of \( D = 0 \) is 0. Therefore the quadratic equation only has one solution (because \( +0 \) and \( -0 \) leads to the same result.

The following equation has a discriminant \( D \) of 0:

\( x^2 - 2 \cdot x + c = 0 \)
\( D = (-2)^2 - 4 \cdot 1 \cdot 1 = 4 - 4 = 0 \)
The solution, which is also called a double root, is \( x = 1 \).

A pair of conjugate complex solutions \( D < 0 \)

There is no solution of the square root for \( D < 0 \) in the real numbers. This is because there is no real number which can be squared and then equals a negative value. The square of every real number except 0 is positive. Therefore the imaginary unit \( i = \sqrt{-1} \) is used and a solution in the complex numbers can be found.

An example of a quadratic equation with a pair of conjugate complex solutions is given below.
\( 5 \cdot x^2 + 2 \cdot x + c = 0 \)
The discriminant \( D \) is less than 0:
\( D = 2^2 - 4 \cdot 5 \cdot 1 = 4 - 20 = -16 < 0 \)
The two solutions therefore are:
\( x_{1} = -0,2 + i \cdot 0,4 \)
\( x_{2} = -0,2 - i \cdot 0,4 \)

Derivation

Where does the abc-formula come from? Starting with \( a \cdot x^2+b \cdot x + c = 0 \), \( c \) is subtracted from the equation to only have terms with an x on the left side. The final goal is to complete the square on the left side.
\( a \cdot x^2+b \cdot x + c = 0 | -c \)
\( a \cdot x^2+b \cdot x = -c \)
The first term on the left side should equal the first term of the binomial formula and the second term on the left side should equal the second term of the binomial formula \( (e+f)^2=e^2+2ef+f^2 \). To achieve this, the equation has to be multiplied by \( 4a \).
\( a \cdot x^2+b \cdot x = -c | \cdot 4a \)
\( 4a^2 \cdot x^2+4ab \cdot x = -4ac \)
\( b^2 \) is missing on the left side compared with the binomial formula to complete the square.
\( 4a^2 \cdot x^2+4ab \cdot x = -4ac | +b^2 \)
\( 4a^2 \cdot x^2+4ab \cdot x + b^2 = -4ac + b^2 \)
Completing the square, taking the square root and rearranging leads to the abc-formula.
\( 4a^2 \cdot x^2+4ab \cdot x + b^2 = -4ac + b^2 \)
\( (2ax + b)^2 = -4ac + b^2 \)
\( (2ax + b) = \pm \sqrt{-4ac + b^2} | -b \)
\( 2ax = -b \pm \sqrt{-4ac + b^2} | :(2a) \)
\( x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2 \cdot a} \)

Examples

abc-Formula

\( 4 \cdot x^2-5 \cdot x + 1 = 0 \)
The coefficients of this equations are:
\( a = 4 \)
\( b = -5 \)
\( c = 1 \)
Plugging these coefficients into the abc-formula leads to the solution.
\( x_{1,2} = \frac{-(-5) \pm \sqrt{(-5)^2 - 4 \cdot 4 \cdot 1}}{2 \cdot 4} \)
\( x_{1,2} = \frac{5 \pm \sqrt{9}}{8} \)
\( x_{1,2} = \frac{5 \pm 3}{8} \)
\( x_{1} = \frac{5 + 3}{8} = \frac{8}{8} = 1 \)
\( x_{2} = \frac{5 - 3}{8} = \frac{2}{8} = \frac{1}{4} = 0,25 \)

Completing the square

An example with numbers is used to show how completing the square is done.
\( x^2+10x+8 = 0 \)
To compare the coefficients the binomial formula \( (e+f)^2=e^2+2ef+f^2 \) is used. It is obvious that the first term inside the brackets must be \( x \), because the square of the first term should be \( x^2 \), the first term in the quadratic equation.
The second term inside the brackets needs to be a 5, because \( 2 \cdot x \cdot 5 \) equals \( 10x \), which is the second term of the quadratic equation.
\( (x+5)^2 = x^2 + 10x + 25 \)
The number 25 is too and is now substracted from the equation.
\( (x+5)^2 = x^2 + 10x + 25 | -25 \)
\( (x+5)^2 - 25 = x^2 + 10x \)
The right side of this equations now equals the first two terms of the quadratic equation. Instead of using \( x^2 + 10x \), now \( (x+5)^2 - 25 \) is plugged into the quadratic equation.
\( (x+5)^2 - 25 + 8 = 0 \)
\( (x+5)^2 - 17 = 0 \)