Well I'm not give a step by step solution, but if you are having problems because the functions are functions of different variables just regard all of P,S and T as functions of r and t. The partial derivative of P wrt r and S wrt t is just 0. Then I guess you could do things using the multivariable form of the chain rule if you really want to.
Personally I think it would be much easier just to multiply out your functions q1 and q2 to express them directly as functions of t and r, and calculate the partial derivatives directly. There are lots of cancellations - in fact I get that q2 is independent of r altogether. Then you can differentiate the functions easily and since all your functions are products you don't even have to use the product rule as you can collect all the terms in t and r in both functions together.