a simple problem on limit made me confused I tried to solve this problem : $$\lim_{x \to \frac{\pi}{2}} (1+\cos x)^{\tan x}$$
if $y=(1+\cos x)^{\tan x} \implies \log y=\tan x \log(1+\cos x)$
$$\lim_{x \to \frac{\pi}{2}}\log y=\lim_{x \to \frac{\pi}{2}}[\tan x\log(1+\cos x)]=\lim_{x \to \frac{\pi}{2}}\frac{\log(1+\cos x)}{\cos x} \times \lim_{x \to \frac{\pi}{2}} \sin x$$$$=\lim_{x \to \frac{\pi}{2}} \frac{(-\sin x)}{(1+\cos x)(-\sin x)}=\lim_{x \to \frac{\pi}{2}} \frac{1}{1+\cos x}=1$$
$$\implies\log\lim_{x \to \frac{\pi}{2}}(1+\cos x)^{\tan x}=1$$
$$\implies\lim_{x \to \frac{\pi}{2}}(1+\cos x)^{\tan x}=e$$
I got answer $"e"$ but in my book it is $"e^{-1}"$. So I am confused whether I am right , please solve this, it will be definitely appreciable

Built around $x=\frac{\pi }{2}$ , the Taylor series of $(1+\cos x)^{\tan x}$ is $$e+\frac{1}{2} e \left(x-\frac{\pi }{2}\right)-\frac{1}{24} e \left(x-\frac{\pi
   }{2}\right)^2-\frac{7}{48} e \left(x-\frac{\pi
   }{2}\right)^3+O\left(\left(x-\frac{\pi }{2}\right)^4\right)$$
This come from the fact that the Taylor series (built at $x=\frac{\pi }{2}$ are,  respectively for $(1+\cos x)$ and $\tan x$,
$$A=1-\left(x-\frac{\pi }{2}\right)+\frac{1}{6} \left(x-\frac{\pi
   }{2}\right)^3-\frac{1}{120} \left(x-\frac{\pi
   }{2}\right)^5+O\left(\left(x-\frac{\pi }{2}\right)^7\right)$$
$$B=-\frac{1}{x-\frac{\pi }{2}}+\frac{1}{3} \left(x-\frac{\pi }{2}\right)+\frac{1}{45}
   \left(x-\frac{\pi }{2}\right)^3+\frac{2}{945} \left(x-\frac{\pi
   }{2}\right)^5+O\left(\left(x-\frac{\pi }{2}\right)^7\right)$$ Now, compose the series for $A^B$ (using logarithms make things slightly easier).
