One can either use SumConvergence
or Sum
with GenerateConditions -> True
(thanks to a comment by Artes). As an example:
Sum[Cos[n] x^n, {n, 1, Infinity}, VerifyConvergence -> True, GenerateConditions -> True]
ConditionalExpression[-((x (1 + E^(2 I) - 2 E^I x))/(2 (E^I - x) (-1 + E^I x))), x != E^I && E^I x != 1 && Abs[x] < 1]
Unfortunately, SumConvergence
doesn't seem to work:
SumConvergence[Cos[n] x^n, n]
SumConvergence[Cos[n] x^n, n, Assumptions -> -1 < x < 1]
SumConvergence[Cos[n] x^n, n, Method -> "RatioTest"]
SumConvergence[Cos[n] x^n, n, Method -> "RootTest"]
SumConvergence[Cos[n] x^n, n, Method -> "RaabeTest"]
SumConvergence[Cos[n] x^n, n, Method -> "IntegralTest"]
Below, I work through some of the theory and do this also numerically.
The radius of convergence $R$ is given by
$$
\frac{1}{R} = \lim_{n\to\infty}\sup(\sqrt[n]{|a_n|})
$$
In this case, the coefficients are $\frac{1}{n!}$, which is a monotonically decreasing sequence, and so for our case, this becomes
$$
\frac{1}{R} = \lim_{n\to\infty}\frac{1}{n!}
$$
Using Mathematica,
Limit[1/Factorial[n], n -> ∞]
(* 0 *)
and hence the radius of convergence is infinity, as it should be for the Taylor series of the exponential function.
Here is an example with a more complicated function. Consider the series
$$
\sum_{n=1}^{\infty}\cos(n)x^n.
$$
In Mathematica, we get
Sum[Cos[n] x^n, {n, 1, \[Infinity]}] // ExpToTrig;
(Numerator@% Conjugate@Denominator@% // ComplexExpand)/( Denominator@% Conjugate@Denominator@% // ComplexExpand) // Simplify
(* (x (-x + Cos[1]))/(1 + x^2 - 2 x Cos[1]) *)
Plotting this function, we get
Plot[{(x (-x + Cos[1]))/(1 + x^2 - 2 x Cos[1]), Sum[Cos[n] x^n, {n, 1, 50}]}, {x, -1.01, 1.01}]
which suggests that the radius of convergence is 1. We can verify this numerically in the following way. Make a table of values of the coefficients:
tbl = Table[(N@Abs[Cos[n]])^(1/n), {n, 1, 10000}];
Then compute the maxima of successively larger subsets of the values and plot them:
Table[Max[tbl[[;; kk]]], {kk, 1, 10000}] // ListPlot
That sure appears to be equal to one!