### 11.1.14 Rewriting in terms of the powers of (x−a)

The ptayl command finds the Taylor expansion for a polynomial (which will be finite).

- ptayl takes two arguments:
  - P, a polynomial given by a symbolic expression or by the list of its coefficients.
  - a, a number.
- ptayl(P,a) returns the polynomial T such that P(x)=T(x−a).

#### Examples

ptayl(x^2+2*x+1,2)

Output, the polynomial T:

x2+6 x+9 |  |  |  |  |  |  |  |  |  |

ptayl([1,2,1],2)

| ⎡ ⎣ | 1,6,9 | ⎤ ⎦

i.e. x2+2x+1=(x−2)2+6(x−2)+9.