Given that the OP asks for derivatives with respect to b and varphi, let's assume that these are the independent variables, and that x and r are just parameters. And for simplicity, let's call varphi just phi. Then the analysis can be simplified to w=w(b,phi) with the constraint f(b,phi)=0.
I believe that the constraint implies there can be only one independent variable. So, if a derivative with respect to b is expected, then the functional dependencies are w(b, phi(b)) = W1(b) and the derivative with respect to b would be obtained via
diff(w,b)+diff(w,phi)*implicitdiff(f,phi,b) (using Maple's implicitdiff command).
When I calculate d_W1/db this way, and replace phi with phi(b,x,r) from the constrant, I obtain the same result as Rouben did by eliminating phi immediately.
If a derivative with respect to phi is expected, the the functional dependencies are w(b(phi),phi) = W2(phi) and the derivative with respect to phi would be obtained via
When I calculate d_W2/d_phi by this recipe, and replace phi with it's equivalent, I do not get the second result that Rouben obtained. I suspect that w(x,b,r,phi(x,b,r)) does not lead to the correct derivative with respect to phi, given that r is assumed to be a parameter and that b is the other independent variable.
I looked at this problem because it appeared to be one of the more challenging ones of the type that appear in Advanced Calculus textbooks where the intricacies of the chain rule for partial derivatives are expounded. (The issue of determining the independent variables seems to be important here.) If my interpretation is flawed, I would be pleased to be enlightened.