Are the following functions convex or concave?
f:x\longmapsto 2x^2-4x+5
Recall that:
- If f''\left(x\right) \gt 0 when x\in\left( a,b \right), then f is convex on the interval \left( a,b \right).
- If f''\left(x\right) \lt 0 when x\in\left( a,b \right), then f is concave on the interval \left( a,b \right).
Here, we have:
f\left(x\right)=2x^{2}-4x+5
Calculate the derivative:
f'\left(x\right)=\left(2x^{2}-4x+5\right)'=4x-4
Calculate the second-order derivative:
f''\left(x\right)=\left(4x-4\right)'=4
For any real number x, f''\left(x\right) is positive.
f is convex on \mathbb{R}.
f:x\longmapsto x^{3}+6x^{2}-7x-2
Recall that:
- If f''\left(x\right) \gt 0 when x\in\left( a,b \right), then f is convex on the interval \left( a,b \right).
- If f''\left(x\right) \lt 0 when x\in\left( a,b \right), then f is concave on the interval \left( a,b \right).
Here, we have:
f\left(x\right)=x^{3}+6x^{2}-7x-2
Calculate the derivative:
f'\left(x\right)=\left(x^{3}+6x^{2}-7x-2\right)'=3x^{2}+12x-7
Calculate the second-order derivative:
f''\left(x\right)=\left(3x^{2}+12x-7\right)'=6x+12
Solve the equation f''\left(x\right)=0 :
6x+12=0
The solution of the equation is:
x=-2

f is concave when x\in\left(-\infty, -2\right) and convex when x\in\left(-2,\infty\right).
f:x\longmapsto x^{2}e^{x}
Recall that:
- If f''\left(x\right) \gt 0 when x\in\left( a,b \right), then f is convex on the interval \left( a,b \right).
- If f''\left(x\right) \lt 0 when x\in\left( a,b \right), then f is concave on the interval \left( a,b \right).
Here, we have:
f\left(x\right)=x^{2}e^{x}
Calculate the derivative:
f'\left(x\right)=\left(x^{2}e^{x}\right)'=\left(x^{2}\right)'e^{x}+x^{2}\left(e^{x}\right)'=2xe^{x}+x^{2}e^{x}=\left(x^{2}+2x\right)e^{x}
Calculate the second-order derivative:
f''\left(x\right)=\left(\left(x^{2}+2x\right)e^{x}\right)'=\left(x^{2}+2x\right)'e^{x}+\left(x^{2}+2x\right)\left(e^{x}\right)'=\left(2x+2\right)e^{x}+\left(x^{2}+2x\right)e^{x}=\left(x^{2}+4x+2\right)e^{x}
Solve the equation f''\left(x\right)=0 :
\left(x^{2}+4x+2\right)e^{x}=0
The solutions of the equation are:
x=-2-\sqrt{2} and x=-2+\sqrt{2}

f is concave when x\in\left(-2-\sqrt{2},-2+\sqrt{2}\right) and convex when x\in\left(-\infty,-2-\sqrt{2}\right)\cup\left(-2+\sqrt{2},\infty\right).
f:x\longmapsto x\ln\left(x\right), x\in\left(0,\infty\right)
Recall that:
- If f''\left(x\right) \gt 0 when x\in\left( a,b \right), then f is convex on the interval \left( a,b \right).
- If f''\left(x\right) \lt 0 when x\in\left( a,b \right), then f is concave on the interval \left( a,b \right).
Here, we have:
f\left(x\right)=x\ln\left(x\right)
Calculate the derivative:
f'\left(x\right)=\left(x\ln\left(x\right)\right)'=\left(x\right)'\ln\left(x\right)+x\left(\ln\left(x\right)\right)'=\ln\left(x\right)+x\cdot\dfrac{1}{x}=\ln\left(x\right)+1
Calculate the second-order derivative:
f''\left(x\right)=\left(\ln\left(x\right)+1\right)'=\dfrac{1}{x}
Solve the equation f''\left(x\right)=0 :
\dfrac{1}{x}=0
The equation does not have any solutions.
We can conclude that f is convex when x\in\left(0,\infty\right).
f is convex when x\in\left(0,\infty\right).
f:x\longmapsto \dfrac{x-1}{x+1}, x\in\left(-\infty,-1\right)\cup\left(-1,\infty\right)
Recall that:
- If f''\left(x\right) \gt 0 when x\in\left( a,b \right), then f is convex on the interval \left( a,b \right).
- If f''\left(x\right) \lt 0 when x\in\left( a,b \right), then f is concave on the interval \left( a,b \right).
Here, we have:
f\left(x\right)=\dfrac{x-1}{x+1}
Calculate the derivative:
f'\left(x\right)=\left(\dfrac{x-1}{x+1}\right)'=\dfrac{\left(x-1\right)'\left(x+1\right)-\left(x-1\right)\left(x+1\right)'}{\left(x+1\right)^{2}}=\dfrac{1\cdot\left(x+1\right)-\left(x-1\right)\cdot1}{\left(x+1\right)^{2}}=\dfrac{2}{\left(x+1\right)^{2}}
Calculate the second-order derivative:
f''\left(x\right)=\left(\dfrac{2}{\left(x+1\right)^{2}}\right)'=\dfrac{-4\left(x+1\right)}{\left(x+1\right)^{4}}=\dfrac{-4}{\left(x+1\right)^{3}}
The sign of f'' is the following:

