Answer
The equation of the tangent is $y=-2x+\pi+1.$
Work Step by Step
$f(x)=\dfrac{\dfrac{1+\cos{x}}{2}}{\dfrac{1-\cos{x}}{2}}=\dfrac{\cos^2{\dfrac{x}{2}}}{\sin^2{\dfrac{x}{2}}}=\cot^2{\dfrac{x}{2}}.$
Using the Chain Rule with $u=\cot{\dfrac{x}{2}}\rightarrow\dfrac{du}{dx}=-\frac{1}{2}\csc^2{\dfrac{x}{2}}.$
$f'(x)=(2\cot{\dfrac{x}{2}})(-\frac{1}{2}\csc^2{\dfrac{x}{2}})=-\cot{\dfrac{x}{2}}\csc^2{\dfrac{x}{2}}.$
$f'(\dfrac{\pi}{2})=-\cot{\dfrac{\pi}{4}}\csc^2{\dfrac{\pi}{4}}=-2.$
Equation of tangent:
$(y-y_0)=m(x-x_0)$ at point $(x_0, y_0)$ and slope $m$.
$(y-1)=-2(x-\dfrac{\pi}{2})\rightarrow y=-2x+\pi +1.$