Solveeit Logo

Question

Question: Evaluate the following integral: \(\int{\dfrac{\left( 1+\tan x \right)}{\left( 1-\tan x \right)}dx}\...

Evaluate the following integral: (1+tanx)(1tanx)dx\int{\dfrac{\left( 1+\tan x \right)}{\left( 1-\tan x \right)}dx}

Explanation

Solution

We know that tanπ4=1\tan \dfrac{\pi }{4}=1 and tan(A+B)=tanA+tanB1tanAtanB\tan \left( A+B \right)=\dfrac{\tan A+\tan B}{1-\tan A\tan B}. By, using these two identities, we can convert 1+tanx1tanx=tan(π4+x)\dfrac{1+\tan x}{1-\tan x}=\tan \left( \dfrac{\pi }{4}+x \right), and can easily get the result by using the formula tanxdx=logsecx+c\int{\tan xdx=\log \left| \sec x \right|}+c. We can also solve this problem by replacing tanx=sinxcosx\tan x=\dfrac{\sin x}{\cos x} and using integration by substitution method.

Complete step-by-step solution:
Let us assume the required integral to be I=(1+tanx)(1tanx)dxI=\int{\dfrac{\left( 1+\tan x \right)}{\left( 1-\tan x \right)}dx}.
We all know very well that the tangent of angle π4\dfrac{\pi }{4} is unity, that is
tanπ4=1\tan \dfrac{\pi }{4}=1.
So, by using the above information, we can write
1+tanx1tanx=tanπ4+tanx1tanπ4tanx...(i)\dfrac{1+\tan x}{1-\tan x}=\dfrac{\tan \dfrac{\pi }{4}+\tan x}{1-\tan \dfrac{\pi }{4}\tan x}...\left( i \right)
Also, we know the identity, tan(A+B)=tanA+tanB1tanAtanB\tan \left( A+B \right)=\dfrac{\tan A+\tan B}{1-\tan A\tan B}. So, by using the converse of this identity on the right hand side of equation (i), we get
1+tanx1tanx=tan(π4+x)\dfrac{1+\tan x}{1-\tan x}=\tan \left( \dfrac{\pi }{4}+x \right)
Hence, we can write
I=tan(π4+x)dxI=\int{\tan \left( \dfrac{\pi }{4}+x \right)dx}.
We know that the integration of tanx\tan x is logsecx\log \left| \sec x \right|, that is,
tanxdx=logsecx+c\int{\tan xdx=\log \left| \sec x \right|}+c.
So, by using the above formula, we can write the following
I=logsec(π4+x)+cI=\log \left| \sec \left( \dfrac{\pi }{4}+x \right) \right|+c.
Alternatively, we can also solve this problem as shown below.
We know that tanx=sinxcosx\tan x=\dfrac{\sin x}{\cos x}. Thus, we can write
1+tanx1tanx=1+sinxcosx1sinxcosx\dfrac{1+\tan x}{1-\tan x}=\dfrac{1+\dfrac{\sin x}{\cos x}}{1-\dfrac{\sin x}{\cos x}}
On simplifying the right hand side of this equation, we get
1+tanx1tanx=cosx+sinxcosxcosxsinxcosx\dfrac{1+\tan x}{1-\tan x}=\dfrac{\dfrac{\cos x+\sin x}{\cos x}}{\dfrac{\cos x-\sin x}{\cos x}}
And thus, we now have
1+tanx1tanx=cosx+sinxcosxsinx\dfrac{1+\tan x}{1-\tan x}=\dfrac{\cos x+\sin x}{\cos x-\sin x}
So, we can now write
I=cosx+sinxcosxsinxdxI=\int{\dfrac{\cos x+\sin x}{\cos x-\sin x}}dx
Let us assume t=cosxsinxt=\cos x-\sin x.
By differentiating t, we can write
dt=(sinxcosx)dxdt=\left( -\sin x-\cos x \right)dx
dt=(sinx+cosx)dx\Rightarrow dt=-\left( \sin x+\cos x \right)dx
Hence, we can write
I=1tdtI=\int{\dfrac{-1}{t}}dt
We know the integration identity 1xdx=logx+c\int{\dfrac{1}{x}dx=\log \left| x \right|}+c. Thus, we have
I=logt+kI=-\log \left| t \right|+k
We can now substitute the value of t back in the above equation. Hence, we get
I=logcosxsinx+kI=-\log \left| \cos x-\sin x \right|+k.
Thus, we can express the required answer as I=logsec(π4+x)+cI=\log \left| \sec \left( \dfrac{\pi }{4}+x \right) \right|+c or I=logcosxsinx+kI=-\log \left| \cos x-\sin x \right|+k.

Note: We can see here that logsec(π4+x)\log \left| \sec \left( \dfrac{\pi }{4}+x \right) \right| and logcosxsinx-\log \left| \cos x-\sin x \right| are not equivalent to each other. But these two are related by a factor of 2\sqrt{2}. Also, we know that logmn=logm+logn\log mn=\log m+\log n. And since we know that log2\log \sqrt{2} is a constant, these two results are equivalent to each other. So, we must never forget the constant of integration in our results.