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. Except explicit open source licence (indicated Creative Commons / free), the "Quadratic Formula" algorithm, the applet or snippet (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, translator), or the "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.) and all data download, script, or API access for "Quadratic Formula" are not public, same for offline use on PC, mobile, tablet, iPhone or Android app!

Reminder : dCode is free to use.

The copy-paste of the page "Quadratic Formula" or any of its results, is allowed as long as you cite dCode!

Cite as source (bibliography):

*Quadratic Formula* on dCode.fr [online website], retrieved on 2022-12-09,

formula,quadratic,polynomial,degree,2,second,root

https://www.dcode.fr/quadratic-formula

© 2022 dCode — The ultimate 'toolkit' to solve every games / riddles / geocaching / CTF.

Feedback