First, there is a typo in the statement (6.2): the first sum should be multiplied by $x$. We can see that this is merely a typo by looking at how they use (4.10) right under.
With that in mind, it suffices to prove that
$$
\frac12 \sum_{n\le x}\log^2 n = \frac12 x\log^2 x - x\log x + x+ O(\log^2 x)
$$
and apply it to the sum $\sum_{d'\le\frac xd}\log^2 d'$.
I assume for convenience that $x$ is an integer. Look at (4.5) and take a sum over the whole equation:
$$
\frac12 \sum_{n\le x}\log^2 n = \sum_{n\le x}\sum_{m\le n}\frac{\log m}{m} - xC'+ O\left(\sum_{n\le x}\frac{\log n}{n}\right)
\tag{1}
\label{1}
$$
The last term is $O(\log^2x)$ by (4.5). The first term is equal to
$$ \begin{split}
\sum_{m=1}^x\sum_{n=m}^x\frac{\log m}{m}
&= \sum_{m=1}^x(x-m+1)\frac{\log m}{m}\\
&= (x+1)\sum_{m=1}^x\frac{\log m}{m} - \sum_{m=1}^x\log m\\
&= \frac12(x+1)\log^2 x + (x+1)C' + O\left(\log x\right) - \sum_{m=1}^x\log m
\end{split}
\tag{2}
\label{2}
$$
Here we used (4.5) again. I claim that
$$
\sum_{m=1}^x\log m = x\log x - x + O(\log x)
\tag{3}
\label{3}
$$
Plug \eqref{2} and \eqref{3} into \eqref{1}, and you get the result.
To prove \eqref{3}, you can use the same strategy on (4.4) instead of (4.5) in the article. The proof is completely analogous.
Let me know if you need more details on something :)
EDIT
Explanation of \eqref{2}, line 1: First we swap the order of summation, $\sum_{n=1}^x\sum_{m=1}^n = \sum_{m=1}^x\sum_{n=m}^x$, giving the left hand side of \eqref{2}. The terms in the sum are constant with respect to $n$, and $x-m+1$ is the number of terms in the inner sum, so the inner sum works out to be
$$
\sum_{n=m}^x\frac{\log m}{m}
= \frac{\log m}{m}\sum_{n=m}^x 1
= \frac{\log m}{m} (x-m+1)
$$