If \(\int \cos x \log \left(\tan \frac{x}{2}\right) d x=\sin x \log \left(\tan \frac{x}{2}\right)+f(x)\) then \(f(x)\) is equal to, (assuming \(c\) is a arbitrary real constant)
(A) \(\mathrm{C}\)
(B) \(c-x\)
(C) \(\mathrm{c}+\mathrm{x}\)
(D) \(2 x+c\)