limit $ \lim_{x\to\infty} \left( (x+2017)^{1+\frac{1}{x}} \: -\: x^{1+\frac{1}{x+2017}} \right) $ Find the following limit:
$$
\lim_{x\to\infty}
\left(
(x+2017)^{1+\frac{1}{x}} \: -\: x^{1+\frac{1}{x+2017}}
\right)
$$

I tried to exchange the infinity to zero by $x:=\frac{1}{t}$ and then use $\lim_{t\to 0^+}t^t=1$, but it doesn't lead to anything, I can't avoid having $\infty-\infty$...

The answer is 2017, as graph showed.

I generalize this problem
in two ways.
First,
replace $2017$ with $c$.
Second, 
make the exponents more general,
so that the problem is
$\lim_{x\to\infty}
\left(
(x+c)^{1+\frac{a}{x}} - x^{1+\frac{b}{x+c}}
\right)
$.
It turns out that 
the result is
$(a-b)\ln(x)+c+O(\frac{\ln^2(x)}{x})
$.
If $a=b$ (as in the original problem,
the limit is $c$.
Otherwise the result
goes to $+\infty$ if $a > b$
and
goes to $-\infty$ if $a < b$.
Let's look at the parts
as $x \to \infty$.
First.
$\begin{array}\\
(x+c)^{1+\frac{a}{x}}
&=(x+c)(x+c)^{\frac{a}{x}}\\
&=(x+c)x^{a/x}(1+c/x)^{\frac{a}{x}}\\
&=(x+c)e^{a\ln(x)/x}e^{a\ln(1+c/x)/x}\\
&=(x+c)(1+\frac{a\ln(x)}{x}+O(\frac{\ln^2(x)}{x^2})e^{(ac/x+O(1/x^2))/x}\\
&=(x+c)(1+\frac{a\ln(x)}{x}+O(\frac{\ln^2(x)}{x^2})e^{ac/x^2+O(1/x^3)}\\
&=(x+c)(1+\frac{a\ln(x)}{x}+O(\frac{\ln^2(x)}{x^2})(1+ac/x^2+O(1/x^3))\\
&=(x+c)(1+\frac{a\ln(x)}{x}+O(\frac{\ln^2(x)}{x^2}+O(1/x^2))\\
&=(x+c)(1+\frac{a\ln(x)}{x}+O(\frac{\ln^2(x)}{x^2}))\\
&=x+c+a\ln(x)+O(\frac{\ln^2(x)}{x} )\\
\end{array}
$
Second.
$\begin{array}\\
x^{1+\frac{b}{x+c}}
&=xe^{b\ln(x)/(x+c)}\\
\text{and}\\
\frac{b\ln(x)}{x+c}
&=\frac{b\ln(x)}{x}\frac1{1+c/x}\\
&=\frac{b\ln(x)}{x}(1-\frac{c}{x}+O(\frac1{x^2}))\\
&=\frac{b\ln(x)}{x}-\frac{bc\ln(x)}{x^2}+O(\frac{\ln(x)}{x^3})\\
\text{so}\\
e^{b\ln(x)/(x+c)}
&=1+\frac{b\ln(x)}{x}-\frac{bc\ln(x)}{x^2}+O(\frac{\ln(x)}{x^3}))
+O(\frac{\ln^2(x)}{x^2})\\
&=1+\frac{b\ln(x)}{x}
+O(\frac{\ln^2(x)}{x^2})\\
\text{so that}\\
x^{1+\frac{b}{x+c}}
&=x+b\ln(x)+O(\frac{\ln^2(x)}{x})\\
\end{array}
$
Taking their difference,
the $x$ cancels out
and we get
$(a-b)\ln(x)+c+O(\frac{\ln^2(x)}{x})
$.
Note:
Wolfy confirms the difference as
$2017 + 2017 \frac{1 + 2 log(x)}{x} + O((1/x)^2)
$.
