Quadratic Roots

Note

A quadratic equation is one which looks like below:

ax2+bx+c

The Discriminant is defined as follows:

Δ = √(b2-4ac)

( Δ ) determines the type of roots:

  • Δ > 0 :
    • Roots are real and different.
  • Δ == 0 :
    • Roots are real and equal.
  • Δ < 0 :
    • Roots are complex conjugates.

The roots are given by:

x1,x2=(-b∓Δ)/2a

Java

Python