Could someone please help me understand this proof given in an article by William Miller. It is supposed to follow from the prime number theorem that given $A(x)$ the sum of all primes less than or equal to $x$ and $\theta(x)$ the sum of the logarithm of all primes less than or equal to $x$,
$$A(x)\sim \frac{x^2}{2\log x} \ \ \ \rm and \ \ \ \theta(x) \sim x,$$
the following identity is used:
$$\theta(x) = \int_1^x \log(t)\mathrm{d}(\pi(t)),$$
where $\pi(t)$ is the prime counting function. I don't understand why this is. Here $\sim$ means asymptotic to i.e. $\lim_{n\to\infty} \frac{f(x)}{g(x)}=1$.