How find this limits $\lim_{n\to\infty}n^A\left(\sin{a_{n}}+\cos{a_{n}})^n-e\right)=B$ 
let $a_{n}\in(0,\dfrac{\pi}{2})$ is a root of the equation 
  $$\tan{x}+\cos{x}=n,n\ge 2$$
  I have prove
  $$\lim_{n\to\infty}(\sin{a_{n}}+\cos{a_{n}})^n=e$$
  Because $\tan{a_{n}}\in[n-1,n+1]$,so
  $\tan{a_{n}}=n+o(n)$

then
$$\lim_{n\to\infty}(\sin{a_{n}}+\cos{a_{n}})^n=\lim_{n\to\infty}(1+\dfrac{2\tan{a_{n}}}{1+\tan^2{a_{n}}})^{n/2}=e$$
My Question:Can we Obtain a Higher asymptotic expansion?
see wolf
such this form
$$\lim_{n\to\infty}n^A\left(\sin{a_{n}}+\cos{a_{n}})^n-e\right)=B$$
Find $A,B$?
 A: Let $b_n=\frac\pi2-a_n$, so that $b_n$ will be near $0$ and $\cot b_n+\sin b_n=n$. The function
$$
f(x) = \frac1{\cot x+\sin x}
$$
satisfies $f(0)$ and $f'(0)\ne0$, so it is invertible near $x=0$, and $b_n = f^{-1}(\frac1n)$. We want to understand the quantity $(\sin a_n+\cos a_n)^n = (\cos b_n+\sin b_n)^n$; equivalently, we want to understand
$$
\exp\big( n\log(\cos b_n+\sin b_n) \big) = \exp\big( n\log(\cos f^{-1}(\tfrac1n)+\sin f^{-1}(\tfrac1n)) \big).
$$
This is the value of the function
$$
g(x) = \exp\big( \tfrac1x \log(\cos f^{-1}(x)+\sin f^{-1}(x)) \big)
$$
at $x=\frac1n$. The power series of $g(x)$ at $x=0$ (computable by WolframAlpha, or slowly by hand using known power series, composition rules, and the Lagrange inversion formula) is
$$
g(x) = e\big( 1-x+\frac{11 x^2}{6}-\frac{7 x^3}{2}+\frac{2267 x^4}{360}-\frac{851 x^5}{72}+\frac{192305 x^6}{9072}+\cdots \big).
$$
In particular,
$$
\lim_{n\to\infty} n^1 \big( (\sin a_n+\cos a_n)^n-e \big) = \lim_{n\to\infty} \big( n g(\tfrac1n) -e \big) = -e.
$$
