Inverse design and automatic differentiation