While writing my dissertation in LaTeX, I was having a problem that some
sub-equations were not linking to the correct place. The solution is to load the
mathtools
package before the hyperref
package. This question on TeX.SX
showed the way, even though I’m not using the \numberwithin{equation}{section}
line.