Define a function $f$ on $\mathbb{R}$ $$ f(x)=\left\{\begin{array}{ll} \exp (-1 / x), & \text { for } x>0 \\ 0, & \text { for } x \leq 0 \end{array}\right. $$ If $x \neq 0$, prove that $f$ is differentiable at $x$ and compute $f^{\prime}(x)$.
I had proved the differentiability for $x=0$ via L'Hospital's Rule but was wondering whether the differentiability could be proved for nonzero values $x$. Is it allowed to find derivatives partially for $x<0$ and $x>0$, or there exists other technique for this problem?!
The derivative of a function is a local property. When you are given a function and a point where to evaluate the derivative, it suffices to look at the function values in an arbitrarily small neighborhood of the point.
That implies that the derivative of a function known by analytical expressions, piecewise, can be computed in the pieces using these analytical expressions, regardless the other pieces. Moreover, at the junction points of the pieces, you can evaluate the left and right derivatives similarly and see if they match.