# Finding Roots Of Fraction Polynomials In Matlab(Illustrated Expression)

Polynomes can be in fraction form. Finding out the roots of this kinds of polynomes can be very tough with hand in calculus. In Matlab, you can do it in a very basic way with ‘residue()’ command. In here, we explained how to find the roots of fraction polynomials in Matlab with ‘residue()’ command, with a very basic example below.

### How To Use ‘residue()’ Command In Matlab?

There are two of cases to find fraction polynomial’s roots. First case is the situation that degree of numerator polynomial is lower than degree of denumerator. Second case is reverse situation of this.

Case when degree of numerator polynomial is lower than denumerator polynomial;

In this case, the result will be in the form of; residual1/(x-root1) + residual2/(x-root2) + residual3/(x-root3)…

As you see above, each residuals and roots are given at results as shown by red arrows above. From top to down, each numbers represent related residuals and roots in above from, from left to right. For example, residual1 = -0.1404 + 0.6146i, root1 = 1.8111 + 0.7653i. Logic is same for other roots and residuals.

You need to understand the logic of definition of polynomials in Matlab. Numerator and denumerators of fraction polynomials are also polynomials, and these polynomials are represented by vectors named ‘numerator’ and ‘denumerator’ as in green box above. You can give other names such as ‘a’ and ‘b’ to these vectors in Matlab. For example ‘numerator’ vector respresents the polynomial of x^2+2x+3. All the coefficients of this polynomial are at the ‘numerator’ vector from left to right. This logic is same for all polynomials that defined in Matlab.

Use of ‘residue()’ command in Matlab is very easy. You need to define result variables like above such as ‘residuals’ and ‘roots’ into the brackets as shown by green arrows above. You can give other names to these variables. You need to equlize that with residual() command, and you need to type the ‘numerator’ and ‘denumerator’ vectors into this command as shown in red box above.

The case when degree of numerator polynomial is bigger than denumerator polynomial;