# Find asymptotics of a function

Can Mathematica find the asymptotics of a function in the following sense?

I have

Log[1/n^2]/Log[4^(-Sqrt[Log[n]]) + (2^(-Sqrt[Log[n]]) - 1)^2]


and I would like to know an asymptotic approximation when $n$ is large. That is a simple function that is within a constant multiplicative value in the limit when $n \rightarrow \infty$. If instead it was

Log[1/n^2]/Log[4^(-Sqrt[Log[n]]) + (2^(-Sqrt[Log[n]]))^2]


then I know that

Log[1/n^2]/Log[4^(-Sqrt[Log[n]]) + (2^(-Sqrt[Log[n]]))^2]/Sqrt[Log[n]]


tends to a constant value. My question is how could you use Mathematica to discover that $\sqrt{\log{n}}$ is the right answer in the second case and to find whatever the right solution is in the first case?

By trial and error I happen to know that the right answer in the first case is somewhere between $2^{\log^{1/2}{n}}$ and $2^{\log^{1/2+\epsilon}{n}}$.

-
 Could you please put parentheses around 2^-... and 4^-... ? – b.gatessucks Dec 12 '12 at 20:52 Done. I hope that is clearer. – lip1 Dec 12 '12 at 20:55 What is connection between 2nd and 3rd formulas? – Vitaliy Kaurov Dec 12 '12 at 21:00 You ought to help Mathematica ought with some simple analysis first. The solution in the first case looks like $O(2^{\sqrt{\text{Log}[n]}}\text{Log}\left[n\right])$; recognizing this, you can ask MMA to take the limit of the ratio for you (demonstrating it is correct and obtaining the constant in the process). – whuber Dec 12 '12 at 21:02 @VitaliyKaurov, The third is just the second divided by $\sqrt{\log{n}}$. This is a constant in the limit so $\sqrt{\log{n}}$ is asymptotically equal to the second formula under my definition. – lip1 Dec 12 '12 at 21:04

For the first equation, the substitution $z= 2^{\sqrt{\log n}}$ with the inverse relation $n = \exp[ (\log_2 z)^2]$ seems to be worth to try. Note that with $n\to\infty$ also $z\to\infty$. So we try

sub=Simplify[Log[1/n^2]/ Log[4^(-Sqrt[Log[n]]) + (2^(-Sqrt[Log[n]]) - 1)^2] /. n -> Exp[Log[2, z]^2], z > 1]

with the result

-((2 Log[z]^2)/(Log[2]^2 Log[(2 - 2 z + z^2)/z^2])).

And next

PowerExpand[Series[sub, {z, \[Infinity], 4}] /. {z -> 2^Sqrt[Log[n]]}]

which yields the asymptotic expansion

$$\log (n) 2^{\sqrt{\log (n)}}+\frac{2 \log (n)}{3\ 2^{\sqrt{\log (n)}}}+\frac{\log (n)}{\left(2^{\sqrt{\log (n)}}\right)^2}+\frac{56 \log (n)}{45 \left(2^{\sqrt{\log (n)}}\right)^3}+\frac{4 \log (n)}{3 \left(2^{\sqrt{\log (n)}}\right)^4}+O\left(\left(\frac{1}{2^{\sqrt{\log (n)}}}\right)^5\right).$$

I believe for the second problem another substitution might do the trick.

-
 That's very nice, thanks. – lip1 Dec 12 '12 at 21:24