(b)
$\int_{}^{}{cosec\ x\ dx} = \log{|cosec\ x - \cot{x| + c}}$
$= \log{\left| \frac{(1 - \cos{x)}}{\sin x} \right| + c}$
$= \log{\left| \frac{2\sin^{2}\frac{x}{2}}{2\sin\frac{x}{2}.\ \cos\frac{x}{2}} \right| + c}$
$= \log{\left| \tan\frac{x}{2} \right| + c} = f(x) + constant$
$\therefore\ f(x) = \log\left| \tan\frac{x}{2} \right|$