AngouriMath

Navigation

← Back to list of members

RootsOverASquareDiscriminant​(AngouriMath.​Entity,​AngouriMath.​Entity,​AngouriMath.​Entity)

 Method (no overloads)

Summary

The two roots, written without a radical, where the coefficients are polynomials and
the discriminant is a rational number times the square of one; otherwise
null.

Remarks

Either square root of the discriminant will do. The roots are (-b - r)/(2a) and
(-b + r)/(2a), the same pair for r and -r, so any r with
r^2 = b^2 - 4ac gives the same set, and a polynomial one needs no absolute value.
a z^2 - (a^2 - bc) z - abc has discriminant (a^2 + bc)^2 and roots
a and -bc/a; through sqrt they were written with the square under
it, and z^2 - (p + q) z + pq with sqrt((p + q)^2 - 4pq) for p - q.
#2140
The numerators are polynomials then too, so each root is reduced by the greatest common
divisor of its numerator and 2a rather than left for a later pass to cancel.
The discriminant's rational factor comes out first, and where its square root is not
rational -- 2 (p - q)^2, or -(p - q)^2 -- the roots are written with it,
sqrt(2) (p - q) and i (p - q), and left as quotients. A discriminant that
is a number is left to the formula, whose evaluation settles it already.

























Angouri © 2019-2026 · Project's repo · Site's repo · Octicons · Transparency · 5629 pages online