Evaluate $\int \theta\sec\theta \tan\theta \ d\theta$ integral of $\int \theta\sec\theta \tan\theta \  d\theta$

my work 
$\frac{d}{d\theta}\sec(θ) = \sec(\theta)\tan(\theta)$
So if we let $u = \theta$ and $v' = \sec(\theta)\tan(\theta)$, then we get:
$u = \theta, du = d\theta$ and $v = \sec(\theta), dv = \sec(\theta)\tan(\theta)d\theta$
Hence
$$\int \theta \sec(\theta)\tan(\theta) d\theta  = \theta\sec(\theta) - \int\sec(\theta) d\theta $$
Now, the integral of $\sec(\theta)$ is a particularly tricky integral, but it comes to:
$$\int \sec(\theta) d \theta = \ln|\sec(\theta) + \tan(\theta)| + C$$
integral comes to:
$$\int \theta \sec(\theta)\tan(\theta) d\theta  = \theta \sec(\theta) - \ln|\sec(\theta) + \tan(\theta)| + C $$
but my answer is not like this picture 

please help me 
 A: Let $c = \cos \frac {\theta}2; s= \sin \frac {\theta}2$
Note that $$\sec \theta +\tan \theta = \frac {1+\sin \theta}{\cos \theta}=\frac {c^2+s^2+2cs}{c^2-s^2}=\frac {(c+s)^2}{(c+s)(c-s)}=\frac {c+s}{c-s}$$ and that should help you to reconcile the two answers.
A: Your answer is the same. Note that
$$\log|\cos(\theta/2)-\sin(\theta/2)|-\log|\cos(\theta/2)+\sin(\theta/2)|=\log |\frac{\cos(\theta/2)-\sin(\theta/2)}{\cos(\theta/2)+\sin(\theta/2)}|\\
=\log |\frac{\cos^2(\theta/2)-2\sin(\theta/2)\cos(\theta/2)+\sin^2(\theta/2)}{\cos^2(\theta/2)-\sin^2(\theta/2)}|\\=\log |\frac{1-\sin(\theta)}{\cos(\theta)}|=\log|\sec(\theta)-\tan(\theta)|= \log \frac{|\sec^2(\theta)-\tan^2(\theta)| }{|\sec(\theta)+\tan(\theta)|} \\=-\log| \sec(\theta)+\tan(\theta)|$$
A: An antiderivative of
$$
\sec\theta\tan\theta=\frac{\sin\theta}{\cos^2\theta}=
-\frac{-\sin\theta}{\cos^2\theta}
$$
is $1/\cos\theta$. Therefore, integrating by parts,
$$
\int\theta\frac{\sin\theta}{\cos^2\theta}\,d\theta=
\frac{\theta}{\cos\theta}-\int\frac{1}{\cos\theta}\,d\theta
$$
The remaining integral can be computed with the substitution
$$
\theta=\frac{\pi}{2}-2u
$$
so
\begin{align}
-\int\frac{1}{\cos\theta}\,d\theta=
\int\frac{1}{\sin2u}\,2du
&=
\int\frac{\cos^2u+\sin^2u}{\sin u\cos u}\,du\\[6px]
&=
\int\left(\frac{\cos u}{\sin u}+\frac{\sin u}{\cos u}\right)du \\[6px]
&=
\log|\sin u|-\log|\cos u|+C\\[6px]
&=\log\left|\tan u\right|+C\\[6px]
&=\log\left|\tan\left(\frac{\pi}{4}-\frac{\theta}{2}\right)\right|
\end{align}
Now
$$
\tan\left(\frac{\pi}{4}-\frac{\theta}{2}\right)=
\frac{1-\tan(\theta/2)}{1+\tan(\theta/2)}=
\frac{\cos(\theta/2)-\sin(\theta/2)}{\cos(\theta/2)+\sin(\theta/2)}
$$
Thus the book is almost right: they're forgetting the absolute value.
You are stating that
$$
\log|\sec\theta+\tan\theta|
$$
is an antiderivative of $\sec\theta$; let's try:
$$
\log|\sec\theta+\tan\theta|=
\log\left|\frac{1+\sin\theta}{\cos\theta}\right|=
\log|1+\sin\theta|-\log|\cos\theta|
$$
The derivative is
$$
\frac{\cos\theta}{1+\sin\theta}-\frac{-\sin\theta}{\cos\theta}=
\frac{\cos^2\theta+\sin\theta+\sin^2\theta}{\cos\theta(1+\sin\theta)}=
\frac{1+\sin\theta}{\cos\theta(1+\sin\theta)}=\frac{1}{\cos\theta}
$$
So you're right as well. Even “more right” than the book.
