Integral of $$$1 - \tan{\left(x \right)}$$$
Related calculator: Definite and Improper Integral Calculator
Your Input
Find $$$\int \left(1 - \tan{\left(x \right)}\right)\, dx$$$.
Solution
Integrate term by term:
$${\color{red}{\int{\left(1 - \tan{\left(x \right)}\right)d x}}} = {\color{red}{\left(\int{1 d x} - \int{\tan{\left(x \right)} d x}\right)}}$$
Apply the constant rule $$$\int c\, dx = c x$$$ with $$$c=1$$$:
$$- \int{\tan{\left(x \right)} d x} + {\color{red}{\int{1 d x}}} = - \int{\tan{\left(x \right)} d x} + {\color{red}{x}}$$
Rewrite the tangent as $$$\tan\left(x\right)=\frac{\sin\left(x\right)}{\cos\left(x\right)}$$$:
$$x - {\color{red}{\int{\tan{\left(x \right)} d x}}} = x - {\color{red}{\int{\frac{\sin{\left(x \right)}}{\cos{\left(x \right)}} d x}}}$$
Let $$$u=\cos{\left(x \right)}$$$.
Then $$$du=\left(\cos{\left(x \right)}\right)^{\prime }dx = - \sin{\left(x \right)} dx$$$ (steps can be seen »), and we have that $$$\sin{\left(x \right)} dx = - du$$$.
The integral can be rewritten as
$$x - {\color{red}{\int{\frac{\sin{\left(x \right)}}{\cos{\left(x \right)}} d x}}} = x - {\color{red}{\int{\left(- \frac{1}{u}\right)d u}}}$$
Apply the constant multiple rule $$$\int c f{\left(u \right)}\, du = c \int f{\left(u \right)}\, du$$$ with $$$c=-1$$$ and $$$f{\left(u \right)} = \frac{1}{u}$$$:
$$x - {\color{red}{\int{\left(- \frac{1}{u}\right)d u}}} = x - {\color{red}{\left(- \int{\frac{1}{u} d u}\right)}}$$
The integral of $$$\frac{1}{u}$$$ is $$$\int{\frac{1}{u} d u} = \ln{\left(\left|{u}\right| \right)}$$$:
$$x + {\color{red}{\int{\frac{1}{u} d u}}} = x + {\color{red}{\ln{\left(\left|{u}\right| \right)}}}$$
Recall that $$$u=\cos{\left(x \right)}$$$:
$$x + \ln{\left(\left|{{\color{red}{u}}}\right| \right)} = x + \ln{\left(\left|{{\color{red}{\cos{\left(x \right)}}}}\right| \right)}$$
Therefore,
$$\int{\left(1 - \tan{\left(x \right)}\right)d x} = x + \ln{\left(\left|{\cos{\left(x \right)}}\right| \right)}$$
Add the constant of integration:
$$\int{\left(1 - \tan{\left(x \right)}\right)d x} = x + \ln{\left(\left|{\cos{\left(x \right)}}\right| \right)}+C$$
Answer
$$$\int \left(1 - \tan{\left(x \right)}\right)\, dx = \left(x + \ln\left(\left|{\cos{\left(x \right)}}\right|\right)\right) + C$$$A