There are many techniques and algorithms used to find (approximate) roots or zeros of functions: bisection, Newtonโs Method, secant method, Mรผllerโs Method.
Consider the polynomial \(p(x) = x^2\text{.}\) This polynomial only has one x-value, at which it takes the value 0, namely x = 0. Since the graph of p does not cross the x-axis at x=0, this root is actually of multiplicity greater than 1 and is called a degenerate root. MATLAB figures this out and lists such roots multiple times in the vector of roots (according to multiplicity). Take a look:
If the roots of a polynomial are known, MATLAB can actually construct the polynomial, that is, the coefficients of the polynomial, assuming that the leading coefficient equal 1. Here is an example: Suppose we wanted to find a polynomial with roots 6.5, 4, 2.3, 0.5 and -1.2. We know that the polynomial is given by