# What is f(x) = int tanx dx if f(pi/8) = 0 ?

Aug 30, 2017

$f \left(x\right) = - \ln \left\mid \cos \right\mid x + \ln \left(\frac{\sqrt{2 + \sqrt{2}}}{2}\right)$

#### Explanation:

Use the definition of $\tan x$ as the ratio of $\sin x$ to $\cos x$:

$f \left(x\right) = \int \tan x \mathrm{dx} = \int \sin \frac{x}{\cos} x \mathrm{dx}$

We can put this in the form $\int \frac{\mathrm{du}}{u} = \ln \left\mid u \right\mid + C$ if we let $u = \cos x$. Differentiating this substitution implies that $\mathrm{du} = - \sin x \mathrm{dx}$, so we need to multiply the integrand by $- 1$. Balance this by also multiplying the exterior of the integral by $- 1$.

$f \left(x\right) = - \int \frac{- \sin x}{\cos} x \mathrm{dx} = - \int \frac{\mathrm{du}}{u} = - \ln \left\mid u \right\mid + C = - \ln \left\mid \cos \right\mid x + C$

We can use the initial condition $f \left(\frac{\pi}{8}\right) = 0$ to determine the unknown constant of integration $C$:

$0 = - \ln \left\mid \cos \right\mid \left(\frac{\pi}{8}\right) + C$

$C = \ln \left(\cos \left(\frac{\pi}{8}\right)\right)$

We can find this using a form of the cosine double angle formula: $\cos 2 \theta = 2 {\cos}^{2} \theta - 1$. Thus, $\cos \left(\frac{\pi}{4}\right) = 2 {\cos}^{2} \left(\frac{\pi}{8}\right) - 1$, and

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

$= \sqrt{\frac{1}{2} \left(\frac{2 + \sqrt{2}}{2}\right)} = \frac{\sqrt{2 + \sqrt{2}}}{2}$

Thus,

$C = \ln \left(\frac{\sqrt{2 + \sqrt{2}}}{2}\right)$

and

$f \left(x\right) = - \ln \left\mid \cos \right\mid x + \ln \left(\frac{\sqrt{2 + \sqrt{2}}}{2}\right)$

Aug 30, 2017

$f \left(x\right) = \ln \left\mid \sec x \right\mid + \ln \left(\frac{\sqrt{2 + \sqrt{2}}}{2}\right)$

#### Explanation:

We shall evaluate $f \left(x\right)$ using a different method.

$\int \tan x \mathrm{dx} = \int \frac{\tan x \sec x}{\sec} x \mathrm{dx}$

Let $u = \sec x$ and $\mathrm{du} = \sec x \tan x \mathrm{dx}$

Then $\int \tan x \mathrm{dx} = \int \frac{1}{u} \mathrm{du} = \ln \left\mid u \right\mid = \ln \left\mid \sec x \right\mid + \text{constant}$

$\ln \sec x \equiv - \ln \cos x$ so the constant of integration will be the same as the other answer.