# What are the absolute extrema of f(x)=2xsin^2x + xcos2x in[0,pi/4]?

Mar 28, 2018

absolute max: $\left(\frac{\pi}{4} , \frac{\pi}{4}\right)$

absolute min: $\left(0 , 0\right)$

#### Explanation:

Given: $f \left(x\right) = 2 x {\sin}^{2} x + x \cos 2 x \in \left[0 , \frac{\pi}{4}\right]$

Find first derivative using the product rule twice.

Product rule: $\left(u v\right) ' = u v ' + v u '$

Let u = 2x; " "u' = 2

Let v = sin^2x = (sin x)^2; " "v' = 2 sin x cos x

$f ' \left(x\right) = 2 x 2 \sin x \cos x + 2 {\sin}^{2} x + \ldots$

For the second half of the equation:
Let u = x; " "u' = 1

Let v = cos(2x); " "v' =(-sin(2x))2 = -2sin(2x)

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

Simplify:
$f ' \left(x\right) = \cancel{2 x \sin \left(2 x\right)} + 2 {\sin}^{2} x \cancel{- 2 x \sin \left(2 x\right)} + \cos \left(2 x\right)$

$f ' \left(x\right) = 2 {\sin}^{2} x + \cos \left(2 x\right)$

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

$f ' \left(x\right) = {\sin}^{2} x + {\cos}^{2} x$

The Pythagorean Identity ${\sin}^{2} x + {\cos}^{2} x = 1$

This means there are no critical values when $f ' \left(x\right) = 0$

Absolute Maximum and minimums would be found at the endpoints of the function interval.

Test endpoints of the function:

f(0) = 0; " Absolute minimum:" (0, 0)

$f \left(\frac{\pi}{4}\right) = 2 \cdot \frac{\pi}{4} {\sin}^{2} \left(\frac{\pi}{4}\right) + \frac{\pi}{4} \cdot \cos \left(2 \cdot \frac{\pi}{4}\right)$

$f \left(\frac{\pi}{4}\right) = \frac{\pi}{2} {\left(\frac{1}{\sqrt{2}}\right)}^{2} + \frac{\pi}{4} \cdot \cos \left(\frac{\pi}{2}\right)$

$f \left(\frac{\pi}{4}\right) = \frac{\pi}{2} \cdot \frac{1}{2} + \frac{\pi}{4} \cdot 0$

f(pi/4) = pi/4; " Absolute maximum:" (pi/4, pi/4)