Tool to apply the quadratic formula to any polynomial of degree 2 (ax ^ 2 + bx + c) from the expression of the trinomial or the values of a, b and c.
Quadratic Formula - dCode
Tag(s) : Arithmetics
dCode is free and its tools are a valuable help in games, maths, geocaching, puzzles and problems to solve every day!
A suggestion ? a feedback ? a bug ? an idea ? Write to dCode!
The quadratic formula is the name given to a mathematical expression allowing to find the solutions of a quadratic equation (presented in the form of a polynomial of degree 2 equal to 0). This is the easiest method and therefore the most often taught.
For any polynomial $ P $ of order 2, of variable $ x $ denoted $$ P(x) = ax^2+bx+c $$ the solutions of $ P(x) = 0 $ are given by the quadratic formula $$ x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a} $$
The formula involves the symbol $ \pm $ (plus or minus) which means that $ x $ can take 2 values, the first calculated with the sign $ + $ (plus), the second with the sign $ - $ (minus).
From a polynomial of degree 2, of variable $ x $:
— Expand and reduce the expression of the polynomial if necessary
— Note $ a $ the coefficient associated with $ x^2 $
— Note $ b $ the coefficient associated with $ x $
— Note $ c $ the remaining constant
— Calculate the solutions $$ x_1 = \frac{-b + \sqrt{b^2 - 4ac}}{2a} \\ x_2 = \frac{-b - \sqrt{b^2 - 4ac}}{2a} $$
Example: $ 5x^2+3(x+1)-4 $ expands to $ 5x^2+3x-1 $, the values of the coefficients are $ a = 5, b = 3, c = -1 $, the solutions are $ x_1 = \frac{-3+\sqrt{29}}{10} $ and $ x_2 = \frac{-3-\sqrt{29}}{10} $
If $ b^2 - 4ac = 0 $ then there is only one solution.
From the initial equation $$ ax^2+bx+c = 0 $$
— Divide by $ a $: $$ x^2 + \frac{b}{a} x + \frac{c}{a}=0 $$
— Subtract $ \frac{c}{a} $: $$ x^2 + \frac{b}{a} x = -\frac{c}{a} $$
— Apply the square completion, so add $ \left( \frac{b}{2a} \right)^2 $ to get $$ x^2 + \frac{b}{a} x + \left( \frac{b}{2a} \right)^2 = -\frac{c}{a} + \left( \frac{b}{2a} \right)^2 $$
— Simplify $$ \left( x + \frac{b}{2a} \right)^2 = -\frac{c}{a} + \frac{b^2}{4a^2} $$
— Rearrange the fractions on the right over their common denominator $ 4a^2 $: $$ \left( x + \frac{b}{2a} \right)^2 = \frac{b^2-4ac}{4a^2} $$
— Calculate the square root: $$ x + \frac{b}{2a} = \pm \frac{\sqrt{b^2-4ac}}{2a} $$
— Isolate $ x $ to get the final formula: $$ x = \frac{ -b \pm \sqrt{b^2-4ac}}{2a} $$
dCode retains ownership of the "Quadratic Formula" source code. Any algorithm for the "Quadratic Formula" algorithm, applet or snippet or script (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, breaker, translator), or any "Quadratic Formula" functions (calculate, convert, solve, decrypt / encrypt, decipher / cipher, decode / encode, translate) written in any informatic language (Python, Java, PHP, C#, Javascript, Matlab, etc.) or any database download or API access for "Quadratic Formula" or any other element are not public (except explicit open source licence like Creative Commons). Same with the download for offline use on PC, mobile, tablet, iPhone or Android app.
Reminder: dCode is an educational and teaching resource, accessible online for free and for everyone.
The content of the page "Quadratic Formula" and its results may be freely copied and reused, including for commercial purposes, provided that dCode.fr is cited as the source.
Exporting the results is free and can be done simply by clicking on the export icons ⤓ (.csv or .txt format) or ⧉ (copy and paste).
To cite dCode.fr on another website, use the link:
In a scientific article or book, the recommended bibliographic citation is: Quadratic Formula on dCode.fr [online website], retrieved on 2025-04-16,