In this answer there's a comment which says
That's not wrong; that's a perfectly valid method. You get the derivative of any expression with respect to $x$ as the sums of all the derivatives with respect to the individual instances of $x$ while holding all other instances constant. – joriki
This blew my mind. How do you prove this?