5

We can raise a sum to the power of $n$ quickly and easily using Pascal's triangle, due to the binomial theorem:

$$(a+b)^n = \sum_{i=0}^n {n \choose i} a^i b^i$$

For sums of more than one term, we can still do this kind of thing, using multinomial coefficients. For example:

$$(a+b+c)^n = \sum_{i,j,k \in \mathbb{N}}{n \choose i,j,k} a^i b^j c^k,$$

where the multinomial coefficient is assumed to be $0$ if $n \neq i+j+k$.

But there's a related problem that I don't know how to do quickly. Suppose we wish to raise a univariate polynomial to the power of $n$. For example, suppose we're trying to find

$$(ax^2+bx+c)^2.$$

It would be nice to have a quick way of doing this. There's a slow way, of course: using the multinomial theorem and collecting like terms, we can show that this is $$a^2 x^4+2ab x^3+(2ac+b^2)x^2+2bc x+c^2.$$

This formula is quite useful for pen-and-paper/mental arithmetic. In particular, suppose we're trying to square a three digit number, like $431$. Let $x=10$. Then:

$$431^2 = (4x^2+3x+1)^2 = 16 x^4+24x^3+17x^2+6x+1$$

$$= x^5+8x^4+5x^3+7x^2+6x+1 = 185761,$$ which the calculator confirms the correctness of.

Anyway, suppose I wish to cube a four digit number, or something like that, it would be nice to have a way of writing down the formula for $$(ax^3+bx^2+cx+d)^3$$ that's quicker than using the multinomial formula and then carefully collecting like terms.

Question. Is there a quick way of finding the coefficients in an expression like $(ax^3+bx^2+cx+d)^3$?

goblin GONE
  • 67,744

3 Answers3

3

If the roots of $ax^3 + bx^2 + cx + d = 0$ are $\alpha, \beta, \gamma$, then the roots of $(ax^3 + bx^2 + cx+d)^3 = 0$ are, $\alpha, \alpha,\alpha, \beta, \beta, \beta, \gamma, \gamma, \gamma$. We have $$(ax^3+bx^2+cx+d)^3 = a^3(x^9 - S_1 x^8 + S_2 x^7 - \cdots + (-1)^9S_9)$$ where $S_i$ is sum of roots taken $i$ at a time. For example, $S_1 = 3(\alpha + \beta + \gamma) = -3b/a$ etc. It is not difficult to compute these. We have $$S_2 = 3(\alpha^2+\beta^2+\gamma^2) + 9(\alpha\beta + \beta\gamma+\gamma\alpha) =\frac{3b^2}{a^2} + \frac{3c}{a}$$

1

There is a quick way to find the coefficients of the lowest-order terms, namely the Taylor expansion around $x=0$. Coupled with the rules of implicit differentiation, it may lead to fewer multiplications and like-power terms will be automatically collected. Also, it's usually neat and you can make approximations after doing clever manipulations. You can also try to derive n-th order derivative of the expression you have in your mind. However, if you try to derive a most general expression of n-th power of a polynomial, you'll get exactly the multinomial theorem.

In this case, the coefficient of $x^0=d^3$ that is obtained by setting $x=0$ in the expression. The coefficient of $x^1$ would be $3cd^2$ that is obtained by setting $x=0$ in the first derivative and so on.

1

If $p(x)$ is a polynomial, and $q(x) = p^n(x)$, then the coefficients of $q(x)$ can be found by a method I first saw (I think) in generatingfunctionology:

Differentiate $q(x)$ and use that to get a recurrence for the coefficients.

In this case, $q'(x) = np'(x)p^{n-1}(x) $ so $p(x)q'(x) = np'(x)p^{n}(x) = np'(x)q(x) $.

Writing $p(x) =\sum_{i=0}^d p_ix^i $ and $q(x) =\sum_{i=0}^{nd} q_ix^i $, we have $p'(x) =\sum_{i=0}^{d-1} (i+1)p_{i+1}x^i $ and $q(x) =\sum_{i=0}^{nd-1} (i+1)q_{i+1}x^i $.

Applying the standard Cauchy product to $p(x)q'(x) = np'(x)q(x) $, and equating the expressions on each side for the coefficients of $x^m$, we get a recurrence for the $q_i$.

I'll leave the details to others.


(added later)

This also works for $e^{p(x)}$ and $\ln(p(x))$.

If $q(x) =e^{p(x)}$ then $q'(x) = p'(x)e^{p(x)} =p'(x)q(x)$.

If $q(x) =\ln(p(x))$ then $q'(x) =\dfrac{p'(x)}{p(x)} $ so $p'(x) = q'(x)p(x)$.

In both cases, these lead to a recurrence for the coefficients of $q(x)$.

marty cohen
  • 107,799