Question

# Find the integral;$\int{\sec x\left( \sec x+\tan x \right)dx}$

Hint: Simplify the expression within the integral sign and use the following results:
$\int{{{\sec }^{2}}xdx}=\tan x+C$ and $\int{\sec x\tan xdx}=\sec x+C$. Also, use the property that integral of the sum = sum of the integrals.

We, first of all, will simplify the integrand
\begin{align} & =\sec x(\left( \sec x+\tan x \right) \\ & =\sec x\sec x+\sec x\tan x \\ & ={{\sec }^{2}}x+\sec x\tan x \\ \end{align}
Hence $\int{\sec x\left( \sec x+\tan x \right)dx}=\int{\left( {{\sec }^{2}}x+\sec x\tan x \right)dx}$
Since integral of the sum of functions is equal to the sum of integral of the functions, we have
$\int{\sec x\left( \sec x+\tan x \right)dx}=\int{{{\sec }^{2}}xdx}+\int{\sec x\tan xdx}$
We know that $\int{{{\sec }^{2}}xdx}=\tan x+C$ and $\int{\sec x\tan xdx}=\sec x+C$
Using the above formulae, we get
$\int{\sec x\left( \sec x+\tan x \right)dx}=\tan x+\sec x+C$.
Hence $\int{\sec x\left( \sec x+\tan x \right)dx}=\tan x+\sec x+C$.

Note: Alternatively, we can solve the above question by writing the integrand in terms of sine and cosine and then integrating.
Using $\sec x=\dfrac{1}{\cos x}$ and $\tan x=\dfrac{\sin x}{\cos x}$, we have
\begin{align} & \sec x\left( \sec x+\tan x \right) \\ & =\dfrac{1}{\cos x}\dfrac{1+\sin x}{\cos x} \\ & =\dfrac{1+\sin x}{{{\cos }^{2}}x} \\ \end{align}
We know that ${{\cos }^{2}}x=1-{{\sin }^{2}}x$.
Using the above formula, we get
$\sec x\left( \sec x+\tan x \right)=\dfrac{1+\sin x}{1-{{\sin }^{2}}x}$
We know that ${{a}^{2}}-{{b}^{2}}=\left( a+b \right)\left( a-b \right)$
Using the above formula, we get
\begin{align} & \sec x\left( \sec x+\tan x \right)=\dfrac{1+\sin x}{\left( 1-\sin x \right)\left( 1+\sin x \right)} \\ & \Rightarrow \sec x\left( \sec x+\tan x \right)=\dfrac{1}{1-\sin x} \\ \end{align}
Hence $\int{\sec x\left( \sec x+\tan x \right)dx}=\int{\dfrac{1}{1-\sin x}dx}$
In integrals of type $\int{\left( \dfrac{dx}{a\sin x+b\cos x} \right)}$ we substitute $t=\tan \dfrac{x}{2}$
So, let $t=\tan \dfrac{x}{2}$
Differentiating both sides, we get
$dt=\dfrac{1}{2}{{\sec }^{2}}\dfrac{x}{2}dx$
We know that ${{\sec }^{2}}x=1+{{\tan }^{2}}x$
Using the above formula, we get
\begin{align} & dt=\dfrac{1+{{\tan }^{2}}\dfrac{x}{2}}{2}=\dfrac{1+{{t}^{2}}}{2}dx \\ & \Rightarrow dx=\dfrac{2dt}{1+{{t}^{2}}} \\ \end{align}
Also, we know $\sin x=\dfrac{2\tan \dfrac{x}{2}}{1+{{\tan }^{2}}\dfrac{x}{2}}=\dfrac{2t}{1+{{t}^{2}}}$
Hence we have
\begin{align} & \int{\sec x\left( \sec x+\tan x \right)}=\int{\dfrac{\dfrac{2dt}{1+{{t}^{2}}}}{1-\dfrac{2t}{1+{{t}^{2}}}}} \\ & =\int{\dfrac{2dt}{1+{{t}^{2}}-2t}} \\ \end{align}
We know that ${{\left( a-b \right)}^{2}}={{a}^{2}}-2ab+{{b}^{2}}$
Using the above formula, we get
\begin{align} & \int{\sec x\left( \sec x+\tan x \right)}=\int{\dfrac{2dt}{{{\left( t-1 \right)}^{2}}}=2\int{\dfrac{dt}{{{\left( t-1 \right)}^{2}}}}} \\ & =\dfrac{2}{1-t}+C \\ \end{align}
Reverting to the original variable, we get
$\int{\sec x\left( \sec x+\tan x \right)}=\dfrac{2}{1-\tan \dfrac{x}{2}}+C$
[2] Although the two results look completely different from each other, by Lagrange mean value theorem, they differ only by a constant.
Hence $\dfrac{2}{1-\tan \dfrac{x}{2}}=\tan x+\sec x+C$ for some constant C.
[3] Proof of [2]: Let F(x) and G(x) be two antiderivatives of the function f(x).
Applying Lagrange mean value theorem to the function F(x) – G(x) in the interval [0,y]{Assuming continuity at 0}, we get
$\dfrac{F(y)-G(y)-F(0)+G(0)}{y}=f(c)-f(c)=0$
i.e. $F(y)-G(y)-F(0)+G(0)=0$
Since F(0)-G(0) is a constant let C = F(0) – G(0), we get
$F(y)=G(y)+C$ or in other words F(x) and G(x) differ only by a constant.