Roots of Quadratic Equation using Sridharacharya Formula
The roots could be found using the below formula (It is known as the formula of Sridharacharya)
The values of the roots depend on the term (b2 – 4ac) which is known as the discriminant (D).
If D > 0:
=> This occurs when b2 > 4ac.
=> The roots are real and unequal.
=> The roots are {-b + √(b2 – 4ac)}/2a and {-b – √(b2 – 4ac)}/2a.
If D = 0:
=> This occurs when b2 = 4ac.
=> The roots are real and equal.
=> The roots are (-b/2a).
If D < 0:
=> This occurs when b2 < 4ac.
=> The roots are imaginary and unequal.
=> The discriminant can be written as (-1 * -D).
=> As D is negative, -D will be positive.
=> The roots are {-b ± √(-1*-D)} / 2a = {-b ± i√(-D)} / 2a = {-b ± i√-(b2 – 4ac)}/2a where i = √-1.
JavaScript Program to Solve Quadratic Equation
In this article, we are going to solve Quadratic equations with the help of JavaScript, A quadratic equation is a polynomial equation of degree 2, represented as ax2 + bx + c = 0.
ax2 + bx + c = 0
where a, b and c are real numbers and a ≠ 0
A quadratic equation’s zeros, also known as roots, are the values of x that satisfy the equation when substituted, resulting in the left-hand side being equal to zero.