# Polynomial Calculator

## By James Park and Woocheol Hyun

Back to main page

This calculator was made as an extra credit math project by James Park and Woocheol Hyun. As it currently is, the calculator can determine all rational roots and irrational roots within x: [-100, 100]. In addition, the calculator can determine y-intercepts, whether the function is odd or even, the first and second derivatives, and local extrema.

### How the function is broken down

When an equation is typed into the input box, the program breaks up the polynomial into terms. For instance, 2x^2+3x-1 would be broken down into 2x^2, 3x, and -1. Next, each separate term is broken down into a coefficient and exponent, which are stored in arrays. Using this information is is then possible to find our desired data.

### How it finds the roots

All rational roots are found using the rational root theorem. Our algorithm finds all possible rational roots and then plugs them into the function until a root is found. Irrational roots are found using Newton's method for approximating roots. A good explanation can be found here.

### How it finds derivatives

Once the program has arrays with the coefficients and exponents the program uses the power rule to find the derivative of the function.

### How it finds y-intercepts

To find the y-intercept of a function the program goes through the array of exponents to find the term with an exponent of 0 (x^0). It then takes the corresponding coefficient. This number is the constant term and will be the y-intercept. If no such term exists, the y-intercept is 0.

### Even or odd

The program sorts the arrays of exponents and coefficients from largest exponent to smallest. Then the calculator finds if the first (largest) exponent is even or odd.

### How it finds the local extrema

Local maximums and minimums are calculated through the derivative of the function. By finding the zeros of the derivatives the program can make a list of possible maxes and mins. Then using signs analysis the program is able to finalize the list of extrema. The program is limited to finding the min/max within the domain x: [-100, 100].