# 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
show 6 more comments

## 1 Answer

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
lang-mma
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 12, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "github"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.9129230380058289, "perplexity_flag": "middle"}