One way to do this would be to use the product rule. The derivative of "q" is 1, of course, and the derivative of is because the derivative of "Cq" where C is not a function of q, is just C itself.

Putting those together, using the product rule:

Another way to do this is to go ahead and multiply that out:

.

Now, the derivative of Cq is just C and the derivative of is 2Cq so the derivative of that is

.

Those two methods should give you the same thing.