
76 Introduction to Computational Modeling
The given data for this problem are the values of the coefficients of the quadratic
equation: a, b, and c. Because this mathematical model is a second degree equation,
the solution consists of the value of two roots: x
1
and x
2
.
6.3.2 Algorithm for General Solution
The general solution gives the value of the two roots of the quadratic equation,
when the value of the coefficient a is not zero (a 6= 0). The values of the two roots
are:
x
1
=
−b +
√
b
2
−4ac
2a
x
2
=
−b −
√
b
2
−4ac
2a
The expression inside the square root, b
2
−4ac, is known as the discriminant.
If the discriminant is negative, the solution will involve complex roots. ...