I understand how the book solved the integral but don't get how they got an answer of infinity.

$\displaystyle \int_{0}^{\pi/2} tan x~dx=\lim_{b\to(\pi/2)^-}ln |secx|(from~0~to~b)=\infty$. I get an answer of 0. $\displaystyle \lim_{b\to(\pi/2)^-}[ln|secb|-ln|sec0|]=0-0=0$

What am I doing wrong?