Maxim L. answered 11d
UC Berkeley-Educated Data Scientist, 20 Years of Using Calculus
Thanks for the question! I recorded a video walking through this one in much more detail, but here's the quick-and-dirty written version:
Since f and g each depend on two variables, the derivatives in the answer are partials: ∂f/∂x, ∂f/∂p, ∂g/∂y and ∂g/∂p.
Step 1. Take the total differential of each equation:
dy = (∂f/∂x) dx + (∂f/∂p) dp
dx = (∂g/∂p) dp + (∂g/∂y) dy
(In the video I use a 3D surface to show why this formula works.)
Step 2. Solve the second equation for dp, substitute it into the first, and collect the dy terms on one side:
dy [∂g/∂p + (∂f/∂p)(∂g/∂y)] = dx [(∂f/∂x)(∂g/∂p) + ∂f/∂p]
Step 3. Divide:
dy/dx = [(∂f/∂x)(∂g/∂p) + ∂f/∂p] / [∂g/∂p + (∂f/∂p)(∂g/∂y)]
Note: This holds wherever the denominator isn't zero.