I am aware that the following convergence result is true from a setof notes on real analysis:
$$ \log (1+x)=\sum_{n=1}^{\infty}(-1)^{n-1} \frac{x^{n}}{n} \quad \forall x \in(-1,1].$$
where log denotes the natural logarithm. Then, how come it is not valid outside this interval? I understand that the ratio test gives that the above expression diverges for $x>1$, but the logarithm of $3$ is well-defined. What is happening? What is the more general result about Taylor expansions of real-valued functions?
This is what I understand. This is the statement of Taylor's theorem:
Theorem 1 (Taylor's Theorem): Let $f:[a, b] \rightarrow \mathbb{R}$ where $b>a$ and $n \in \mathbb{N}$. Suppose $f^{(k)}(x)$ exist for every $x \in[a, b]$ and $f^{(k)}$ are continuous on $[a, b]$ for $k=0, \cdots, n-1$, and $f^{(n)}$ exists on $(a, b)$. Then there is a number $\xi \in(a, b)$ such that $$ f(b)=\sum_{k=0}^{n-1} \frac{f^{(k)}(a)}{k !}(b-a)^{k}+\frac{f^{(n)}(\xi)}{n !}(b-a)^{n} $$ That is, there is $\xi \in(a, b)$, the error term $$ E_{n}(a, b)=f(b)-P_{n-1}(b)=\frac{f^{(n)}(\xi)}{n !}(b-a)^{n} $$ (called the remainder in Lagrange form), where $P_{n-1}(x)=\sum_{k=0}^{n-1} \frac{f^{(k)}(a)}{k !}(x-a)^{k}$.
However, the existence of a Taylor expansion hinges on whether or not the error converges to zero:
Corollary 2: Let $f:[a, b] \rightarrow \mathbb{R}$ have continuous derivatives of all orders on $[a, b]$, and $$ E_{n}=\frac{|b-a|^{n}}{n !} \sup _{\xi \in[a, b]}\left|f^{(n)}(\xi)\right| $$ Then $$ \left|f(x)-\sum_{k=0}^{n-1} \frac{f^{(k)}(a)}{k !}(x-a)^{k}\right| \leq E_{n} \quad \text { for } x \in[a, b] . $$ In particular if $E_{n} \rightarrow 0$ as $n \rightarrow \infty$, then $$ f(x)=\sum_{k=0}^{\infty} \frac{f^{(k)}(a)}{k !}(x-a)^{k} \quad \text { uniformly on }[a, b] . $$
So the general result is that infinite Taylor expansions of real-valued functions only exist for certain neighbourhoods where the error does converge to zero. Hence why my book defines the logarithm as the inverse of the exponential: so that the largest domain on which $\log(1+x)$ is well-defined $(-1,\infty)$ is as large as possible, which we would not achieve through a direct Taylor expansion definition of $\log$. However, $\exp$ is defined through its power series because it causes no convergence issues. Am I correct? Are there other examples of functions whose range-of-infinite-Taylor-expandability is smaller than the domain on which the function is well-defined?