A chain rule for the resultant of two polynomials