# Remainder Theorem

#### Affiliate Links

Forms For Every Occasion — Personalized flows and seamless integrations with world-class user experience. Easily create stylish forms that make data collection a walk in the park. Customized Surveys. Engaging Questionnaires.

**Formula:** `f(k) = ak^n + ... + a1*k + a0`

The Remainder Theorem states that when a polynomial ** f(x)** is divided by a linear divisor of the form

**, the remainder of this division is**

*(x - k)***. To apply this theorem using the formula provided,**

*f(k)***should be the coefficients of the polynomial provided as a space-separated string, ordered from the highest degree to the lowest (e.g., '3 -1 2' corresponds to**

*polynomial***) and**

*3x^2 - x + 2***is the constant**

*value***in the divisor**

*k***. The JavaScript function first converts the polynomial string to an array of numbers, then evaluates the polynomial at the given value using the Horner's method (a efficient way to evaluate polynomials).**

*(x - k)*