Can I solve this limit in a following way I worked on this limit at class
$\lim_{x\to\infty} (\frac{x}{1+x})^x$
And I solved it the following way:
$\lim_{x\to\infty}\exp(x\ln(\frac{x}{1+x}))$
$\lim_{x\to\infty}\exp(x\ln(\frac{1}{1+\frac{1}{x}}))$
$\exp(\lim_{x\to\infty} x\ln(\frac{1}{1+\frac{1}{x}}))$
$\exp(\lim_{x\to\infty} x(\ln(1) - \ln(1+\frac{1}{x})))$
And then I did distribution of x like this. Which, I was said, is totally wrong, but I'm not sure why.:
$\exp(\lim_{x\to\infty} (\ln(1^x) - \ln(1+\frac{1}{x})^x))$
And then I used the fact that $\lim_{x\to\infty} \ln(1+\frac{1}{x})^x = 1 $
And got this:
$\exp(0 - 1) = e^{-1} $
I know the answer is correct, but I assume that it is a wrong reasoning and wrong solution process. Could someone point me why it is not correct?
 A: The working you have done is correct, but there are a few caveats:

*

*You should have used the fact that $\ln(1)=0$ to simplify your working.

*$\lim_{n \to \infty}\ln\left(1+\frac{1}{x}\right)^x$ actually means $\lim_{x \to \infty}\left(\ln\left(1+\frac{1}{x}\right)\right)^x$. Instead, you should write
$$
\lim_{x \to \infty}\ln\left(\left(1+\frac{1}{x}\right)^x\right) \, .
$$

*In many cases, you freely interchange the limit operator and the function operator, by writing things such as
$$
\lim_{x \to \infty}\exp\left(f(x)\right)=\exp\left(\lim_{x \to \infty}f(x)\right) \, .
$$
This is actually completely valid, but ideally you should be able to justify why it works. (It boils down to the fact that the function $\exp$ is continuous.)

Finally, as Yves mentions in the comments, there is a much simpler way to solve this problem. Hopefully, you are familiar with the elementary limit
$$
e =\lim_{x \to \infty}\left(1+\frac{1}{x}\right)^x
$$
Note that
\begin{align}
\lim_{x \to \infty}\left(\frac{x}{1+x}\right)^x&=\lim_{x \to \infty}\left(\frac{1+x}{x}\right)^{-x} \\[5pt]
&= \lim_{x \to \infty}\frac{1}{\left(\frac{1+x}{x}\right)^x} \\[5pt]
&= \frac{1}{\lim_{x \to \infty}\left(1+\frac{1}{x}\right)^x} \\[5pt]
&= \frac{1}{e} \, .
\end{align}
