# For what values of x is f(x)= e^x/(x^2-x) -e^x concave or convex?

Jul 18, 2018

The function is convex for $x < - 1.660$, $0 < x < 1$, $x > 1.928$

#### Explanation:

We need to find points of inflection for this function, i.e. where the second derivative is 0.

$f \left(x\right) = {e}^{x} / \left({x}^{2} - x\right) - {e}^{x}$
$f ' \left(x\right) = \frac{{e}^{x} \left({x}^{2} - x\right) - {e}^{x} \left(2 x - 1\right)}{{x}^{2} - x} ^ 2 - {e}^{x}$
$f ' ' \left(x\right) = \frac{{\left({x}^{2} - x\right)}^{2} \left[{e}^{x} \left({x}^{2} - 3 x + 1\right) + {e}^{x} \left(2 x - 3\right)\right]}{{x}^{2} - x} ^ 4 - \frac{{e}^{x} \left({x}^{2} - 3 x + 1\right) \cdot 2 \left({x}^{2} - x\right) \left(2 x - 1\right)}{{x}^{2} - x} ^ 4 - {e}^{x}$

Setting this equal to zero, we know that the ${e}^{x}$ will never go to zero, so we can divide that out. Similarly, we can multiply by the ${\left({x}^{2} - x\right)}^{4}$ in the denominator by specifying that $x \ne 0 , 1$.

Therefore, we end up with
$0 = {\left({x}^{2} - x\right)}^{2} \left[{x}^{2} - 3 x + 1 + 2 x - 3\right] - 2 \left({x}^{2} - 3 x + 1\right) \left({x}^{2} - x\right) \left(2 x - 1\right) - {\left({x}^{2} - x\right)}^{4}$
$0 = \left({x}^{2} - x\right) \left[\left({x}^{2} - x\right) \left({x}^{2} - x - 2\right) - 2 \left({x}^{2} - 3 x + 1\right) \left(2 x - 1\right) - {\left({x}^{2} - x\right)}^{3}\right]$
i.e. we have one degree of ${x}^{2} - x$ which doesn't cancel out the 4 we multiplied, so we can forget about it as well. Now we have to expand out this sixth degree polynomial:

$0 = x \left(x - 1\right) \left({x}^{2} - x - 2\right) - 2 \left({x}^{2} - 3 x + 1\right) \left(2 x - 1\right) - {x}^{3} {\left(x - 1\right)}^{3}$
$0 = - {x}^{6} + 3 {x}^{5} - 2 {x}^{4} - 5 {x}^{3} + 13 {x}^{2} - 8 x + 2$
$0 = {x}^{6} - 3 {x}^{5} + 2 {x}^{4} + 5 {x}^{3} - 13 {x}^{2} + 8 x - 2$

If you try to find some rational roots, it turns out that none of the candidates $\left(\pm 1 , \pm 2\right)$ work, hence the roots are all irrational.
We can plot this function to see:

graph{x^6-3x^5+2x^4+5x^3-13x^2+8x-2 [-3, 3, -10, 10]}

And see there are two real solutions at around
${x}_{1} = - 1.66 \mathmr{and} {x}_{2} = 1.928$

The new problem is that the original function has these breaks at $x = 0 , 1$ so the regions are
I: $x < {x}_{1}$
II: ${x}_{1} < x < 0$
III: $0 < x < 1$
IV: $1 < x < {x}_{2}$
V: ${x}_{2} < x$

We know that the actual second derivative is
$f ' ' \left(x\right) = \frac{- {e}^{x} \left({x}^{6} - 3 {x}^{5} + 2 {x}^{4} + 5 {x}^{3} - 13 {x}^{2} + 8 x - 2\right)}{{x}^{2} - x} ^ 3$

We can see that only terms that will determine the sign of the function are the two polynomials since ${e}^{x} > 0$

From the above graph, we see that in region I and V, the long polynomial is positive and regions II-IV it is negative.

We can also see that ${x}^{2} - x$ is negative only in region III.

This means that the regions have alternating concavities, starting with convex.