Compute $ \lim_{x \to\frac{\pi} {2}} \{1^{\sec^2 x} + 2^{\sec^2 x} + \cdots + n^{\sec^2 x}\}^{\cos^2 x} $ Find $\displaystyle \lim_{x \to\frac{\pi} {2}} \{1^{\sec^2 x} + 2^{\sec^2 x} + \cdots + n^{\sec^2 x}\}^{\cos^2 x} $
I tried to do like this :
Let $A=\displaystyle \lim_{x \to\frac{\pi}{2}} \{1^{\sec^2 x} + 2^{\sec^2 x} + \cdots + n^{\sec^2 x}\}^{\cos^2 x} $
Then $\ln A=\lim_{x \to\frac{\pi} {2}} \cos^2 x \ln\{1^{\sec^2 x} + 2^{\sec^2 x} + \cdots + n^{\sec^2 x}\}$
which implies
$$\ln A = \lim_{x \to\frac {\pi}{2}} \frac{1^{\sec^2 x} + 2^{\sec^2 x}+ \cdots + n^{\sec^2 x}}{\sec^2 x}$$
I'm stuck here. If I am on the right way please guide me to reach conclusion. Otherwise please describe the actual way. Thanks in advance.

Let $f_n(x)$ be the sequence given by
$$f_n(x)=\left(\sum_{k=1}^n k^{\sec^2(x)}\right)^{\cos^2(x)}$$
Then, we have
$$\begin{align}
f_n(x)&=\left(n^{\sec^2(x)}\sum_{k=1}^n \left(\frac kn\right)^{\sec^2(x)}\right)^{\cos^2(x)}\\\\
&=n\left(\sum_{k=1}^n \left(\frac kn\right)^{\sec^2(x)}\right)^{\cos^2(x)}\\\\
\end{align}$$
For any fixed $n\ge1$
$$\lim_{x\to\pi/2}(k/n)^{\sec^2(x)}=\begin{cases}0&1\le k<n\\\\1&,k=n\end{cases}$$
Therefore, we have
$$\lim_{x\to \pi/2}f_n(x)=n$$
