How are the extra terms calculated in this equation?

21 Views Asked by At

enter image description here

I am trying to understand this equation but not getting very far because I don't get why there are 7 terms at the end when it is a square and hence should only be 4. I thought that maybe extra derivatives are being calculated on the go but it still remains unclear..

If anyone can tell me what I'm missing thatd be appreciated