Does the integral of a Taylor series converge under “nice” conditions? Let $f:(-r,r)\to\mathbb R$ be a smooth function whose Taylor series at zero has radius of convergence $r$, where $0<r<\infty.$ Suppose further that $f$ is integrable on $(0,r)$, meaning $\int_0^r|f(x)|dx<\infty.$ Note that $f$ may have an integrable pole at $r.$
If the Taylor series is given by $f(x)=\sum_{n=0}^\infty a_0x^n,$ then must
$$\sum_{n=0}^\infty\left(\int_0^r a_nx^ndx\right)=\sum_{n=0}^\infty a_n\frac{r^{n+1}}{n+1}dx$$
converge to $\int_0^r f(x)dx$? If no, what's a counterexample?

I think that for any $r'<r,$ the Taylor series converges uniformly on $(0,r'),$ and hence the above expression with $r\to r'$ must indeed converge to the correct value. But for $r'=r$, the Taylor series only needs to converge pointwise, so I could image situations where the integrated Taylor series diverges.
 A: Assuming the series $\sum_{n=0}^{\infty}\frac{a_n}{n+1}r^{n+1}$ converges in $\Bbb{R}$, the answer is yes. For each $0<\rho<r$, we have, due to uniform convergence of the power series on $[0,\rho]$, that
\begin{align}
\int_0^{\rho}f(x)\,dx &=\int_0^{\rho}\sum_{n=0}^{\infty}a_nx^n\,dx=\sum_{n=0}^{\infty}a_n\int_0^{\rho}x^n\,dx=\sum_{n=0}^{\infty}\frac{a_n}{n+1}\rho^{n+1}.
\end{align}
Now, take the limit as $\rho\to r^{-}$. Then, on the LHS, we get $\int_0^rf(x)\,dx$, by definition of the improper integral, while on the RHS, we get $\sum_{n=0}^{\infty}\frac{a_n}{n+1}r^{n+1}$ by Abel's theorem (see also the applications section for some standard series such as that of $\ln(2)$ and $\arctan(1)$).
What this argument shows is that if the series $\sum_{n=0}^{\infty}\frac{a_n}{n+1}r^{n+1}$ converges in $\Bbb{R}$ then the improper integral $\int_0^{r}f(x)\,dx:=\lim\limits_{\rho\to r^-}f(x)\,dx$ exists in $\Bbb{R}$ and equals the sum.

Edit In Response to Comment:
I assume you're asking whether the following statement (the converse of what I proved above) is true:

If $f(x):=\sum_{n=0}^{\infty}a_nx^n$ is a power series which converges for $|x|<r$ and $\lim\limits_{\rho\to r^-}\int_0^\rho f(x)\,dx$ exists in $\Bbb{R}$, then $\sum_{n=0}^{\infty}\frac{a_nr^{n+1}}{n+1}$ also exists in $\Bbb{R}$ and equals the improper integral above.

It turns out this is false. This is "essentially" a converse to Abel's theorem which I cited above, and it is "well-known" that a direct converse of Abel's theorem is false. One needs additional hypotheses on the decay of the coefficients of the series (these are known as Tauberian theorems as referenced in the other answer).
To see why the statement is false, consider the power series defined for $|x|<1$ as
\begin{align}
f(x):=\sum_{n=0}^{\infty}(n+1)(-1)^{n+1} x^{n}
\end{align}
Its sum is $f(x)=\frac{-1}{(1+x)^2}$ (I essentially took the geometric series $\frac{1}{1+x}=\sum_{n=0}^{\infty}(-1)^nx^n$ and differentiated it for $|x|<1$). From this formula, we see that $f$ even has an analytic extension to $\Bbb{C}\setminus \{-1\}$. Therefore, we clearly have that $\int_0^1|f(x)|\,dx$ exists as a proper Riemann integral. So, here $a_n=(n+1)(-1)^{n+1}$, which means the series in question is
\begin{align}
\sum_{n=0}^{\infty}\frac{a_n(1)^{n+1}}{n+1}=\sum_{n=0}^{\infty}(-1)^{n+1},
\end{align}
which is not a convergent series (since the general term of a convergent series must vanish, but here it just oscillates between $\pm 1$).
A: As you observed,  the series can be integrated termwise (with $0 < r' < r$ ) to obtain
$$F(r') := \int_0^{r'} f(x) \, dx =\int_0^{r'} \sum_{n=0}^\infty a_n x^n \, dx = \sum_{n=0}^\infty\frac{a_n}{n+1} (r')^{n+1},$$
and with $\hat{r } = r'/r$, we have
$$F(r\hat{r}):=G(\hat{r}) = \sum_{n=0}^\infty\frac{a_nr^{n+1}}{n+1} \hat{r}^{n+1}$$
Even under the weaker condition that the improper integral of $f$ over $[0,r)$ converges, the question becomes whether or not
$$\tag{*} \int_0^1 f(x) \, dx = \lim_{\hat{r} \to 1-}G(\hat{r}) = \sum_{n=0}^\infty\frac{a_nr^{n+1}}{n+1} $$
Sufficient conditions for the convergence of the series on the RHS and for (*) to hold are given by Tauberian theorems. See also this.
For example, (*) holds by the first Tauberian theorem if $\lim_{n \to \infty} n \cdot\frac{a_n r^{n+1}}{n+1} = 0$
