How to find the partial derivative when there are summations and products?

I haven’t been able to understand how the partial derivative wrt Xi works and how the Xi value is calculated by eliminating phi. Can someone please help with the steps? enter image description here