convexity of $f(x)=x^{-a}e^x$ Consider the function $f(x)=x^{-a}e^x$ on $(0, \infty)$ with $a\in \mathbb{R}$. Study convexity.
I know the derivative $f'(x)=(-a+x)x^{-a-1}e^x$ So if $a>0$ I can find the extremum points. but how can we study the convexity of f
 A: A curve is convex if the graph looks like a smile. Convex is also called concave up, so a curve is concave up if the graph looks like a smile. A curve is concave down if the graph looks like a frown. 
So, if a curve is convex and you trace it from left to right, what happens with its slope? It increases. (It might be positive or negative, but a typical case is that the slope starts negative, at some point becomes 0, and then it becomes positive.) But, the slope is the same as $f'$, so $f'$ increases. If $f'$ increases, this means that its derivative, that is $(f')'=f''$ must be positive. 
So a function is convex if $f''>0$. (This could be made more precise, considering intervals on which $f''>0$.) 
So for your function, $f(x)=x^{-a}e^x$ where $x>0$.
$f'(x)=(-a+x)x^{-a-1}e^x$. And, if you compute $f''$ you obtain:
$f''(x)=(x^2−2ax+a^2+a)x^{−a−2}e^x$. So now you need to find when $f''(x)>0$.
Since $e^x>0$ (always) and $x^{−a−2}>0$ (given from the beginning that $x>0$),
it is enough to to solve for $x$ the inequality:
$x^2−2ax+a^2+a>0$.
The solutions for the corresponding equation $x^2−2ax+a^2+a= 0$ are
$x_1=a-\sqrt{-a}$ and $x_2=a+\sqrt{-a}$. So now there are two cases.  
Case 1. $a<0$, then $-a>0$ so the above solutions for $x_1$ and $x_2$ do define real numbers: In fact $x_1$ and $x_2$ are the $x$-intercepts of the parabola $p(x)=x^2−2ax+a^2+a$. Since this parabola opens up (since $x^2$ comes with coefficient $1$ and $1>0$), it follows that $p(x)>0$ when $x$ is either to the left of $x_1$ or to the right of $x_2$, that is in the union of the intervals $(-\infty,a-\sqrt{-a})\cup(a+\sqrt{-a},\infty)$. So, $f''(x)>0$ in these intervals, and $f$ is convex there. But to be more precise, from the beginning of the problem we only consider positive $x$, the condition that $x$ must be in $(0,\infty)$ was given (since if $x<0$ that would make the expression $x^{−a−2}$ way too complicated to consider in this problem). So the correct answer in this case would be that $f''(x)>0$ when $x$ is in $(a+\sqrt{-a},\infty)$ ... but well, I will need to correct my answer one more time since 
when $a<-1$ then $|a|>1$ and $\sqrt{|a|}<|a|$, so $a+\sqrt{-a}<0$, but we do not consider negative $x$ so the correct answer would actually be that:
If $a<-1$ then $f''(x)>0$ and $f$ is convex when $x$ is in $(0,\infty)$.
On the other hand if 
$-1\le a<0$ then $f''(x)>0$ and $f$ is convex when $x$ is in $(a+\sqrt{-a},\infty)$
(and here $a+\sqrt{-a}>0$ for $-1< a<0$, since if $|a|<1$ and $\sqrt{|a|}>|a|$, so $a+\sqrt{-a}>0$). 
Case 2. $a>0$. Then $x_1=a-\sqrt{-a}$ and $x_2=a+\sqrt{-a}$ do not exist (as real numbers), that is the parabola $p(x)$ has no $x$-intercepts at all. Since it opens up, this means the graph of the parabola lies entirely in the upper half-plane, that is $p(x)>0$ for all $x$. Hence $f''(x)>0$ for all $x$, and 
$f$ is convex for all $x$ ... or at least for $x$ in $(0,\infty)$ since the latter condition was given at the beginning of the problem.  
It could also happen that the parabola just touches the $x$-axis and has only one $x$-intercept: This happens when $a=0$, then $x_1=x_2=0$, but again $p(x)>0$ when $x>0$ so this is similar to Case 2. 
You could find more online if you google concavity, and/or second derivative test. In particular I recommend the following link which has precise definitions, pictures to illustrate them, and examples worked out: 
Paul's Online Math Notes, The Shape of a Graph, Part II 
Here is how the graph of the above function looks when $a=\frac{-1}3$ 

A: You will need to consult $f''(x)$ to determine the concavity of $f$. You should verify my work, but I believe you end up with $$f''(x) = e^x x^{-a-2}\left[x^2-2ax+a(a+1) \right]$$ Since you are choosing $x \in (0, \infty)$ it should be clear that the quantity $$e^x x^{-a-2}>0 \quad \text{for all} \quad a \in \Bbb{R}$$ Thus, the sign of $f''(x)$ (which is to say the concavity of $f$) is completely dependent upon the sign of the quantity $$x^2-2ax+a(a+1)$$ I recommend using the quadratic formula to find the relationship between $a$ and $x$. Once you do that, you should have an explicit way to tell the concavity of $f$ given any $a$.
