# Thread: Integrating 'sec(x)' Using T-Substitution

1. ## Integrating 'sec(x)' Using T-Substitution

Can someone check my working out and point out errors (if any). Also, if correct, can someone show me how to simply it so that it is equivalent to any of the forms:

$\ln \left[ \tan \left(\frac{\pi}{4} + \frac{x}{2}\right)\right] + c$
$\ln \left[ \sec x - \tan x \right] + c$
__________________
$\int \sec x \ \mathrm{d}x$

$t = \tan \left( \frac{x}{2} \right)$

$\frac{\mathrm{d}t}{\mathrm{d}x}=\frac12 \sec ^2 \left(\frac{x}{2}\right)$

$\mathrm{d}x = \frac{2}{t^2 + 1} \mathrm{d}t$

$\int \frac{1}{\cos x} \ \mathrm{d}x$

$2 \int \frac{1}{\left(\frac{1-t^2}{1+t^2}\right)\left(1+t^2\right)} \ \mathrm{d}t$

$2 \int \frac{1}{1-t^2} \ \mathrm{d}t$

$-2 \int \frac{1}{(t-1)(t+1)} \ \mathrm{d}t$

$-2 \int \left( \frac{1}{2(t-1)} - \frac{1}{2(t+1)}\right) \ \mathrm{d}t$

$\int \left( \frac{1}{t-1} - \frac{1}{t+1}\right) \ \mathrm{d}t$

$\ln (t+1) - \ln (t-1) + c$

$\ln\left(\tan\left(\frac{x}{2}\right)+1\right) - \ln\left(\tan\left(\frac{x}{2}\right)-1\right) +c$

2. Your way looks correct, but have you tried to do this by simply multiplying $\sec{x}$ with $\frac{\sec{x} + \tan{x}}{\sec{x} + \tan{x}}$?

3. Originally Posted by Chop Suey
Your way looks correct, but have you tried to do this by simply multiplying $\sec{x}$ with $\frac{\sec{x} + \tan{x}}{\sec{x} + \tan{x}}$?
Yes, I know about that method but it specifically says in the question to use the substitution $t=\tan\left(\frac{x}{2}\right)$.

4. Hi, Air !
Originally Posted by Air
Can someone check my working out and point out errors (if any). [...]

$-\int \left( \frac{1}{t-1} - \frac{1}{t+1}\right) \ \mathrm{d}t$

$\ln{\color{red}|} t+1{\color{red}|} - \ln {\color{red}|}t-1{\color{red}|} + c \,\,\,\,\,(*)$

$\ln {\color{red}\Big{|} } \tan\left(\frac{x}{2}\right)+1 {\color{red}\Big{|}}- \ln{\color{red}\Big{|} } \tan\left(\frac{x}{2}\right)-1{\color{red}\Big{|}} +c$
You forgot few absolute values...

To find the first form of the answer, note that $\ln \left| \tan\left(\frac{x}{2}\right)+1 \right|- \ln\left| \tan\left(\frac{x}{2}\right)-1\right|=\ln\left|\frac{\tan\left(\frac{x}{2}\righ t)+1}{1-\tan\left(\frac{x}{2}\right)} \right|$ and since $\frac{\tan\frac{x}{2}+1}{1-\tan \frac{x}{2}}
=\frac{\tan \frac{x}{2}+\tan\frac{\pi}{4}}{1-\tan\frac{\pi}{4}\tan\frac{x}{2}}=\tan\left(\frac{ x}{2}+\frac{\pi}{4} \right)$
we get what we were looking for. (don't forget the absolute value )

To "find" the second form of the answer, I take your work from (*) and do few algebraic manipulations :


\begin{aligned}\ln|1+t|-\ln|1-t|=\ln\left|\frac{1+t}{1-t} \right|=\ln\left|\frac{1+t}{1-t}\cdot \frac{1+t}{1+t}\right|&=\ln\left|\frac{1+2t+t^2}{1-t^2}\right|\\
&=\ln\left|\frac{1+t^2}{1-t^2}+\frac{2t}{1-t^2}\cdot \frac{1+t^2}{1+t^2}\right|\\
&=\ln\left|\frac{1+t^2}{1-t^2}+\frac{\frac{2t}{1+t^2}}{ \frac{1-t^2}{1+t^2}}\right|\\
&=\ln\left|\frac{1}{\cos x}+\tan x\right|\\
\end{aligned}

5. Hello, Air!

Your work is correct . . . nice going!
The simplification is tricky.

$\ln\left|\tan\frac{x}{2}+1\right| - \ln\left|\tan\frac{x}{2}-1\right| +C$

We have: . $\ln\left|\frac{\tan\frac{x}{2}+1}{\tan\frac{x}{2}-1}\right| + C \;=\;\ln\left|\frac{\dfrac{\sin\frac{x}{2}}{\cos\f rac{x}{2}} + 1}{\dfrac{\sin\frac{x}{2}}{\cos\frac{x}{2}} - 1} \right| + C$ . $= \;\ln\left|\frac{\sin\frac{x}{2} + \cos\frac{x}{2}}{\sin\frac{x}{2} - \cos\frac{x}{2}}\right| + C$

. . $=\;\ln\left|\frac{\sin\frac{x}{2}+ \cos\frac{x}{2}}{\sin\frac{x}{2} - \cos\frac{x}{2}} \cdot\frac{\sin\frac{x}{2} + \cos\frac{x}{2}}{\sin\frac{x}{2} + \cos\frac{x}{2}} \right| + C$ . $= \;\ln\left|\frac{\overbrace{\sin^2\!\frac{x}{2} + \cos^2\!\frac{x}{2}}^{\text{This is 1}} + 2\sin\frac{x}{2}\cos\frac{x}{2}}{\sin^2\!\frac{x}{ 2} - \cos^2\!\frac{x}{2}}\right| + C$

. . $= \;\ln\left|\frac{1 + \overbrace{2\sin\frac{x}{2}\cos\frac{x}{2}}^{\text {This is }\sin x}}{-\underbrace{\left(\cos^2\!\frac{x}{2} - \sin^2\!\frac{x}{2}\right)}_{\text{This is }\cos x}}\right| + C$ . $=\;\;\ln\left|\frac{1 + \sin x}{\cos x}\right| + C$

. . $=\;\ln\left|\frac{1}{\cos x} + \frac{\sin x}{\cos x}\right| + C \;\;=\;\;\ln|\sec x + \tan x| + C$

Wow! . . . I like your solution, flyingsquirrel!
.