Prime Number theorem and the prime counting function

its supposed to follow from the prime number theorem that given,

$A(x)$ which is the sum of all primes less than or equal to $x$

and $\theta(x)$ which is the sum of the logarithm of all primes less than or equal to x

$A(x)\sim \frac{x^2}{2\log x}$ 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$

-
The notation $$\int \log(t)\ d(\pi(t))$$ is an example of the Stieltjes integral. Some like this (I don't) when discussing summation, as integrating with a step function $f(t)$ inside the $d$ notation is essentially a summation. Here $\pi(t)$ is constant, save at prime values of $t$ where it jumps by $1$. This means that $$\int_a^b g(t)\ d(\pi(t))=\sum_{p\ \mathrm{prime}}g(p)\times 1.$$ Here the summation is over all primes in the interval from $a$ to $b$ (I can't remember whay you do about the endpoints; one reason I don't like the notation). If you like you can think that $$\int_a^b g(t)\ d(\pi(t))=\int_a^b g(t)\pi'(t)\ dt$$ where $\pi'$ is seen as a generalized function, so as a bunch of delta-functions at the primes. Again one has to do the right thing (or is it the left thing? :-)) at the endpoints.