Answer
a) The tangent at $P$ is $y=-4x+4+\pi$.
b) The tangent at $Q$ is $y=2$.
Work Step by Step
$$y=f(x)=1+\sqrt2\csc x+\cot x$$
1) Find $f'(x)$: $$f'(x)=(1+\sqrt2\csc x+\cot x)'=-\sqrt2\csc x\cot x-\csc^2x$$ $$f'(x)=-\frac{\sqrt2\cos x}{\sin^2x}-\frac{1}{\sin^2x}=\frac{-\sqrt2\cos x-1}{\sin^2x}$$
a) Find the tangent line at $P(\pi/4,4)$:
We have $$f'(\frac{\pi}{4})=\frac{-\sqrt2\cos\frac{\pi}{4}-1}{\sin^2\frac{\pi}{4}}=\frac{-\sqrt2\times\frac{\sqrt2}{2}-1}{(\frac{\sqrt2}{2})^2}=\frac{-1-1}{\frac{1}{2}}=-4$$ which is also the slope of the tangent line at $P$.
So the tangent line at $P$ is $$y-4=-4(x-\frac{\pi}{4})=-4x+\pi$$ $$y=-4x+4+\pi$$
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{-\sqrt2\cos a-1}{\sin^2a}=0$$ $$-\sqrt2\cos a-1=0$$ $$\cos a=-\frac{1}{\sqrt2}=-\frac{\sqrt2}{2}$$
Comparing with the position of $Q$ on the graph, the only value of $a$ possible here is $a=3\pi/4$.
$$b=f(\frac{3\pi}{4})=1+\sqrt2\csc\frac{3\pi}{4}+\cot\frac{3\pi}{4}=1+\frac{\sqrt2}{\sin\frac{3\pi}{4}}-1$$ $$b=\frac{\sqrt2}{\frac{\sqrt2}{2}}=2$$
The tangent line at $Q(3\pi/4,2)$ is: $$y-2=0(x-\frac{3\pi}{4})=0$$ $$y=2$$