Can someone give me an example of a function $f$ being analytic but its power series $\sum_{n=0}^{\infty} a_{n}x^{n}$ diverging for some $x$? is it necessarily true that $f$ being analytic implies its power series converges for all $x$? I think that it cannot diverge; however, I'm not very good at coming up with counterexamples. Can someone please help me? I believe that no such $f$ exists.
 A: If it is analytic for all complex values of $x$, then the power series will converge.  However if you mean analytic for all real values of $x$, then the power series will not converge if there is a singularity for some non-real (complex) value.  Simple example: $\frac{1}{1+x^2}$ with power series $\sum_{n=0}^\infty (-1)^nx^{2n}$.
A: It's not exactly clear what you're asking. Being analytic globally (i.e. $f\in \mathcal{H}(\mathbb{C})$) implies that a power series for $f$ centred at $z_0\in \mathbb{C}$ for any $z_0\in \mathbb{C}$ converges globally. On the other hand, a locally analytic function at $z_0\in \mathbb{C}$ has only a local Taylor series approximation. That is, there exists some $R>0$ depending on $z_0$ so that $f$ has a power series 
$$ f(z)=\sum_{k=0}^\infty a_k (z-z_0)^k$$
on $B_R(z_0)$. If we surpass this ball, the series may not converge. For example, take 
$$ f(z)=\frac{1}{1-z}.$$
This function is analytic at $0$, with power series 
$$ f(z)=\sum_{k=0}^\infty z^k$$
valid for $\lvert z\rvert<1$. Of course, at $z=1$, this diverges. You can repeat this sort of analysis on $\mathbb{R}$ with similar examples. For instance, $e^x$ has global power series
$$ e^x=\sum_{k=0}^\infty \frac{x^k}{k!},$$ 
while the geometric series is only convergent within a radius of $1$ of the origin as in the complex case.
