I split it up into the limit as x --> pi of

tan^2x + cot^2x

tan^2x = 1 - 1/cos^2x

in the limit x --> pi 1--1 = 2

for the cot^2 one

cot^2x = 1/tan^2x

i used the double angle formula and simplified to

$\displaystyle \frac{1}{1-\frac{2tanx}{tan2x}}$

then the infinities of tanx/tan2x cancel out so your left with 1/(1-2) = -1

i don't know how to more formally do the cot one!