Answer
a. $y=-4x+\pi+4$
b. $y=2$
Work Step by Step
a. Step 1. Given $y=1+\sqrt 2csc(x)+cot(x)$, we have $y'=-\sqrt 2csc(x)cot(x)-csc^2x$
Step 2. At point $P(\frac{\pi}{4},4)$, $y'=-\sqrt 2csc(\frac{\pi}{4})cot(\frac{\pi}{4})-csc^2(\frac{\pi}{4})=-\sqrt 2\sqrt 2(1)-2=-4$, The tangent line equation is $y-4=-4(x-\pi/4)$ or $y=-4x+\pi+4$
b. At point $Q$, $y'=0$, we have $-\sqrt 2csc(x)cot(x)-csc^2x=0$ which gives $csc(x)=0$ (no solution) and $\sqrt 2cot(x)=-csc(x)$ or $cos(x)=-\frac{\sqrt 2}{2}$ which gives a solution as $x=\frac{3\pi}{4}$,
and we can get $y=1+\sqrt 2csc(\frac{3\pi}{4})+cot(\frac{3\pi}{4})=1+\sqrt 2\sqrt 2-1=2$.
Thus, the tangent line equation is $y=2$