Hey devilishruby.

You should first find out what is not independent to q and write that as a function of q.

After that you should note that if you differentiate anything in a partial derivative manner and that variable is independent to everything else then you just treat it as a constant.

Also it would help you if you expressed your integral in terms of anti-derivatives and used the fundamental theorem of calculus.

https://en.wikipedia.org/wiki/Fundamental_theorem_of_calculus
You will have to do to it twice since you have a double integral.