Differenciating Sin and Cos is very easy. (It gets trickier with the more complicated trig functions, like Tan). The way I like to remember it, is as follows:
Sin(x)
Cos(x)
-Sin(x)
-Cos(x)
When you differenciate one of these functions, you simply move down the tower to the next function. When you differenciate -Cos(x), you go back up to Sin(x). Except in this case, as you have (5x) inside the brackets, not just (x). So as you're differenciating, you change the Sin(5x) to Cos(5x) and then multiply by the differential of what's inside the brackets. Here, 5x is inside the brackets, the differencial of which is 5. So you multiply by 5. Hence; 5 Cos(5x).