Maximum Likelihood carrier phase estimation of $A\cos(2\pi f_ct)$
for the last line
$$\sin(2 \pi  f_{c}t + \phi_{ML} ) =\sin(2 \pi  f_{c}t)\cos (\phi_{ML}) +\cos(2 \pi  f_{c}t)\sin(\phi_{ML})
$$
so the integral could be written as:

\begin{align}
 \int_ {T_{0}} r(t)(\sin(2 \pi  f_{c}t)\cos (\phi_{ML}) +\cos(2 \pi  f_{c}t)\sin(\phi_{ML}))&amp;= 0\\
\Rightarrow \cos(\phi_{ML})\int_ {T_{0}} r(t)\sin(2 \pi  f_{c}t) + \sin(\phi_{ML})\int_ {T_{0}} r(t) \cos(2 \pi  f_{c}t) &amp;= 0
\end{align}

Therefore,
$$
\tan(\phi_{ML})= -\frac{\int_ {T_{0}} r(t)\sin(2 \pi  f_{c}t)}{\int_ {T_{0}} r(t) \cos(2 \pi  f_{c}t)}
$$

Hence the result.