I am facing the following problem: I want to expand the expression
exp=Tan[Sum[Subscript[a, k] x^((2 k + 1)/2), {k, 0, n}]];
in a series around $x=0$. Using
Series[exp /. n -> 2, {x, 0, 2}]
works as intended and gives a result within a moment.
The problem is expanding up to higher orders in $n$. Run times explode for $n>10$, with a wall time for $n=10$ of $88\, \mathrm{s}$ and for $n=11$ I was not able to get a result at all, having it run for more then 15 minutes, on an [email protected] machine. Of course computing higher derivatives of this expression gets harder with every order but given the rather simplistic form of the argument of $\tan$ I would expect it to work faster given the fact that there is nothing to fancy involved in terms of algebra.
Are there any tricks to speed up this expansion? I tried using assumptions like
$Assumptions = (And @@ (Element[Subscript[a, #], Reals] &) /@
Range[1, 15])
but without success.
In my despair I turned to my second computer algebra program - Maple - and it can expand this expression with its series()
method much much faster. $n=20$ takes only around $.5\,\mathrm{s}$.
Which leave me with to possible conclusions: Either I am not aware of steps to take to enable Mathematica to use its Series[]
method much faster or Mathematica's Series[]
method is not very good.
I would really like to keep all computations in Mathematica since I need the expanded result for further processing.