# How to solve int_(-pi/3)^(pi/3) (|x| + tan x)^2dx?

## $x$ is an absolute value

Jun 8, 2018

${\int}_{- \frac{\pi}{3}}^{\frac{\pi}{3}} {\left(\left\mid x \right\mid + \tan x\right)}^{2} \mathrm{dx} = \frac{2 {\pi}^{3}}{81} - \frac{\pi}{3} + \sqrt{3}$

#### Explanation:

Using the additivity of the integral:

${\int}_{- \frac{\pi}{3}}^{\frac{\pi}{3}} {\left(\left\mid x \right\mid + \tan x\right)}^{2} \mathrm{dx} = {\int}_{- \frac{\pi}{3}}^{0} {\left(\left\mid x \right\mid + \tan x\right)}^{2} \mathrm{dx} + {\int}_{0}^{\frac{\pi}{3}} {\left(\left\mid x \right\mid + \tan x\right)}^{2} \mathrm{dx}$

In the first integral substitute $t = - x$:

${\int}_{- \frac{\pi}{3}}^{0} {\left(\left\mid x \right\mid + \tan x\right)}^{2} \mathrm{dx} = {\int}_{\frac{\pi}{3}}^{0} {\left(\left\mid - t \right\mid + \tan \left(- t\right)\right)}^{2} d \left(- t\right)$

${\int}_{- \frac{\pi}{3}}^{0} {\left(\left\mid x \right\mid + \tan x\right)}^{2} \mathrm{dx} = {\int}_{0}^{\frac{\pi}{3}} {\left(\left\mid t \right\mid - \tan t\right)}^{2} \mathrm{dt}$

Change the name of the integration variable to $x$ again for clarity:

${\int}_{- \frac{\pi}{3}}^{\frac{\pi}{3}} {\left(\left\mid x \right\mid + \tan x\right)}^{2} \mathrm{dx} = {\int}_{0}^{\frac{\pi}{3}} {\left(\left\mid x \right\mid + \tan x\right)}^{2} \mathrm{dx} + {\int}_{0}^{\frac{\pi}{3}} {\left(\left\mid x \right\mid - \tan x\right)}^{2} \mathrm{dx}$

as in the interval of integration $x$ is positive, then $\left\mid x \right\mid = x$:

${\int}_{- \frac{\pi}{3}}^{\frac{\pi}{3}} {\left(\left\mid x \right\mid + \tan x\right)}^{2} \mathrm{dx} = {\int}_{0}^{\frac{\pi}{3}} {\left(x + \tan x\right)}^{2} \mathrm{dx} + {\int}_{0}^{\frac{\pi}{3}} {\left(x - \tan x\right)}^{2} \mathrm{dx}$

using the linearity of the integral:

${\int}_{- \frac{\pi}{3}}^{\frac{\pi}{3}} {\left(\left\mid x \right\mid + \tan x\right)}^{2} \mathrm{dx} = {\int}_{0}^{\frac{\pi}{3}} \left({\left(x + \tan x\right)}^{2} + {\left(x - \tan x\right)}^{2}\right) \mathrm{dx}$

${\int}_{- \frac{\pi}{3}}^{\frac{\pi}{3}} {\left(\left\mid x \right\mid + \tan x\right)}^{2} \mathrm{dx} = {\int}_{0}^{\frac{\pi}{3}} \left({x}^{2} + 2 x \tan x + {\tan}^{2} x + {x}^{2} - 2 x \tan x + {\tan}^{2} x\right) \mathrm{dx}$

${\int}_{- \frac{\pi}{3}}^{\frac{\pi}{3}} {\left(\left\mid x \right\mid + \tan x\right)}^{2} \mathrm{dx} = 2 {\int}_{0}^{\frac{\pi}{3}} \left({x}^{2} + {\tan}^{2} x\right) \mathrm{dx}$

${\int}_{- \frac{\pi}{3}}^{\frac{\pi}{3}} {\left(\left\mid x \right\mid + \tan x\right)}^{2} \mathrm{dx} = 2 {\int}_{0}^{\frac{\pi}{3}} {x}^{2} \mathrm{dx} + 2 {\int}_{0}^{\frac{\pi}{3}} {\tan}^{2} x \mathrm{dx}$

Using the trigonometric identity:

${\tan}^{2} x = {\sec}^{2} x - 1$

${\int}_{- \frac{\pi}{3}}^{\frac{\pi}{3}} {\left(\left\mid x \right\mid + \tan x\right)}^{2} \mathrm{dx} = 2 {\int}_{0}^{\frac{\pi}{3}} {x}^{2} \mathrm{dx} + 2 {\int}_{0}^{\frac{\pi}{3}} \left({\sec}^{2} x - 1\right) \mathrm{dx}$

${\int}_{- \frac{\pi}{3}}^{\frac{\pi}{3}} {\left(\left\mid x \right\mid + \tan x\right)}^{2} \mathrm{dx} = 2 {\int}_{0}^{\frac{\pi}{3}} {x}^{2} \mathrm{dx} + 2 {\int}_{0}^{\frac{\pi}{3}} {\sec}^{2} x \mathrm{dx} - 2 {\int}_{0}^{\frac{\pi}{3}} \mathrm{dx}$

${\int}_{- \frac{\pi}{3}}^{\frac{\pi}{3}} {\left(\left\mid x \right\mid + \tan x\right)}^{2} \mathrm{dx} = 2 {\left[{x}^{3} / 3 + \tan x - x\right]}_{0}^{\frac{\pi}{3}}$

${\int}_{- \frac{\pi}{3}}^{\frac{\pi}{3}} {\left(\left\mid x \right\mid + \tan x\right)}^{2} \mathrm{dx} = \frac{2 {\pi}^{3}}{81} - \frac{\pi}{3} + \sqrt{3}$