It's a non-linear problem. You'll need an iterative solution, something like Newton Raphson or BFGS.
Here's a simple approach.
Start by linearizing it:
16*p*dp + 16*q*dq + 8 = 0
2*p*dp + 2*q*dq + 12 = 0
This becomes a linear algebra problem:
| 16*p 16*q |[ dp ] [ -8 ]
| 2*p 2*q |[ dq ] = [ -12 ]
You'll start with an initial guess for (p, q)
:
(p, q) = (p0, q0)
You'll solve for dp and dq, using the usual linear algebra techniques.
You'll update your guesses for p and q:
(p1, q1) = (p0 + dp, q0 + dq)
You'll iterate again until your solution either diverges or converges.
There's no guarantee that it'll converge, depending on your initial guess.