# Fractals/Mathematics/Roots

Finding roots of equation

# Root

Names
* roots
* zeros
* solutions of the equations
* x-intercepts

# Relation between roots and coefficients of the polynomial

* math.stackexchange question: parameter-plane-dynamics-of-fixed-points-and-their-preimages-for-standard-quadratic
* monodromy is the study of how objects behave as they "run round" a singularity

# Methods

* Newton method
* "A useful way to visualize the roots of a complex function is to plot the 0 contours of the real and imaginary parts. That is, compute z = Dm(...) on a reasonably dense grid, and then use matplotlib's contour function to plot the contours where z.real is 0 and where z.imag is zero. The roots of the function are the points where these contours intersect." Warren Weckesser
Papers:
* A comparison of solution methods for Mandelbrot-like polynomials by Eunice Y. S. Chan
Programs:
* Free Online Polynomials root finder (factoring)
* gsl : Example-programs-for-Multidimensional-Root-finding
* mpsolve
* Complex polynomial roots toy by Leo C. Stein
* Numerical computation of the roots of Mandelbrot polynomials: an experimental analysis by Dario A. Bini 2023

# Examples

* Example image with code showing importance of precision in solving equations

## quadratic equation

A quadratic equation (from the Latin quadratus for "square") is any equation having the form
    $ax^{2}+bx+c=0$
where x represents an unknown, and a, b, and c represent known numbers such that a is not equal to 0. If a = 0, then the equation is linear, not quadratic. The numbers a, b, and c are the coefficients of the equation, and may be distinguished by calling them, respectively, the quadratic coefficient, the linear coefficient and the constant or free term.
Although the quadratic formula provides an exact solution, the result is not exact if real numbers are approximated during the computation, as usual in numerical analysis, where real numbers are approximated by floating point numbers (called "reals" in many programming languages). In this context, the quadratic formula is not completely numerical stable.
This occurs when :
* the roots have different order of magnitude, or, equivalently, when b$^2$ and b$^2$ − 4ac are close in magnitude. In this case, the subtraction of two nearly equal numbers will cause loss of significance or catastrophic cancellation in the smaller root. To avoid this, the root that is smaller in magnitude, r, can be computed as $(c/a)/R$ where R is the root that is bigger in magnitude.
* a second form of cancellation can occur between the terms b$^2$ and 4ac of the discriminant, that is when the two roots are very close. This can lead to loss of up to half of correct significant figures in the roots.
When the term inside the square root (the "Discriminant") goes negative, i.e.
then doesn't have real roots, but have complex roots. ( see square root of negative number)

### square root of Negative or complex number

If S is negative real numnber :
    $\operatorname {Re} (S)<0$
    $\operatorname {Im} (S)=0$
then its principal square root is
    ${\sqrt {S}}={\sqrt {\vert S\vert }}\,\,i\,.$
If S is a complex number : S = a+bi where a and b are real and b ≠ 0,
then its principal square root ( = the root with the non-negative real part) is :
    ${\sqrt {S}}={\sqrt {\frac {\vert S\vert +a}{2}}}\,+\,\operatorname {sgn}(b){\sqrt {\frac {\vert S\vert -a}{2}}}\,\,i\,.$
where :
    $\vert S\vert ={\sqrt {a^{2}+b^{2}}}$
is the absolute value (modulus) of S.
This can be verified by squaring the root.

# See also

* How to analyze discrete dynamical system based on the map f ?

# References

* Geometry of polynomials and root-finding via path-lifting, February 2018 Nonlinearity 31(2):414-457 DOI: 10.1088/1361-6544 by Myong-Hi Kim, Marco Martens, Scott Sutherland
* ↑ Zero_of_a_function in wikipedia
* ↑ Equation_solving in wikipedia
* ↑ stackoverflow question : storing-roots-of-a-complex-function-in-an-array-in-scipy
* ↑ Protters & Morrey: " Calculus and Analytic Geometry. First Course"
* ↑ HOW DO YOU SOLVE A QUADRATIC EQUATION? BY GEORGE E._ FORSYTHE
* ↑ Kahan, Willian (November 20, 2004), On the Cost of Floating-Point Computation Without Extra-Precise Arithmetic
* ↑ Higham, Nicholas (2002), Accuracy and Stability of Numerical Algorithms (2nd ed.), SIAM, p. 10, ISBN 978-0-89871-521-7
* ↑ Abramowitz, Miltonn; Stegun, Irene A. (1964). Handbook of mathematical functions with formulas, graphs, and mathematical tables. Courier Dover Publications. p. 17. ISBN 0-486-61272-4., Section 3.7.26, p. 17
* ↑ Cooke, Roger (2008). Classical algebra: its nature, origins, and uses. John Wiley and Sons. p. 59. ISBN 0-470-25952-3., Extract: page 59