So about an hour ago, I asked this question on if my method of finding the antiderivative of $e^{-1/x^2}$ was a valid method. About seven minutes ago (as of writing this) I got this comment by @GEdgar:
Your answer is correct, as you could find from Wolfram Alpha. Another way to check your answer, is to differentiate it, and see if you recover your integrand.
Note that the antiderivative that was attained originally was
$xe^{-1/x^2}+\sqrt\pi\operatorname{erf}(1/x)+c$
Now, taking $\dfrac d{dx}(xe^{-1/x^2})$ (the derivative of the first part) is pretty easy. This is what we do: Let$$f(x)=x,g(x)=e^{-1/x^2},h(x)=fg(x)\quad\text{(where }fg(x)=f(x)\cdot g(x))$$Then we have$$\begin{align}\dfrac d{dx}(xe^{-1/x^2})=&\,\dfrac{dh}{dx}=\dfrac{d(fg)}{dx}=f'g+fg'\\=&\,x^{-2}e^{-1/x^2}+e^{-1/x^2}=e^{-1/x^2}(1+x^{-2})\end{align}$$and now to differentiate $\sqrt\pi\operatorname{erf}(1/x)$. Yay. (not actually) Now here's the thing: I don't know how to differentiate $\operatorname{erf}(1/x)$, although if I'm supposed to recover my integral, I assume it must be $$\dfrac d{dx}\operatorname{erf}(1/x)=\dfrac{-e^{-1/x^2}}{x^2\sqrt\pi}$$since we know that$$\dfrac d{dx}(c_0\cdot f(x))=c_0\cdot\dfrac d{dx}(f(x))$$for any constant $c_0$, so the $\sqrt\pi$ would cancel out because it is in the numerator and denominator, giving us$$e^{-1/x^2}(1+x^{-2})-e^{-1/x^2}x^{-2}\gets e^{-1/x^2}(1\require{cancel}\cancel{+x^{-2}-x^{-2}})=e^{-1/x^2}$$so my question is:
Start with the definition of the Error Function: $$\operatorname{erf} x = \frac{2}{\sqrt{\pi}}\int_{0}^{x}e^{-t^2}dt$$ Taking the derivative with respect to x on both sides and applying the Fundamental Theorem of Calculus, we have: $$\frac{\mathrm{d} }{\mathrm{d} x}\operatorname{erf} x = \frac{2}{\sqrt{\pi}}e^{-x^2}$$ In this case, the Error Function operates on $\frac{1}{x}$ and therefore we must apply the chain rule: $$\frac{\mathrm{d} }{\mathrm{d} x}\operatorname{erf} \left(\frac{1}{x}\right) = \frac{2}{\sqrt{\pi}}e^{-x^{-2}}\left(-\frac{1}{x^2} \right )$$ So, the result is: $$\frac{\mathrm{d} }{\mathrm{d} x}\operatorname{erf} \left(\frac{1}{x}\right) = \frac{-2}{\sqrt{\pi}}x^{-2}e^{-x^{-2}}$$