The secant function can’t be evaluated in ##pi/2##.
Just apply the definition and evaluate:
##sec(x)=1/cos(x)##
Thus
##sec(pi/2)=1/cos(pi/2)##
But since ##cos(pi/2)## is zero this division is not legit.
We can calculate the limit so see if it’s positive or negative infinite. Since the cosine function is positive before ##pi/2## and negative after we will have that
##lim_{xto (pi/2)^+} sec(x)=infty## and
##lim_{xto (pi/2)^- } sec(x)=-infty##