# How to do this series expansion with Mathematica

Consider for large integers $n$ the expression $\sin \left(\pi \sqrt{4 n^2+n}\right)$.

Since

$\sqrt{4 n^2+n}=2 n \sqrt{1 + \frac{1}{4 n}}$

we can use the standard series for the square root and next the standard series for $sin$ to find a series expansion of this expression around $\infty$. That is a simple first year exercise.

I was unable to do this computation in an elegant way with Mathematica. I expected the following to work:

Series[Sin[Sqrt[n+4 n^2] \[Pi]], {n,\[Infinity],3}, Assumptions->{n\[Element]Integers}]


$\sin \left(2 \pi n+\frac{\pi }{4}-\frac{\pi }{64 n}+\frac{\pi }{512 n^2}-\frac{5 \pi }{16384 n^3}+O\left(\left(\frac{1}{n}\right)^4\right)\right)$

To my surprise, the expansion is only inside Sin and the fact that n is an integer is not used.

I tried to use Normal and TrigExpand without success. Finally I found a rather dirty trick to obtain the result I was looking for:

Series[Sin[Sqrt[n + 4 n^2] \[Pi]], {n, \[Infinity], 3}]  /.  Sin[x_] :> Sin[x - 2 \[Pi] n]


$\frac{1}{\sqrt{2}}-\frac{\pi }{64 \sqrt{2} n}+\frac{\frac{\pi }{512 \sqrt{2}}-\frac{\pi ^2}{8192 \sqrt{2}}}{n^2}+\frac{-\frac{5 \pi }{16384 \sqrt{2}}+\frac{\pi ^2}{32768 \sqrt{2}}+\frac{\pi ^3}{1572864 \sqrt{2}}}{n^3}+O\left(\left(\frac{1}{n}\right)^4\right)$

Can this result be found in a more straightforward way?

Edit

Let us reconsider

Series[Sin[Sqrt[n + 4 n^2] \[Pi]], {n, \[Infinity], 3}, Assumptions -> {n \[Element] Integers}]


$\sin \left(2 \pi n+\frac{\pi }{4}-\frac{\pi }{64 n}+\frac{\pi }{512 n^2}-\frac{5 \pi }{16384 n^3}+O\left(\left(\frac{1}{n}\right)^4\right)\right)$

Henric Schumacher is quite right in his assumption that we do not find a series expansion, but only a series expansion wrapped in Sin, because Sin has an essential singularity at Infinity. The documentation of Series, under Possible Issues, shows something similar. So this should not have surprised me.

The assumption that nis an integer has not prevented the appearance of the term 2\[Pi]n in the argument of Sin. Without that term, the result would immediately further evaluate to the result we are looking for. So we have to get rid of this term.

The argument of Sin is a SeriesData expression, which is atomic. Therefore, the substitution 2\[Pi]n->0 does not work. But assignment is possible:

sd=Series[Sin[Sqrt[n+4 n^2] \[Pi]],{n,\[Infinity],3}];
sd[[1,3,1]]=0;
sd


$\frac{1}{\sqrt{2}}-\frac{\pi }{64 \sqrt{2} n}+\frac{\frac{\pi }{512 \sqrt{2}}-\frac{\pi ^2}{8192 \sqrt{2}}}{n^2}+\frac{-\frac{5 \pi }{16384 \sqrt{2}}+\frac{\pi ^2}{32768 \sqrt{2}}+\frac{\pi ^3}{1572864 \sqrt{2}}}{n^3}+O\left(\left(\frac{1}{n}\right)^4\right)$

Another way of getting rid of the term 2\[Pi]n is to use Normal and FullSimplify with the assumption that n is an integer, as done in the answer of Mikado. After that, we need another call of Series to arrive at the desired result.

To summarize: at the moment, it seems that there is no straightforward way for finding this series expansion by Mathematica, while it is easily found with pen and paper.

• Maybe the reason is that there are infinitely many summands in the Laurant series expansion of Sin at Infinity? Exactly as Exp, Sin has an essential singularity at Infinity. Things like SeriesCoefficient[Sin[x], {x, Infinity, -5}] work fine. – Henrik Schumacher Aug 31 '18 at 19:37
• @Henrik: please see the edit. – Fred Simons Sep 1 '18 at 8:02
• Could use Series twice, with Normal and Refine in the middle to handle the n integrality. In[2]:= Series[ Refine[Normal[ Series[Sin[Sqrt[n + 4 n^2] \[Pi]], {n, \[Infinity], 3}]], Assumptions -> {n \[Element] Integers}], {n, \[Infinity], 3}] Out[2]= SeriesData[n, DirectedInfinity[1], { 2^Rational[-1, 2], Rational[-1, 64] 2^Rational[-1, 2] Pi, Rational[1, 512] 2^Rational[-1, 2] Pi + Rational[-1, 8192] 2^Rational[-1, 2] Pi^2, Rational[1, 3145728] ((-480) 2^Rational[1, 2] Pi + 48 2^Rational[1, 2] Pi^2 + 2^Rational[ 1, 2] Pi^3)}, 0, 4, 1] – Daniel Lichtblau Sep 1 '18 at 18:05
• Oops, I missed the substantially similar response by @Mikado. (I thought I had made the same comment yesterday but I guess I never submitted it.) – Daniel Lichtblau Sep 1 '18 at 18:08

Assuming[n ∈ Integers,