Quadratic equation

In mathematics, a quadratic equation is a univariate polynomial equation of the second degree. A general quadratic equation can be written in the form :$$ax^2+bx+c=0$$, where $$x$$ represents a variable or an unknown, and $$a$$, $$b$$, and $$c$$ are constants with $$a \neq 0$$. (If $$a=0$$, the equation is a linear equation.)

Quadratic formula

 * $$ax^2+bx+c=0$$
 * $$x^2+\frac{b}{a}x+\frac{c}{a}=0$$
 * $$x^2+\frac{b}{a}x+\left(\frac{b}{2a}\right)^2-\left(\frac{b}{2a}\right)^2+\frac{c}{a}=0$$
 * $$\left(x+\frac{b}{2a}\right)^2-\frac{b^2}{4a^2}+\frac{c}{a}=0$$
 * $$\left(x+\frac{b}{2a}\right)^2-\frac{b^2-4ac}{4a^2}=0$$
 * $$\left(x+\frac{b}{2a}\right)^2=\frac{b^2-4ac}{4a^2}$$
 * $$x+\frac{b}{2a}=\pm\sqrt{\frac{b^2-4ac}{4a^2}}$$
 * $$x+\frac{b}{2a}=\pm\frac{\sqrt{b^2-4ac}}{2a}$$
 * $$x=-\frac{b}{2a}\pm\frac{\sqrt{b^2-4ac}}{2a}$$
 * $$x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}$$(Quadratic Formula)

Discriminant
In the quadratic formula, the expression underneath the square root sign is called the discriminant of the quadratic equation, and is often represented using an upper case $$D$$ or an upper case Greek delta $$\Delta$$:

$$D=\Delta=b^2-4ac$$

Hence the quadratic formula can be written as $$x=\frac{-b\pm\sqrt{\Delta}}{2a}$$.

Number and Nature of roots
The discriminant can determine the number and nature of roots. Obviously, there are three cases:


 * If the discriminant is positive $$\left(\Delta>0\right)$$, then there are two distinct real roots
 * $$x=\frac{-b-\sqrt{\Delta}}{2a}$$ and $$x=\frac{-b+\sqrt{\Delta}}{2a}$$.


 * If the discriminant is zero $$\left(\Delta=0\right)$$, then there is one real root (/double root/repeated roots)
 * $$x=\frac{-b}{2a}$$.


 * If the discriminant is negative $$\left(\Delta<0\right)$$, then there are two distinct complex (non-real) roots
 * $$x=-\frac{b}{2a}-\frac{\sqrt{-\Delta}}{2a}i$$ and $$x=-\frac{b}{2a}+\frac{\sqrt{-\Delta}}{2a}i$$, where $$i$$ is the imaginary unit.

Equation with knwon roots
Suppose $$\alpha$$ and $$\beta$$ are the roots of a quadratic equation. We have
 * $$\left(x-\alpha\right)\left(x-\beta\right)=0$$
 * $$x^2-\left(\alpha+\beta\right)x+\alpha\beta=0$$

i.e. If $$\alpha$$ and $$\beta$$ are the roots of a quadratic equation, and $$S=\alpha+\beta$$ and $$P=\alpha\beta$$, then the quadratic equation is given by
 * $$x^2-Sx+P=0$$.

Relationship between roots and the coefficients
All quadratic equation $$ax^2+bx+c=0$$ can be transformed into
 * $$x^2+\frac{b}{a}x+\frac{c}{a}=0$$.

By comparing it with
 * $$x^2-\left(\alpha+\beta\right)x+\alpha\beta=0$$,

we have
 * $$\alpha+\beta=-\frac{b}{a}$$ and $$\alpha\beta=\frac{c}{a}$$,

where $$\alpha$$ and $$\beta$$ are the roots of the quadratic equation $$ax^2+bx+c=0$$.