# Trying to find partial derivatives

I have an implicit equation relating P1, P2, Q:

P1 - P2 - k * ( f(P1,Q) + g(P2,Q) ) = 0

ie. given P1, P2, I can find Q by iteration. I know the functions f and g and also have their analytical derivatives.

I need to find partial derivatives dQ/dP1 and dQ/dP2

It seems if I call the LHS F as follows:
F(P1,P2,Q) = P1 - P2 - k * ( f(P1,Q) + g(P2,Q) )

Then partial derivs:
dQ/dP1 = ( dF/P1 ) / (dF /dQ )
dQ/dP2 = ( dF/P2 ) / (dF /dQ )

Is that correct? If so then how do extend it 2 two functions, F and G:

F(P1,P2,P3,Q) = P1 - P2 - k1 * ( f(P1,Q) + g(P2,Q) ) = 0
G(P1,P2,P3,Q) = P2 - P3 - k2 * ( g(P2,Q) + h(P3,Q) ) = 0

( where P2 and Q are the 2 variables to be solved for in the 2 simultaneous equations )

To find partial derivs:
dQ/dP1, dQ/dP3

?

Update: after I found my sign problem:

dQ/dP1 = - ( dF/P1 ) / (dF /dQ )
dQ/dP2 = - ( dF/P2 ) / (dF /dQ )

This works fine for the 1 equation system.

However I'm not sure what to do with the 2 equation system. I guess this is because P2 is a function of P1, P3 and Q, so cannot be held constant.

Can anyone help?