\(\frac{\pi}{2}< a< \pi\Rightarrow sina>0\)
\(1+cot^2a=\frac{1}{sin^2a}\Rightarrow sina=\frac{1}{\sqrt{1+cos^2a}}=\frac{\sqrt{19}}{19}\)
\(P=\frac{sin\frac{a}{2}}{cos\frac{a}{2}}+\frac{cos\frac{a}{2}}{sin\frac{a}{2}}=\frac{sin^2\frac{a}{2}+cos^2\frac{a}{2}}{sin\frac{a}{2}.cos\frac{a}{2}}=\frac{1}{\frac{1}{2}\left(2sin\frac{a}{2}.cos\frac{a}{2}\right)}=\frac{2}{sina}=2\sqrt{19}\)