# What is f(x) = int xtanx dx if f(pi/4)=-2 ?

Dec 27, 2015

$f \left(x\right) = {\int}_{\frac{\pi}{4}}^{x} \ln \left(\cos u\right) \mathrm{du} - x \ln \left(\cos x\right) - \frac{\pi \ln 2}{8} - 2$

#### Explanation:

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

$f \left(x\right) - f \left(\frac{\pi}{4}\right) = {\int}_{\frac{\pi}{4}}^{x} u \cdot \tan \left(u\right) \mathrm{du}$

$f \left(x\right) - \left(- 2\right) = {\int}_{\frac{\pi}{4}}^{x} u \cdot \tan \left(u\right) \mathrm{du}$

$f \left(x\right) = {\int}_{\frac{\pi}{4}}^{x} u \cdot \tan \left(u\right) \mathrm{du} - 2$

Try to evaluate the integral using integration by parts.

${\int}_{\frac{\pi}{4}}^{x} u \cdot \tan \left(u\right) \mathrm{du} = - {\int}_{\frac{\pi}{4}}^{x} u \cdot \frac{d}{\mathrm{du}} \left(\ln \left(\cos u\right)\right) \mathrm{du}$

$= - \left(\left[u \cdot \ln \left(\cos u\right)\right] {\setminus}_{\frac{\pi}{4}}^{x} - {\int}_{\frac{\pi}{4}}^{x} \ln \left(\cos u\right) \cdot \frac{d}{\mathrm{du}} \left(u\right) \mathrm{du}\right)$

$= - \left(x \ln \left(\cos x\right) - \frac{\pi}{4} \ln \left(\frac{1}{\sqrt{2}}\right)\right) + {\int}_{\frac{\pi}{4}}^{x} \ln \left(\cos u\right) \mathrm{du}$

$= - x \ln \left(\cos x\right) - \frac{\pi \ln 2}{8} + {\int}_{\frac{\pi}{4}}^{x} \ln \left(\cos u\right) \mathrm{du}$

Evaluating the integral fully requires non-elementary functions.