<s>[INST] What's wrong with my infinite series expansion for $\log(x)$? Here, log is natural log.
Looking at $f(x)=\frac{1}{x}$, I tried to put $f(x)$ in the form $\frac{a}{1-r}$ that an infinite geometric series $\sum_{n=0}^\infty (a \cdot r^n)$ converges to when $\mid r \mid < 1$.
That gave me $f(x) = \frac{1}{1-(1-x)}$, so that $\sum_{n=0}^\infty (1-x)^n$ should converge to $\frac{1}{x}$ for $0<x<2$.
Now, taking the anti-derivative of $\frac{1}{x}$ gives me $\log(x) + C$, and anti-differentiating $\sum_{n=0}^\infty (1-x)^n$ should give me a power series expansion for $\log(x)$, no?
But I end up with $$\int 1 + (1-x) + (1-x)^2 + ...dx$$
$$= x + x - \frac{1}{2}x^2 + x - x^2 + \frac{1}{3}x^3-...+C$$
And this doesn't look right.
 [/INST] Your problem is from expanding all the terms in parentheses; while it's not wrong, it's obfuscating the point, which is to end up with an expression involving powers of $x - 1$.
So don't expand. Get
$$C + x - \frac{(1 - x)^2}{2} - \frac{(1 - x)^3}{3} - ...$$
I'll leave it to you to check that $C = -1$, so the series is
$$- \left((1 - x) + \frac{(1 - x)^2}{2} + \frac{(1 - x)^3}{3} + \dots\right)$$
After rearranging, this is
$$(x - 1) - \frac{(x - 1)^2}{2} + \frac{(x - 1)^3}{3} - \dots$$
as desired.
</s>