I am trying to observe the behavior of $x\_n \in (0,1)$ defined such that the function
\begin{equation}
f\_n(x):=e^{-1/x}\Bigl(1+\frac{1}{n^2 x^n} \Bigr)
\end{equation}
attains its maximum inside the interval $(0,1)$ at $x=x\_n$.


Upon using the Wolfram alpha, I have found out that as $n \to \infty$ it seems that $x\_n \to 0^+$ and
\begin{equation}
\int\_0^1 f\_n(x) dx \leq 2 \int\_0^{2x\_n} f\_n(x)dx.
\end{equation}


That is, as $n \to \infty$, the graph of $f\_n$ on $(0,1)$ is sufficiently localized around its maximum value.


Now my question are the following two:


1. I am trying to estimate the rate at each $x\_n \to 0^+$ as $n \to \infty$. But I cannot find a nice way to do so.
2. Is the above estimate for the integral correct? How one can prove it? Could anyone please help me with it as well?


This kind of analysis is quite new to me, so I am a bit stuck. I deeply appreciate any help.



Locating the maximum point $x_n$ of $f_n(x):=e^{-1/x}\Bigl(1+\frac{1}{n^2 x^n} \Bigr)$ in $(0,1)$
The maximum $x\_n$ of
$$f\_n(x):=e^{-1/x}\Bigl(1+\frac{1}{n^2 x^n} \Bigr)$$
is the smallest solution in $(0,1)$ of the equation
$$x=n x^n+\frac{1}{n}.$$
For $n\gg 1$ this gives $x\_n\rightarrow 1/n$.


The integral is given by
$$\int\_0^1 f\_n(x)dx=\text{Ei}(-1)+n^{-2}\,\Gamma (n-1,1)+1/e$$
$$\qquad\rightarrow \sqrt{2 \pi } e^{-n} n^{n-\frac{7}{2}}\;\;\text{for}\;\;n\gg 1.$$


Here is a comparison of the exact integral (gold data points) and the asymptote (blue) --- the difference is hardly noticeable for $n>10$.


![](https://i.stack.imgur.com/Emjxs.png)
