Answer
a) The tangent line at $P$ is $y=-x+2+\frac{\pi}{2}$.
b) The horizontal tangent line at $Q$ is $y=4-\sqrt3$.
Work Step by Step
$$y=f(x)=4+\cot x-2\csc x$$
1) Find $f'(x)$: $$f'(x)=(4+\cot x-2\csc x)'=-\csc^2x+2\csc x\cot x$$ $$f'(x)=-\frac{1}{\sin^2 x}+\frac{2\cos x}{\sin^2x}=\frac{2\cos x-1}{\sin^2x}$$
a) Find the tangent line at $P(\pi/2,2)$:
We have $$f'(\frac{\pi}{2})=\frac{2\cos\frac{\pi}{2}-1}{\sin^2\frac{\pi}{2}}=\frac{2\times0-1}{1^2}=-1$$ which is also the slope of the tangent line at $P$.
So the tangent line at $P$ is $$y-2=-1(x-\frac{\pi}{2})=-x+\frac{\pi}{2}$$ $$y=-x+2+\frac{\pi}{2}$$
b) Find the horizontal tangent at $Q(a,b)$
Here, the coordinates of $Q$ are not given, so we need to find them. The clue we have is that the tangent at $Q$ is horizontal, meaning its slope will be $0$, or $$f'(a)=0$$
$$\frac{2\cos a-1}{\sin^2a}=0$$ $$2\cos a-1=0$$ $$\cos a=\frac{1}{2}$$
Comparing with the position of $Q$ on the graph, the only value of $a$ possible here is $a=\pi/3$.
$$b=f(\frac{\pi}{3})=4+\cot\frac{\pi}{3}-2\csc\frac{\pi}{3}=4+\frac{\sqrt3}{3}-\frac{2}{\sin\frac{\pi}{3}}$$ $$b=4+\frac{1}{\sqrt3}-\frac{2}{\frac{\sqrt3}{2}}=4+\frac{1}{\sqrt3}-\frac{4}{\sqrt3}=\frac{4\sqrt3-3}{\sqrt3}=4-\sqrt3$$
The tangent line at $Q(\pi/3,4-\sqrt3)$: $$y-(4-\sqrt3)=0(x-\frac{\pi}{3})=0$$ $$y=4-\sqrt3$$