[Math] Polynomial shift

polynomials

Suppose there is a polynomial:

$p(x) = a_0x^n + a_1x^{n-1} + … + a_{n-1}x + a_{n}$

I would like to "shift" it (I'm not sure what is the right term), by substituting $x$ for some other function of $x$.

What I mean is that I would like to "transform" the polynomial by replacing the $x$ by $x+1$, for example:

$p(x) = a_0(x+1)^n + a_1(x+1)^{n-1} + … + a_{n-1}(x+1) + a_{n}$

I could do it by expanding each term and then sum the terms of the same order. For example:

$x^2 – 1$ —> $(x+1)^2 – 1$ —> $(x^2 + 2x + 1) – 1$ —> $x^2 + 2x$

My question is, is it possible to do such transformation "quickly"? Currently I have to expand every term, add each of its items to the previous item of the same degree and so on. Isn't there a trick which would turn the coefficients $[1, 0, -1]$ into $[1, 2, 0]$ in one go?

If there was such a trick for the above $x+1$ substitution, are there similar tricks for other ones, too? For example $1/x$? Is there a general method of constructing some kind of substitution which turns one set of coefficients into another one?

Best Answer

Yes, there is. The trick is Taylor expansion. If you wanna shift $p(x)=x^2-1$ to $p(x+1)$, then take Taylor expansion at point $x-1$ with $\Delta x=x-(x-1)=1$. $$\begin{align}p(x)&=p(x-1)+p'(x-1)\Delta x+\frac12p''(x-1)\Delta x^2\\&=(x-1)^2-1+2(x-1)+1\\&=(x-1)^2+2(x-1)\end{align}$$ Don't expand it. Just replace $x$ by $x+1$, we have $$p(x+1)=x^2+2x$$

Note this trick is only valid for analytic functions (maybe not?). But I think it be faster than substitution only for polynomials since their Taylor expansion has finite order and easier way to compute derivative.

Related Question