×

# Is f(x)=xe^x-x^2 concave or convex at x=0?

Dec 6, 2015

You need to compute the second derivative in the point $x = 0$, and check its sign. If it's positive, the function is convex, otherwise it's concave. So, we have

$f \left(x\right) = x {e}^{x} - {x}^{2}$
$f ' \left(x\right) = {e}^{x} + x {e}^{x} - 2 x$
$f ' ' \left(x\right) = {e}^{x} + {e}^{x} + x {e}^{x} - 2 = {e}^{x} \left(2 + x\right) - 2$

So, $f ' ' \left(0\right) = {e}^{0} \left(2 + 0\right) - 2 = 2 - 2 = 0$.

Since the second derivative is negative immediatly before $0$, and positive after, $x = 0$ is an inflection point, in which the function passes from being concave to be convex, as you can see in this graph, in which the scales of $x$ and $y$ axes are changed in order to emphatize the behaviour of the curve.