Yes, but in this case the output is a single number, therefore you can calculate the differential in a straightforward way.
I’m wondering how you do this for multiple outputs. Here is an article describing the jacobian matrix I’m referring to: https://en.wikipedia.org/wiki/Jacobian_matrix_and_determinant 33