Convexity of $x^a e^{-x}$ This is a calculus homework. Given is
$$f(x)=x^a e^{-x}$$
where $x \in ]0;\infty[$ for $a \lt 0$, $x \in [0;\infty[$ for $a \geq 0$.
The task is to first find local or global minima and maxima depending on a, then decide on the convexity of f, again depending on a. $0^0$ is defined as 1.
I've looked at various properties, not all of them immediately relevant to the above questions, hoping to understand this pretty complex function better. I'll note my main results below.
Since $x=0$ is a border, I'm interested in the behavior of $f$ there.
$f(0)=0$ for $a \neq 0$
$f(0)=1$ for $a = 0$
$\lim\limits_{x \rightarrow +0}{\frac{x^a}{e^x}} = 0$ for $a \geq 0$
$\lim\limits_{x \rightarrow +0}{\frac{x^a}{e^x}} = 0$ for $a \lt 0$
For large x:
$\lim\limits_{x \rightarrow +\infty}{\frac{x^a}{e^x}} = 0$ regardless of $a$.
Minima/maxima of continuous functions need to have $f'(x)=0$:
$f'(x) = (a-x)x^{a-1}e^{-x}$
$
f'(x) = 0
\Leftrightarrow
(a-x)x^{a-1}e^{-x} = 0
\Leftrightarrow
a = x
$
At $x=0$:
$
f'(0)
=
\lim\limits_{x \rightarrow +0}\frac{x^a/e^x - 0^a/e^0}{x}
=
\lim\limits_{x \rightarrow +0}\frac{x^{a-1}}{e^x}
$
which is 1 for $a=1$, 0 for $a \geq 1$ and $+\infty$, $0 \lt a \lt 1$ and $-\infty$ for $a=0$.
For convexity, also $f''(x)$ is interesting:
$f''(x) = \frac{a(a-x)x^{a-2} - ax^{a-1}}{e^{2x}}$
$
f''(x)=0
\Leftrightarrow
a(a-1)x^{a-2}=ax^{a-1}
\Leftrightarrow
(a-1)=x
$
However, comparing this with wolframalpha, there seem to be major differences pretty much everywhere. I'm very uncertain if my results are correct. I'm in particular confused by the impact of $0^0$ or $0^{-0}$ in some of the equations, leading me to think I've taken a completely wrong approach to this problem.
I attempted $ln f(x)$, hoping to find something easier to work on, but it was fruitless.
(As I am not too familiar with neither latex nor the tags here, please feel welcome to edit this post.)
 A: You're computing wrongly the second derivative.
The given function is
$$f(x)=x^ae^{-x}.$$
Therefore
$$f'(x)=ax^{a-1}e^{-x}-x^ae^{-x}$$
and so
$$
f''(x)=a(a-1)x^{a-2}e^{-x}-2ax^{a-1}e^{-x}+x^ae^{-x}=
x^{a-2}e^{-x}(a^2-a-2ax+x^2)
$$
Let's not bother with $x=0$, for the moment. When is the second derivative positive? Exactly when
$$
x^2-2ax+a^2-a>0
$$
The (reduced) discriminant of this quadratic is $a^2-a^2+a=a$. So, if $a<0$, the second derivative is positive for all $x>0$ and the function is convex.
If $a=0$, the function is $f(x)=e^{-x}$, which is convex.
If $a>0$, the roots of the quadratic are
$$
a-\sqrt{a}\quad\text{and}\quad a+\sqrt{a}
$$
If $a\le1$, the smallest root is negative, so the function is concave in $(0,a+\sqrt{a}$ and convex in $(a+\sqrt{a},\infty)$. If $a>1$, then the function is concave in $(a-\sqrt{a},a+\sqrt{a})$ and convex in the other part of the domain.
Here is a graph for $a=-0.1$

Here is a graph for $a=0.5$, note the flex at about $x=0.64$

Here is a graph for $a=3$, where the two flexes are evident

