L $= \frac{1+cos\ x}{tan^2\ x}\\= \frac{1+cos\ x}{sec^2\ x-1}\\ = \frac{1+cos\ x}{ \frac{1-cos^2\ x}{cos^2\ x}}\\ = \frac{(cos^2\ x)(1+cos\ x)}{(1-cos\ x)(1+cos\ x)}\\= \frac{cos^2\ x}{1-cos\ x}$
$\lim_{x \to \pi} L =\lim_{x \to \pi} \frac{cos^2\ x}{1-cos\ x} = \frac{cos^2\ \pi}{1-cos\ \pi}=\frac{(-1)^2}{1-(-1)} = \frac{1}{2}$