This question was asked in Ex 5.5, 10
In Question 10 of exercise 5.5,
There is x along with cos in the last answer of du/dx.

Please take a look into it.
Sreemayi V's image