# Divergence with Chain Rule

• I
I am looking at the derivation for the Entropy equation for a Newtonian Fluid with Fourier Conduction law. At some point in the derivation I see

$$\frac{1}{T} \nabla \cdot (-\kappa \nabla T) = - \nabla \cdot (\frac{\kappa \nabla T}{T}) - \frac{\kappa}{T^2}(\nabla T)^2$$

K is a constant and T is a scalar field. It seems obvious that there is some way to use the chain rule on the middle term to get the left and right terms, but I frankly don't exactly understand the "rules" of how to use it with the divergence. I know you can't just factor out $$\frac{1}{T}$$ from the middle term, but I'm not sure how to actually simplify that middle expression. Any help is appreciated.