$(1+\frac{f(n)}{n})^n\sim\exp(f(n))$? Of course, I know that
$$
\exp(x)=\lim_{n\to\infty}\left(1+\frac{x}{n}\right)^n.
$$
My question is what happens when instead of $x$, we have a real-valued function depending on $n$, i.e. do we also have
$(1+\frac{f(n)}{n})^n\sim\exp(f(n))$?
For example:
$\exp(\log(r+1))\sim \left(1+\frac{\log(r+1)}{r+1}\right)^{r+1}$?
 A: The idea is, for "not so bad" $f$, to compute an asymptotic expansion of $\ln\left(1+\frac{f(n)}{n}\right)$, until we get $o(1)$. Let's consider the following example ...
We would like to obtain a simple equivalent sequence for :
$$u_n=\left(1+\frac{1}{\sqrt{n}}\right)^n$$
which correspond to your question in the special case $f(n)=\sqrt n$.
We have :
$$\ln\left(1+\frac{1}{\sqrt n}\right)=\frac{1}{\sqrt n}-\frac{1}{2n}+o\left(\frac{1}{n}\right)$$
Thus :
$$n\ln\left(1+\frac{1}{\sqrt n}\right)=\sqrt n-\frac{1}{2}+o(1)$$
and hence :
$$\boxed{\left(1+\frac{1}{\sqrt n}\right)^n\sim\exp\left(\sqrt n-\frac{1}{2}\right)}$$
By the way, we see that the equivalence $\left(1+\frac{1}{\sqrt n}\right)^n\sim e^\sqrt n$ is false ...
EDIT :
For your final question, i will rather consider (for convenience) :
$$\left(1+\frac{\ln(r)}{r}\right)^r$$
We have, as $r\to+\infty$ :
$$r\ln\left(1+\frac{\ln(r)}{r}\right)=r\left(\frac{\ln(r)}{r}-\frac{\ln^2(r)}{2r^2}+o\left(\frac{\ln^2(r)}{r^2}\right)\right)$$
and, a fortiori :
$$r\ln\left(1+\frac{\ln(r)}{r}\right)=\ln(r)+o(1)$$
Hence :
$$\left(1+\frac{\ln(r)}{r}\right)^r\sim r$$
In this case, the formula is correct !
A: For example, if $f(n)=n^2$, your approximation leads to $ (1+n)^n\sim e^{n^2}$. But $e^{n^2}/n^{n}\rightarrow\infty$.
If, for example, $f$ is bounded, then your conjecture is true. Moreover, since $\log(1+x)=x+o(x)$, we have $$\left( 1+ \frac{f(n)}{n} \right)^n= \exp \left( n\cdot \log(1+\frac{f(n)}{n}) \right) = \exp \left( f(n)+f(n)o(n) \right)$$ So, if $f(n)$ is "little" in comparison with $o(x)$, your approximation is true; like when $f$ is bounded or $f=O(x)$.
A: When you use $\sim$ in 
$$
\left(1+\frac{f(n)}{n}\right)^n \sim_{n\to\infty} e^{f(n)}
$$
What you are saying is that there exists some finite, non-zero $L$ (which may depend on the specific $f(n)$ you are looking at) such that 
$$
\lim_{n\to\infty} \frac{\left(1+\frac{f(n)}{n}\right)^n }{e^{f(n)}} = L
$$
We can show that this is not true in general.  For example, when $f(n) = n^2$,
$$
\lim_{n\to\infty} \frac{\left(1+\frac{n^2}{n}\right)^n }{e^{n^2}} = 
\lim_{n\to\infty} \frac{\left(1+n\right)^n }{e^{n^2}} = 0
$$
On the other hand, the statement is sometimes true.  Let $f(n) = \sqrt{n}$, then
$$
\lim_{n\to\infty} \frac{\left(1+\frac{\sqrt{n}}{n}\right)^n }{e^{\sqrt{n}}} = 
\lim_{n\to\infty} \frac{\left(1+\frac{1}{\sqrt{n}}\right)^n }{e^{\sqrt{n}}} = \frac{1}{\sqrt{e}}
$$
which is a constant.
It appears that if $f(n)$ grows faster than $O(n)$, the statement is false (the limit is zero.
