I'm trying to evaluate a polynomial recursively using Horner's method.
It's rather simple when I have every value of $x$ (like: $x+x^2+x^3…$), but what if I'm missing some of those? Example: $-6+20x-10x^2+2x^4-7x^5+6x^7$.
I would also appreciate it if someone could explain the method in more detail, I've used the description listed here but would like some more explanation.
Best Answer
$6x^7-7x^5+2x^4-10x^2+20x-6$ =
$6x^7+0x^6-7x^5+2x^4+0x^3-10x^2+20x-6$
The method is essentially start with the coefficient of the highest power, multiply by $x$ and add the next coefficient. Stop when you add the constant coefficient.
So steps in the iteration go:
$6$
$6x[+0]$
$6x^2-7$
$6x^3-7x+2$
$6x^4-7x^2+2x[+0]$
$6x^5-7x^3+2x^2-10$
$6x^6-7x^4+2x^3-10x+20$
$6x^7-7x^5+2x^4-10x^2+20x-6$
Trust this helps