Differentiate x^n using implicit differentiation