Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have to following problem that I would like to solve.

I have a vector of coefficients $V = [a_N, \ldots ,a_1, a_0]$ which represents the coefficients of a polynomial $P$, i.e.: $$ P(x) = a_N x^N + ... + a_1 x + a_0 $$

I would like to write an algorithm for shifting the curve on the horizontal axis, i.e., given a shift factor $h$ I would like to find a generalized way for automatically writing the coefficients of the polynomial: $$ P(x-h) = a_N (x-h)^N + \ldots + a_1(x-h) + a_0 $$ on MATLAB, without computing them at hand.

Thanks in advance.

share|cite|improve this question
Can't you just define it as a function and use an Expand command? That's what I would think about in Mathematica. There must be a way then to recollect the coefficients into a vector if you want. – Ross Millikan Mar 12 '13 at 13:32

Hoping that by "without calculating them" you mean "without calculating the $(x-h)^k$ polinomials", this should work:

$a^*_{i} = \sum_{j=i}^n\binom{j}{i}a_jh^{j-i}$

share|cite|improve this answer
Is there maybe an error in the binomial coefficient? j cannot be bigger than i, right? – Eleanore Mar 12 '13 at 16:19
Yes, you're right, edited – kaharas Mar 12 '13 at 16:20
Moreover, I think that there is a problem with the signs. For instance, if y=2x+1 is considered, y=2x+7 is obtained, which is not correct I guess. – Eleanore Mar 12 '13 at 16:24
up vote 0 down vote accepted

Based on the answer of kaharas, I will add some corrections.

Given the polynomial: $$ P(x) = a_N x^N + ... + a_1x + a_0 $$ the coefficients of the polynomial: $$ P(x-h) = a_N^* x^N + ... + a_1^* + a_0^* $$ can be found as follows: $$ \left \{ \begin{array}{ll} a_i^* = \sum_{j=i}^N \binom{j}{i} a_j h^{j-i}(-1)^{j-i} & i = 1...N \\ a_0^* = \sum_{j=0}^N a_j h^j (-1)^j & \end{array} \right . $$

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.