You haven't showed your attempt at a solution, just how you plugged the equation into WolframAlpha.
I would suggest writing out the first several terms of the infinite series for sin(kx) and taking the derivative of those. From there, the connection to k*cos(kx) should be clear.