<s>[INST] Find $\lim_{x\rightarrow\infty}x\left(\frac{1}{e}-\left(\frac{x}{x+1}\right)^x\right).$ This is what my prof did:
Rewrite as $$x\left(\frac{1}{e}-\left(\frac{x}{x+1}\right)^x\right)=\frac{x}{e}\left(1-e\cdot e^{-x\ln{\left(1+\frac{1}{x}\right)}}\right).$$
Here he uses that
$$\ln{(1+t)}=t-\frac{t^2}{2}+O(t^3),$$
so 
$$\frac{x}{e}\left(1-e\cdot e^{-x\left(\frac{1}{x}-\frac{1}{2x^2}+O(\frac{1}{x^3})\right)}\right)=\frac{x}{e}\left(1-e^{\frac{1}{2x}+O\left(\frac{1}{x^3}\right)}\right).$$
So far so good. Now, he uses that $e^t=1+t+O(t^2)$ so that the expression aove becomes
$$\frac{x}{e}\left(1-\left(1+\frac{1}{2x}+O\left(\frac{1}{x^2}\right)\right)\right)=-\frac{1}{2e}+O\left(\frac{1}{t}\right)$$
and now he lets $x\rightarrow\infty$ to get the answer. However, when he introduces the expansion of $e^t$, how does he get $O(1/x^2)$? 
It is my understanding that I should plug in $t=\frac{1}{2x}+O\left(\frac{1}{x^3}\right)$ everywhere in $1+t+O(t^2),$ doing that I get
$$1+\frac{1}{2x}+O\left(\frac{1}{x^3}\right)+O\left(\left(\frac{1}{2x}+O\left(\frac{1}{x^3}\right)\right)^2\right),$$
Squaring that last ordo-term, the largest power of $x$ is $1/x^2$ and the smallest is $1/x^6.$ Why choose $1/x^2$?
 [/INST] Probably too long for a comment.
Having felt in love with Taylor series and their compositions, I still think that simpler is always better and allows probably more.
Considering
$$A=x\left(\frac{1}{e}-\left(\frac{x}{x+1}\right)^x\right)$$ let us try working the pieces
$$B=\left(\frac{x}{x+1}\right)^x\implies \log(B)=x\log\left(\frac{x}{x+1}\right)=-x\log\left(1+\frac1{x}\right)$$ $$\log(B)=-x\left(\frac{1}{x}-\frac{1}{2 x^2}+\frac{1}{3
   x^3}-\frac{1}{4
   x^4}+O\left(\frac{1}{x^5}\right)\right)=-1+\frac{1}{2 x}-\frac{1}{3 x^2}-\frac{1}{4
   x^3}+O\left(\frac{1}{x^4}\right)$$ Continuing with Taylor
$$B=e^{\log(B)}=\frac{1}{e}+\frac{1}{2 e x}-\frac{5}{24 e
   x^2}+\frac{5}{48 e
   x^3}+O\left(\frac{1}{x^4}\right)$$ making
$$A=x\left(-\frac{1}{2 e x}+\frac{5}{24 e x^2}-\frac{5}{48 e
   x^3}+O\left(\frac{1}{x^4}\right)\right)=-\frac{1}{2 e}+\frac{5}{24 e x}-\frac{5}{48 e
   x^2}+O\left(\frac{1}{x^3}\right)$$ which shows the limit and how it is approached.
Now, truncate to $O\left(\frac{1}{x^2}\right)$ or $O\left(\frac{1}{x}\right)$ as you wish.
At least, you can avoid some useless gymnastics.
</s>