# Is f(x)=xtanx concave or convex at x=pi/4?

Jan 14, 2018

The graph is concave up at x=π/4 as tested through the second derivative.

#### Explanation:

To find concavity of a function at a certain point, you'll need the second derivative. Your function is:

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

In order to get to the second derivative, we have to go through the first. To do this, we'll use the product rule, which says

$\frac{d}{\mathrm{dx}} \left(f \left(x\right) \cdot g \left(x\right)\right) = f ' \left(x\right) \cdot g \left(x\right) + g ' \left(x\right) \cdot f \left(x\right)$

So let's take the derivative of each side, and apply the rule.

$\frac{d}{\mathrm{dx}} \left(x\right) = 1$

$\frac{d}{\mathrm{dx}} \left(\tan \left(x\right)\right) = {\sec}^{2} \left(x\right)$

Therefore, the following statement can be made:

$\frac{d}{\mathrm{dx}} \left(x \tan \left(x\right)\right) = \tan \left(x\right) + x {\sec}^{2} \left(x\right)$

However, this is just the first derivative, which only gives us instantaneous rate of change. We need the second in order to determine concavity. So we can do this again. We have a product rule on the right side, so let's take care of that. We already know the derivative of $\tan \left(x\right)$ and $x$, so let's worry about the secant.

This actually gives us a chain rule, since the secant is being squared. The chain rule says:

$\frac{d}{\mathrm{dx}} \left(f \left(g \left(x\right)\right)\right) = f ' \left(g \left(x\right)\right) \cdot g ' \left(x\right)$

In this case, $f \left(x\right) = {x}^{2}$, $g \left(x\right) = \sec \left(x\right)$. So let's take the derivative of both:

$f ' \left(x\right) = 2 x$
$g ' \left(x\right) = \sec \left(x\right) \tan \left(x\right)$

Therefore, we can say

$\frac{d}{\mathrm{dx}} \left({\sec}^{2} \left(x\right)\right) = 2 {\sec}^{2} \left(x\right) \tan \left(x\right)$

This can be plugged into our first derivative to get

$\frac{d}{\mathrm{dx}} \left(\tan \left(x\right) + x {\sec}^{2} \left(x\right)\right) = {\sec}^{2} \left(x\right) + {\sec}^{2} \left(x\right) + 2 x {\sec}^{2} \left(x\right) \tan \left(x\right)$

or just

$2 {\sec}^{2} \left(x\right) + 2 x {\sec}^{2} \left(x\right) \tan \left(x\right)$

Finally, to find concavity at the point, we plug in the value. If it's greater than 0, it's concave upwards or concave downwards.

2sec^2(π/4)+2π/4sec^2(π/4)tan(π/4)

2(2)+π/2*2*1

4+π

Therefore, the graph is concave up at $x = \frac{\pi}{4}$.