Enter the coefficients a, b and c of the quadratic equation ax² + bx + c = 0. The equation below is linked to the input fields, so you can also edit the coefficients directly in it. The quadratic formula gives the solutions, along with the discriminant, the type of solutions and the steps.
Table of Contents
-
What you can do on this page
-
What is this calculation used for?
-
How to Use
-
Formulas and graphs
-
Symbols and terms
-
Good to know before you start
-
How to calculate it in Excel
-
How to calculate it in Google Sheets
-
How to calculate it in Python
-
How to write it in LaTeX and other math languages (copy and paste)
-
How to have ChatGPT do the calculation
-
DataChef Features
-
Related Features
-
NumberChef Calculators List
What you can do on this page
- Enter the coefficients \(a, b, c\) and the quadratic formula solves \(ax^2 + bx + c = 0\) on the spot
- It also shows the value of the discriminant \(D = b^2 - 4ac\) and the type of solutions (two different real solutions, a double root, or two complex solutions)
- When the solutions are not real numbers, it still finds the two complex solutions, such as \(-0.5 \pm 0.866i\) (a conjugate pair that differs only in the sign of the imaginary part)
- Coefficients can be decimals, negative numbers or fractions such as 3/4
- A plain-language explanation of the formulas and copy-and-paste formulas for Excel, Google Sheets and Python are all on this page
What is this calculation used for?
If you throw a ball straight up at 64 feet per second, its height after t seconds is about 64t − 16t² feet (using gravity of about 32 ft/s² and ignoring air resistance). "When is it 48 feet high?" means solving the quadratic equation −16t² + 64t − 48 = 0, and the quadratic formula gives t = 1 second and 3 seconds (once on the way up and once on the way down).
From planning the height where fireworks burst to the path of a basketball shot, the motion of anything thrown is tied to quadratic equations.
"I want a rectangular garden bed with an area of exactly 28 square feet, 3 feet longer than it is wide." With width x, you get x(x + 3) = 28, or x² + 3x − 28 = 0. The quadratic formula gives x = 4 and x = −7, but a length cannot be negative, so the bed is 4 feet wide and 7 feet long.
In real life, using a quadratic equation includes this last step: choosing which of the two solutions makes sense (checking whether each answer makes sense).
What annual rate turns $10,000 into $12,100 in 2 years? With the rate r, 10000(1 + r)² = 12100, which simplifies to r² + 2r − 0.21 = 0. The quadratic formula gives r = 0.1 and r = −2.1, and the one that makes sense as a rate, r = 0.1 (10% per year), is the answer.
Money calculations that "multiply by the same factor twice", like compound interest, lead to quadratic equations, so you can work back from a target amount to the return you need.
The shape of an arch bridge or the cable of a suspension bridge is usually designed with a parabola, y = ax² + bx + c. Finding "how far from the center the height above the ground is a certain value" is exactly solving a quadratic equation.
When designers and civil engineers set the shape of a structure with formulas, the quadratic formula is one of the basics.
"Raising the price increases the profit per item, but fewer items sell." In a simple model of this, profit is a quadratic function of the price. The prices where the profit is exactly 0 are the solutions of that quadratic equation, and they give a rough upper and lower limit for pricing.
Real markets are more complicated, but a first estimate of "where the profit hill ends" with a quadratic equation is a common starting point in business analysis.
Formulas and graphs
Symbols and terms
Symbols
| \(a, b, c\) | a, b, c | The coefficients of the quadratic equation. \(a\) is the number in front of \(x^2\), \(b\) is the number in front of \(x\), and \(c\) is the constant term (the number-only term). |
| \(x\) | ex | The unknown number you want to find as the solution of the equation. A quadratic equation has at most two solutions. |
| \(D\) | dee (discriminant) | The discriminant, \(D = b^2 - 4ac\), from the first letter of "discriminant". Some books write it with the Greek letter \(\Delta\) (delta). |
| \(\sqrt{\phantom{9}}\) | square root | The symbol for "the number, 0 or greater, whose square is the number inside". \(\sqrt{25} = 5\) and \(\sqrt{2} \approx 1.414\). |
| \(\pm\) | plus or minus | A symbol that writes "both the + case and the − case" at once. In the quadratic formula, it means that both the sum and the difference are solutions. |
| \(i\) | i (imaginary unit) | The number whose square is \(-1\) (\(i^2 = -1\)). It is used to write the solutions when the number under the √ is negative. |
| \(x_1, x_2\) | x sub 1, x sub 2 | Names for the two solutions. On this page, the + side of ± is \(x_1\) and the − side is \(x_2\). |
Terms
| quadratic equation | An equation with an \(x^2\) (squared) term. It can be written in the form \(ax^2 + bx + c = 0\) (\(a \neq 0\)), called standard form. Taught in Algebra 1. |
| coefficient | The number in front of a letter. In \(3x\), the coefficient is 3. When reading coefficients, watch for hidden 1s and signs: \(x^2 - x = 0\) means a = 1, b = −1, c = 0. |
| solution | A value of the letter that makes the equation true. To "solve" an equation means to find all of its solutions. The solutions of a quadratic are also called its roots. |
| quadratic formula | A formula that calculates the solutions of a quadratic equation directly from the coefficients a, b and c. Its strength is that it always works, even when you cannot see how to factor. |
| discriminant | The part under the √ in the quadratic formula, \(b^2 - 4ac\). Its sign alone tells you the type of solutions (two real solutions, a double root, or two complex solutions). |
| double root | A solution where the two solutions come together as one. It happens when the discriminant is 0, and on the graph the parabola touches the x-axis. It is also called a repeated root. |
| real solution | A solution that is a real number (a number on the ordinary number line). There are real solutions when the discriminant is 0 or greater. |
| complex solution | A solution that is not a real number and is written with the imaginary unit \(i\). When the discriminant is negative, the solutions are a pair of the form "real part ± imaginary part \(i\)", such as \(-0.5 \pm 0.866i\) (complex conjugates). Also called imaginary solutions. Taught in Algebra 2. |
| completing the square | Rewriting an equation in the form \((x + p)^2 = q\) (a square equals a number). Doing this all the way with the letters a, b and c gives the quadratic formula. |
| factoring | Writing an expression as a product. If you can factor \(x^2 + 3x - 4 = (x - 1)(x + 4)\), you get the solutions x = 1, −4 without the quadratic formula. |
| parabola | The shape of the graph of \(y = ax^2 + bx + c\). The real solutions of the quadratic equation are the x-coordinates of the points where this parabola meets the x-axis (the x-intercepts). |
Good to know before you start
Here is what helps you use the calculation on this page with real understanding, not just by pressing the button.
If you get stuck, going back to review these topics is the fastest way forward.
| Arithmetic with negative numbers (Grade 7) |
|
| Square roots (Grade 8) |
|
| Quadratic equations (Algebra 1) |
|
| Graphs of quadratic functions (Algebra 1) |
|
How to calculate it in Excel
| Coefficient a | 1 |
| Coefficient b | 3 |
| Constant term c | -4 |
| Discriminant D = b² − 4ac | =B2^2-4*B1*B3 |
| Solution 1, x₁ | =(-B2+SQRT(B4))/(2*B1) |
| Solution 2, x₂ | =(-B2-SQRT(B4))/(2*B1) |
| Coefficient a | 1 |
| Coefficient b | 1 |
| Constant term c | 1 |
| Discriminant D = b² − 4ac | =B2^2-4*B1*B3 |
| Type of solutions | =IF(B4>0,"Two different real solutions",IF(B4=0,"Double root","Two complex solutions")) |
| Coefficient a | 1 |
| Coefficient b | 2 |
| Constant term c | 1 |
| Double root x | =-B2/(2*B1) |
| Coefficient a | 1 |
| Coefficient b | 1 |
| Constant term c | 1 |
| Real part (−b ÷ 2a) | =-B2/(2*B1) |
| Imaginary part (the ± part) | =SQRT(4*B1*B3-B2^2)/ABS(2*B1) |
| Coefficient b | 2 |
| Constant term c | 4 |
| Solution x | =-B2/B1 |
"^2" means squared, and "SQRT( )" is the function for the square root.
In the first table, for example, you see the discriminant 25, solution 1 = 1 and solution 2 = −4.
The SQRT in the first table only works when D > 0 (if D < 0 you get a #NUM! error; in that case use the fourth table, for complex solutions).
How to calculate it in Google Sheets
| Coefficient a | 1 |
| Coefficient b | 3 |
| Constant term c | -4 |
| Discriminant D = b² − 4ac | =B2^2-4*B1*B3 |
| Solution 1, x₁ | =(-B2+SQRT(B4))/(2*B1) |
| Solution 2, x₂ | =(-B2-SQRT(B4))/(2*B1) |
| Coefficient a | 1 |
| Coefficient b | 1 |
| Constant term c | 1 |
| Discriminant D = b² − 4ac | =B2^2-4*B1*B3 |
| Type of solutions | =IF(B4>0,"Two different real solutions",IF(B4=0,"Double root","Two complex solutions")) |
| Coefficient a | 1 |
| Coefficient b | 2 |
| Constant term c | 1 |
| Double root x | =-B2/(2*B1) |
| Coefficient a | 1 |
| Coefficient b | 1 |
| Constant term c | 1 |
| Real part (−b ÷ 2a) | =-B2/(2*B1) |
| Imaginary part (the ± part) | =SQRT(4*B1*B3-B2^2)/ABS(2*B1) |
| Coefficient b | 2 |
| Constant term c | 4 |
| Solution x | =-B2/B1 |
How to calculate it in Python
import math
a = 1.0 # coefficient of x^2
b = 3.0 # coefficient of x
c = -4.0 # constant term
if a == 0 and b == 0:
print("If a and b are both 0, there is no equation to solve")
elif a == 0:
# When a = 0, it becomes the linear equation bx + c = 0
print(f"Solution of the linear equation: x = {-c / b}")
else:
discriminant = b**2 - 4*a*c # discriminant D
print(f"Discriminant D = {discriminant}")
if discriminant > 0:
root = math.sqrt(discriminant)
print(f"Two different real solutions: x1 = {(-b + root) / (2*a)}, x2 = {(-b - root) / (2*a)}")
elif discriminant == 0:
print(f"Double root: x = {-b / (2*a)}")
else:
real_part = -b / (2*a)
imaginary_part = math.sqrt(-discriminant) / (2*abs(a))
print(f"Two complex solutions: x = {real_part} ± {imaginary_part}i")
How to write it in LaTeX and other math languages (copy and paste)
x = (−b ± √(b² − 4ac)) ÷ (2a)
x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mrow>
<mi>x</mi>
<mo>=</mo>
<mfrac>
<mrow>
<mo>−</mo><mi>b</mi>
<mo>±</mo>
<msqrt>
<mrow>
<msup><mi>b</mi><mn>2</mn></msup>
<mo>−</mo>
<mn>4</mn><mi>a</mi><mi>c</mi>
</mrow>
</msqrt>
</mrow>
<mrow><mn>2</mn><mi>a</mi></mrow>
</mfrac>
</mrow>
</math>
x = (-b +- sqrt(b^2 - 4ac)) / (2a)
Solve[a*x^2 + b*x + c == 0, x]
solve(a*x^2 + b*x + c = 0, x);
x = roots([a b c]);
x = (-b ± √(b^2 - 4ac))/(2a)
D = b² − 4ac
D = b^{2} - 4ac
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mrow>
<mi>D</mi>
<mo>=</mo>
<msup><mi>b</mi><mn>2</mn></msup>
<mo>−</mo>
<mn>4</mn><mi>a</mi><mi>c</mi>
</mrow>
</math>
D = b^2 - 4ac
b^2 - 4*a*c
d := b^2 - 4*a*c;
d = b^2 - 4*a*c;
D = b^2 - 4ac
x = −b ÷ (2a)
x = -\frac{b}{2a}
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mrow>
<mi>x</mi>
<mo>=</mo>
<mo>−</mo>
<mfrac><mi>b</mi><mrow><mn>2</mn><mi>a</mi></mrow></mfrac>
</mrow>
</math>
x = -b / (2a)
-b/(2*a)
x := -b/(2*a);
x = -b/(2*a);
x = -b/(2a)
x = (−b ± √(4ac − b²) i) ÷ (2a)
x = \frac{-b \pm \sqrt{4ac - b^2}\,i}{2a}
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mrow>
<mi>x</mi>
<mo>=</mo>
<mfrac>
<mrow>
<mo>−</mo><mi>b</mi>
<mo>±</mo>
<msqrt>
<mrow>
<mn>4</mn><mi>a</mi><mi>c</mi>
<mo>−</mo>
<msup><mi>b</mi><mn>2</mn></msup>
</mrow>
</msqrt>
<mi>i</mi>
</mrow>
<mrow><mn>2</mn><mi>a</mi></mrow>
</mfrac>
</mrow>
</math>
x = (-b +- sqrt(4ac - b^2) i) / (2a)
{(-b + Sqrt[4*a*c - b^2]*I)/(2*a), (-b - Sqrt[4*a*c - b^2]*I)/(2*a)}
x := [(-b + sqrt(4*a*c - b^2)*I)/(2*a), (-b - sqrt(4*a*c - b^2)*I)/(2*a)];
x = [(-b + sqrt(4*a*c - b^2)*1i)/(2*a), (-b - sqrt(4*a*c - b^2)*1i)/(2*a)];
x = (-b ± √(4ac - b^2) i)/(2a)
x = −c ÷ b
x = -\frac{c}{b}
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mrow>
<mi>x</mi>
<mo>=</mo>
<mo>−</mo>
<mfrac><mi>c</mi><mi>b</mi></mfrac>
</mrow>
</math>
x = -c/b
-c/b
x := -c/b;
x = -c/b;
x = -c/b
How to have ChatGPT do the calculation
You are a calculation assistant for math. Do the following calculation by actually running Python code, and base your answer only on the numbers from the execution result (do not answer by mental math or guessing). Solve the quadratic equation x² + 3x − 4 = 0 with the quadratic formula. Show each of the following: 1. The value of the discriminant D = b² − 4ac and the type of solutions it shows (two different real solutions, a double root, or two complex solutions) 2. The values of the solutions x (if they are complex, in the form "real part ± imaginary part i") 3. The steps showing how the values are put into the quadratic formula Show the formulas you used and the numbers from the execution result.
How to Use
-
1Enter your numbersType the numbers you want to calculate with into the input fields
-
2CalculatePress the "Calculate" button
-
3Check the resultThe result appears on the spot. The same page also explains the idea behind the calculation and the formula
DataChef Features
No technical knowledge required.
Intuitive and user-friendly operation.
Can be used without registering personal information.
Automatic file deletion by clicking "download".
and rapid file conversion.
No attribution required.
No need to contact us for commercial use permission.
