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

Jan 22, 2016

$f \left(x\right)$ is convex on $\left(- \infty , - 1\right) \cup \left(0 , + \infty\right)$ and is concave on $\left(- 1 , 0\right)$.

#### Explanation:

Convexity and concavity are determined by the sign of the second derivative:

• If $f ' ' \left(a\right) < 0$, then the function $f \left(x\right)$ is concave at $x = a$.
• If $f ' ' \left(a\right) > 0$, then the function $f \left(x\right)$ is convex at $x = a$.

To find the second derivative, rewrite the final term with a negative exponent. From there, differentiation is a simple application of the power rule.

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

Working with the second derivative will be simpler if we put it into fractional form. To do this, multiply it by ${x}^{3} / {x}^{3}$.

$f ' ' \left(x\right) = \frac{2 {x}^{3} + 2}{x} ^ 3$

We now must find the intervals on which $f ' ' \left(x\right)$ is positive and negative. To do this, we must find the times when the sign of the function could change, which is when the second derivative is equal to $0$ or does not exist.

To find the time(s) when the function is equal to $0$, set the numerator of $f ' ' \left(x\right)$ equal to $0$.

$2 {x}^{3} + 2 = 0$
${x}^{3} = - 1$
$x = - 1$

The second derivative is undefined when the denominator is equal to $0$.

${x}^{3} = 0$
$x = 0$

We now have found the two points at which the derivative could change signs, $x = - 1$ and $x = 0$. Thus, to determine the convexity and concavity of the function, we should test each interval where the convexity/concavity could be different. The intervals are $\left(- \infty , - 1\right) , \left(- 1 , 0\right) ,$ and $\left(0 , + \infty\right)$.

mathbf((-oo,-1)

Test point of $x = - 3$:

$f ' ' \left(- 3\right) = \frac{2 {\left(- 3\right)}^{3} + 2}{- 3} ^ 3 = \frac{2 \left(- 27\right) + 2}{- 27} = \frac{52}{27}$

Since this is $> 0$, we know this entire interval will have a second derivative value $> 0$, meaning the function is convex on $\left(- \infty , - 1\right)$.

mathbf((-1,0)

Test point of $x = - \frac{1}{2}$:

$f ' ' \left(- \frac{1}{2}\right) = \frac{2 {\left(- \frac{1}{2}\right)}^{3} + 2}{- \frac{1}{2}} ^ 3 = \frac{- \frac{1}{4} + 2}{- \frac{1}{8}} = - 14$

Since this is $< 0$, the function is concave on the interval $\left(- 1 , 0\right)$.

mathbf((0,+oo)

Test point of $x = 1$:

$f ' ' \left(1\right) = \frac{2 \left({1}^{3}\right) + 2}{1} ^ 3 = \frac{2 + 2}{1} = 4$

Since this is $> 0$, the function is convex on the interval $\left(0 , + \infty\right)$.

Thus, $f \left(x\right)$ is convex on $\left(- \infty , - 1\right) \cup \left(0 , + \infty\right)$ and is concave on $\left(- 1 , 0\right)$.

We can check a graph of $f \left(x\right)$:

graph{x^2-x + 1/x [-6, 6, -17, 17]}