I was solving a limits questions:
$$\lim_{x\toπ/4} \tan x^{\tan2x}$$
After putting $x = (π/4)+h$ and solving it I got the expression:
$$(1-h/1+h)^{\cot2x} = (1-2h)^{\cot2h}$$
$$(1-2h)^{\cot2h}$$
Now If We solve it using binomial expansion we get $1-(2h\cdot \cot2h)$ using $(1+x)^n=1+nx$,
$$1-2h\cdot\frac{\cos2h}{\sin2h} = 1-\cos2h = 1-1 = 0$$
But If we let this expression as $g$ and take $\ln$ both sides we get: $$\cot2h\cdot \ln(1-2h)=\ln(g)$$
$\cot2h\cdot(-2h)= -1 = \ln g$
$g = e^{-1}$
In the first method where am I wrong since the answer is coming as $e^{-1}$?
The limit is indeed $\frac 1e$.
Since $\tan(2x)=\frac{2\tan(x)}{1-\tan^2(x)}$, substitute $y=\tan(x)$ (so $y\to1$ as $x\to\frac\pi4$):
$$\lim_{x\to\frac\pi4} \tan(x)^{\tan(2x)} = \lim_{y\to1} y^{\frac{2y}{1-y^2}}$$
Substitute $y=1-\frac1z$ (so $z\to+\infty$ as $y\to1$ from above). Then
$$\frac{2y}{1-y^2} = \frac1{1-y} - \frac1{1+y} = z + \frac1{\frac1z-2} = z - \frac12 \left(1 + \frac1{2z-1}\right)$$
and so
$$\lim_{y\to1^+} y^{\frac{2y}{1-y^2}} = \lim_{z\to\infty} \frac{\left(1 - \frac1z\right)^z}{\left(1 - \frac1z\right)^{\frac12 \left(1 + \frac1{2z-1}\right)}} = \frac{e^{-1}}1 = \frac1e$$
The numerator approaching $\frac1e$ follows from the definition of the exponential function (let $\xi=-1$),
$$e^\xi = \lim_{n\to\infty} \left(1 + \frac\xi n\right)^n$$
while the denominator approaches $\sqrt{(1-0)^{1+0}}=1$.
As user FShrike points out, we also must consider the limit as $y\to1$ from below, in which case $z\to-\infty$. Then in the limit, we have
$$\lim_{y\to1^-} y^{\frac{2y}{1-y^2}} = \lim_{z\to-\infty} \frac{\left(1-\frac1z\right)^z}{\left(1-\frac1z\right)^{\frac12\left(1+\frac1{2z-1}\right)}} = \lim_{z'\to\infty} \frac{\left(1+\frac1{z'}\right)^{\frac12\left(\frac1{2z'+1}-1\right)}}{\left(1+\frac1{z'}\right)^{z'}} = \frac1{\sqrt{1} e} = \frac1e$$
where $z'=-z$.
The one-sided limits agree, and the result follows.