# Is f(x)=cosx concave or convex at x=pi/2?

Nov 24, 2016

$x = \frac{\pi}{2}$ corresponds to a transition between convex down and convex up.

#### Explanation:

$f \left(x\right) = \cos x$

Differentiating wrt $x$ we get
$f \left(x\right) = \cos x \implies f ' \left(x\right) = - \sin x$

When $x = \frac{\pi}{2} \implies f ' \left(\frac{\pi}{2}\right) = - \sin \left(\frac{\pi}{2}\right) = - 1$

Now $\left\{\begin{matrix}f ' \left(x\right) < 0 & \implies f \left(x\right) \text{ is decreasing" \\ f'(x)=0 & => f(x) " is stationary" \\ f'(x)>0 & => f(x) " is increasing}\end{matrix}\right.$

So we know that $f \left(x\right)$ is decreasing at $x = \frac{\pi}{2}$, we must check the 2nd derivative for the convexity

$f ' \left(x\right) = - \sin x \implies f ' ' \left(x\right) = - \cos x$

When $x = \frac{\pi}{2} \implies f ' ' \left(\frac{\pi}{2}\right) = - \cos \left(\frac{\pi}{2}\right) = 0$

Now $\left\{\begin{matrix}f ' ' \left(x\right) < 0 & \implies f \left(x\right) \text{ is concave" \\ f''(x)=0 & => f(x) " is transition point" \\ f''(x)>0 & => f(x) " is convex}\end{matrix}\right.$

Confirming that $x = \frac{\pi}{2}$ corresponds to a transition between convex down and convex up.

The following is a plot of $\textcolor{red}{f \left(x\right)}$, $\textcolor{b l u e}{f ' \left(x\right)}$ and $\textcolor{g r e e n}{f ' ' \left(x\right)}$. As you can see when $x = \frac{\pi}{2}$ then $\textcolor{red}{f \left(x\right)}$ is decreasing and $\textcolor{b l u e}{f ' \left(x\right)} < 0$, and $\textcolor{g r e e n}{f ' ' \left(x\right)} = 0$