Is the function $(1+x)^{\frac{1}{x}}$ differentiable at $x=0$? 
Is the function $(1+x)^{\frac{1}{x}}$ differentiable at $x=0$?

Would the expression below denote its derivative?
$$  \lim_{x \to 0}  \lim_{h \to 0 } \frac{ (1+x+h)^{\frac{1}{x+h}} - e}{h}$$
 A: 
The function $ (1+x)^{1/x}$ has a removable discontinuity at $0$, which once removed, renders $(1+x)^{1/x}$ differentiable. 


We begin by defining a function $f(x)$ such that 
$$f(x)=\begin{cases}(1+x)^{1/x}&,x\ne0\\\\e&,x=0\end{cases}$$ 

If the derivative, $f'(0)$, of $f(x)$ at $x=0$ exists, then it is given by the limit $$ f'(0)=\lim_{h\to 0}\frac{(1+h)^{1/h}-e}{h}$$ 

Proceeding to evaluate the limit, we find that 
$$\begin{align}
f'(0)&=\lim_{h\to 0}\frac{(1+h)^{1/h}-e}{h}\\\\
&=\lim_{h\to 0}\frac{e^{\frac1h\log(1+h)}-e}{h}\\\\
&=\lim_{h\to 0}\frac{e^{1-\frac12h+O(h^2)}-e}{h}\\\\
&=e\lim_{h\to 0}\frac{e^{-\frac12h+O(h^2)}-1}{h}\\\\
&=e\lim_{h\to 0}\frac{-\frac12h+O(h^2)}{h}\\\\
&=-\frac e2
\end{align}$$
Hence, the derivative of $\displaystyle f(x)$ at $\displaystyle 0$ does exist with
$$f'(0)= -\frac e2$$

Note that for $x\ne 0$, the derivative, $f'(x)$ of $f(x)$ is given by 
$$ f'(x)=\frac{(1+x)^{1/x-1}(x-(1+x)\log(1+x))}{x^2}$$ 
It is straightforward to show that $\lim_{x\to 0}f'(x)=-\frac e2$, which shows that $f'(0)=\lim_{x\to 0}f'(x)$.  Hence, $f(x)$ is continuously differentiable at $0$.
A: The function 
$$f(x):=(1+x)^{1/x}$$
is undefined for $x\leq-1$ and $x=0$. When we look at
$$g(x):=\log f(x)={1\over x}\log(1+x)={1\over x}\bigl(x-{x^2\over2}+{x^3\over3}-\ldots\bigr)=1-{x\over2}+{x^2\over3}-\ldots$$
then we see that this $g$ is an analytic function when $|x|<1$. In particular $g(0)=1$, which says that we should define $f(0)=e$ and then have
$$f(x)=\exp\bigl(g(x)\bigr)=e\left(1-{x\over2}+{11x^2\over24}-{7x^3\over16}+{2447x^4\over5760}-\ldots\right)\ .\tag{1}$$
Here we have multiplied
$$\exp\bigl(g(x)\bigr)=e^1\cdot e^{-x/2}\cdot e^{x^2/3}\cdot\ldots=e\cdot(1-{x\over2}+\ldots)(1+{x^2\over3}+\ldots)\cdot\ldots$$
and kept all terms of degree $\leq4$. If it is important one could also derive a recursion for the successive coefficients.
In any case, $(1)$ shows that the given $f$, supplemented with $f(0):=e$, is even a real analytic function for $|x|<1$.
