Equation of form ax^2+bx+c=0 where a,b,c are real numbers and a!=0 (if a=0 then equation becomes linear: bx+c=0), is called quadratic. If a=1, then quadratic equation is called reduced, if a!=1 - equation is called unreduced. a is called first coefficient, b is called second coefficient, c is free member.

Roots of the quadratic equation can be found using formula x=(-b+-sqrt(b^2-4ac))/(2a).

Expression D=b^2-4ac is called discriminant of the quadratic equation.

There are three possible cases:

1. If D<0, equation doesn't have roots;
2. If D=0, equation has one root; it is also said that equation has two equal roots;
3. If D>0, equation has two roots.

Now, formula for roots of the equation can be rewritten as x=(-b+-sqrt(D))/(2a).

If b=2k, then x=(-k+-sqrt(k^2-ac))/a , where k=b/2. This formula is especially useful when b is even, i.e. k is integer.

Example 1. Solve equation 2x^2-5x+2=0.

Here a=2,b=-5,c=2. Now find discriminant: D=b^2-4ac=(-5)^2-4*2*2=9.

Since D>0 then equation has two roots: x=(-(-5)+-sqrt(9))/(2*2)=(5+-3)/4.

So, x_1=(5+3)/4=2 and x_2=(5-3)/4=1/2 are roots of given equation.

Example 2. Solve x^2-6x+9=0.

Here a=1,b=-6,c=9. Since b is even we use formula for roots with k: k=b/2=(-6)/2=-3.

x=(-k+-sqrt(k^2-ac))/a=(-(-3)+-sqrt((-3)^2-1*9))/1=3+-sqrt(0)=3.

Thus, the only root of the equation is x=3.

Example 3. Solve 2x^2-3x+5=0.

Here a=2,b=-3,c=5. Now find discriminant: D=b^2-4ac=(-3)^2-2*5=-1.

Since D<0, equation doesn't have roots.