((1-tga)^2+(1+tga)^2)*cos^2a= (1-2tga+tg^2a+1+2tga+tg^2a)*cos^2a= (2+2tg^2a)*cos^2a= 2(1+tg^2a)*cos^2a= 2(cos^2a+tg^2a*cos^2a)= 2(cos^2a+sin^2a)=2*1=2