# Is my general polynomial division correct?

I want to divide the general function $$f(x) = \sum_{i = 0}^{n} a_i x^i$$ by $(x - x_0)$.

Is my result correct? $$f(x) = (x - x_0) \left(\sum_{i = 1}^n \sum_{j = i}^n (a_j x_0^{i - 1} x^{i - 1}) + \frac{\sum_{k = 0}^n \sum_{l = k}^n (a_k x_0^{l - k})}{x - x_0}\right)$$

Not really. Theory says that there exists some polynomials $P$ and $Q$ such that $\forall x, f(x)=P(x)(x-x_0)+Q(x)$ with $\deg Q < 1$, that is to say $Q=c \in \mathbb R$.
Plugging $x=x_0$ in the previous equality yields $c=f(x_0)=\sum_{i = 0}^{n} a_i x_0^i$.
Hence $\forall x, f(x)-f(x_0)=P(x)(x-x_0)$, which may be rewritten as $$\forall x, \sum_{i=0}^n a_i (x^i-x_0^i)=P(x)(x-x_0)$$
Using this identity yields $$\forall x, (x-x_0)\sum_{i=1}^n \sum_{k=0}^{i-1} a_i x_0^{i-1-k} x^k = P(x)(x-x_0)$$
Hence $P(x)=\sum_{i=1}^n \sum_{k=0}^{i-1} a_i x_0^{i-1-k} x^k$ and $Q(x)=\sum_{i=0}^n a_i x_0^i$, that is to say $$f(x) = (x-x_0) \left(\sum_{i=1}^n \sum_{k=0}^{i-1} a_i x_0^{i-1-k} x^k + \frac{\sum_{i=0}^n a_i x_0^i}{x-x_0} \right)$$