# What is the derivative of $f(x):=x^2e^{-|x|}$? [closed]

What is the derivative of $$f(x):=x^2e^{-|x|}$$, and why?

I simply don't understand how to differentiate such a function, let alone why the derivative when $$x=0$$ is $$0$$.

• What have you tried? Do you know what the definition of the derivative is? Did you try applying it to this function?
– Snaw
Feb 8, 2022 at 19:45
• @Snaw yea i know what the derivative is, but I want the derivative for every real number Feb 8, 2022 at 19:47
• $*$ denotes convolution or just multiplication? Feb 8, 2022 at 19:59
• You can make a case decision: For $x\geq 0$ we have $f(x)=x^2\cdot e^{-x}$ The derivative is $2x\cdot e^{-x}-x^2\cdot e^{-x}$. Now let $\lim\limits_{x\to 0}$. Feb 8, 2022 at 20:04
• @callculus42 This is true (assuming we also show the same for $x<0$), but it only works since $f(x)$ is continuous in a neighbourhood of $0$ and relies on a theorem which is on one hand easy but on the other hand quite often not proved in an introductory calculus course. I'm guessing OP was meant to differentiate the function using the definition at $x=0$.
– Snaw
Feb 8, 2022 at 20:10

On $$(0,\infty)$$, we have $$f(x)=x^2e^{-x}$$ so $$f$$ is differentiable on this open interval and $$f'(x)=2xe^{-x}-x^2e^{-x}=x(2-x)e^{-x}$$.

Similarly, on $$(-\infty,0)$$, $$f(x)=x^2e^{x}$$ so $$f$$ is differentiable on this open interval and $$f'(x)=2xe^{x}+x^2e^{x}=x(2+x)e^{x}$$.

It remains to see if $$f$$ is differentiable at $$0$$. We have, for every $$x\neq 0$$

$$\frac{f(x)-f(0)}{x-0}=xe^{-|x|}$$

By continuity of $$\exp$$ and the absolute value, we get that $$\lim_{x\to 0}\frac{f(x)-f(0)}{x-0}$$ exists and is equal to $$0e^0=0$$. By definition, $$f$$ is differentiable at $$0$$ and $$f'(0)=0$$.

We can summarize this as $$f'(x)=x(2-|x|)e^{-|x|}$$ for every real number $$x$$. (Note that, as @TurlocTheRed explained in their answer, $$f'$$ is odd since $$f$$ is even).

Since $$f(x)=x^2e^{-|x|}, f(x)$$ is an even function.

If $$f(x)$$ is a differentiable function and $$f(x)=f(-x)$$, it's an even function and $$f'(x)=-f'(-x)$$ by the chain rule. So if an even function is differentiable for $$x>0$$, then its differentiable for $$x<0$$. Further, that derivative is an odd function. Odd functions reach $$0$$ at the origin if the functions is defined there.

$$f'(x)=2xe^{-|x|}-\frac{|x|}{x}x^2e^{-|x|}, x\ne0.$$ Approaches $$0$$ as $$x\to 0$$.

So we have some non rigorous evidence $$f'(0)\to0$$.

At $$0$$, you can use $$\lim_{x \to 0} \frac{f(x)-f(0)}{x}$$ as Taladris does elsewhere.

EDITI: Removed erroneous use of the Symmetric Derivative.

• $\lim_{\Delta x \to 0} \frac{f(x+\frac{\Delta x}{2})-f(x-\frac{\Delta x}{2})}{\Delta x}=\lim_{\Delta x\to 0} \frac{0}{\Delta x}$ seems wrong: you cannot just take the limit of the numerator only. Feb 9, 2022 at 2:29
• @Taladris, for $x=0$, the numerator is $0$ for all values of $\Delta x$ since $f$ is an even function. That's not a limit in the numerator, but the difference between equal function values. Feb 9, 2022 at 2:33
• Then with the same reasoning, you would prove that $f(x)=|x|$ is differentiable at $0$, no? Feb 9, 2022 at 2:41
• I guess it does! I need to patch that up. Feb 9, 2022 at 3:42
• Since $\frac{f(x+h/2)-f(x-h/2)}{h} = \frac{1}{2}\left(\frac{f(x+h/2)-f(x)}{h/2}-\frac{f(x-h/2)-f(x)}{h/2}\right)$, then we have that if $f$ is differentiable at $x$, then $\lim_{h\to 0}\frac{f(x+h/2)-f(x-h/2)}{h}$ exists and is equal to $0$. But the converse is false (consider $f(x)=|x|$) Feb 9, 2022 at 4:04