f is convex when x\in\left(-\infty,-1\right) and concave when x\in\left(-1,\infty\right).
f:x\longmapsto x^{4}-3x^{2}+7
Recall that:
- If f''\left(x\right) \gt 0 when x\in\left( a,b \right), then f is convex on the interval \left( a,b \right).
- If f''\left(x\right) \lt 0 when x\in\left( a,b \right), then f is concave on the interval \left( a,b \right).
Here, we have:
f\left(x\right)=x^{4}-3x^{2}+7
Calculate the derivative:
f'\left(x\right)=\left(x^{4}-3x^{2}+7\right)'=4x^{3}-6x
Calculate the second-order derivative:
f''\left(x\right)=\left(4x^{3}-6x\right)'=12x^{2}-6
Solve the equation f''\left(x\right)=0 :
12x^{2}-6=0
The solutions of the equation are:
x=-\dfrac{\sqrt{2}}{2} and x=\dfrac{\sqrt{2}}{2}
The sign of f'' is the following:
| x | -\infty -\dfrac{\sqrt{2}}{2} \dfrac{\sqrt{2}}{2} \infty |
| f''\left(x\right) | + + + + + + + + + + + + + + 0 - - - - - - - - - - - - 0 + + + + + + + + + + + + + + + + |

f is convex when x\in\left(-\infty,-\dfrac{\sqrt{2}}{2}\right)\cup\left(\dfrac{\sqrt{2}}{2},\infty\right) and concave when x\in\left(-\dfrac{\sqrt{2}}{2},\dfrac{\sqrt{2}}{2}\right).
f:x\longmapsto x^{2}\sqrt{x}, x\in\left[0,\infty\right)
Recall that:
- If f''\left(x\right) \gt 0 when x\in\left( a,b \right), then f is convex on the interval \left( a,b \right).
- If f''\left(x\right) \lt 0 when x\in\left( a,b \right), then f is concave on the interval \left( a,b \right).
Here, we have:
f\left(x\right)=x^{2}\sqrt{x}
Calculate the derivative:
f'\left(x\right)=\left(x^{2}\sqrt{x}\right)'=\left(x^{2}\cdot x^{\frac{1}{2}}\right)'=\left(x^{\frac{5}{2}}\right)'=\dfrac{5}{2}\cdot x^{\frac{5}{2}-1}=\dfrac{5}{2}\cdot x^{\frac{3}{2}}
Calculate the second-order derivative:
f''\left(x\right)=\left(\dfrac{5}{2}\cdot x^{\frac{3}{2}}\right)'=\dfrac{5}{2}\cdot \dfrac{3}{2}\cdot x^{\frac{3}{2}-1}=\dfrac{5}{2}\cdot \dfrac{3}{2}\cdot x^{\frac{1}{2}}=\dfrac{15}{4}\sqrt{x}
Solve the equation f''\left(x\right)=0 :
\dfrac{15}{4}\sqrt{x}=0
The solution of the equation is:
x=0
We conclude that f''\left(x\right) \gt 0 when x\in\left(0,\infty\right), so f is convex when x\in\left(0,\infty\right).
f is convex when x\in\left[0,\infty\right).