If we have that: $$\theta(x)=\sum_{p\leq x}\log p,$$ and $$\psi(x)=\sum_{n\leq x}\Lambda(n)$$ Where $\Lambda(n)=\log p $ if $n=p^m$ and $\Lambda(n)=0$ in another case.
How can I prove that :
1) $\theta(x)=\psi(x)+O(\sqrt{x})$
2) $\pi(x)=\frac{\psi(x)}{\log x}+O(\frac{x}{\log^2x})$
Being $\pi(x)=\sum_{p\leq x}1$ the function that counts the number of primes less than $x$
Given any $n\in\mathbb{N}$ note every prime $p$ with $n< p\leq 2n$ divides $(2n)!$, but since $(2n)!=(n)!^2\binom{2n}{n}$ this means $p$ divides $(n)!^2\binom{2n}{n}$ thus by Euclid's lemma, $p$ must divide $(n!)^2$ or $\binom{2n}{n}$. Yet if $p$ divides $(n!)^2$ then $p$ must divide $(n!)=1\times 2\times \cdots \times n$ which means $p$ must divide an integer $1\leq k\leq n$ however this is impossible because by assumption $n<p$ therefore $p$ can not divide $(n!)^2$ meaning it must divide $\binom{2n}{n}$. Thus proving every prime $p$ in the interval $(n,2n]$ divides $\binom{2n}{n}$ or equivalently that the integer $\prod_{n<p\leq 2n}p$ divides $\binom{2n}{n}$ which means $\prod_{n<p\leq 2n}p\leq \binom{2n}{n}\leq \binom{2n}{n}+\sum_{\substack{1\leq k\leq 2n\\k\neq n}}\binom{2n}{k}=4^n$ thus we get $\prod_{n<p\leq 2n}p\leq 4^n\implies \log(\prod_{n<p\leq 2n}p)\leq n\log(4)\implies \sum_{n<p\leq 2n}\log(p)\leq n\log(4)$ which proves for every $n\in\mathbb{N}$ that:
$$\vartheta(2n)-\vartheta(n)=\left(\sum_{p\leq 2n}\log(p)\right)-\left(\sum_{p\leq n}\log(p)\right)=\sum_{n<p\leq 2n}\log(p)\leq n\log(4)$$
Thus for any $m,k\in\mathbb{N}$ if we set $n=m/2^k$ then this proves $\vartheta\left(\frac{m}{2^{k-1}}\right)-\vartheta\left(\frac{m}{2^{k}}\right)\leq \frac{m}{2^{k}}\log(4)$ which means we must have that:
$$\small\vartheta\left(m\right)=\left[\vartheta\left(m\right)-\vartheta\left(\frac{m}{2}\right)\right]+\left[\vartheta\left(\frac{m}{2}\right)-\vartheta\left(\frac{m}{4}\right)\right]+\left[\vartheta\left(\frac{m}{4}\right)-\vartheta\left(\frac{m}{8}\right)\right]+\cdots \leq \sum_{k=1}^{\infty}\frac{m}{2^k}\log(4)=m\log(4)$$
Thus for any non-negative $x\in\mathbb{R}$ setting $m=\lfloor x\rfloor$ gives $\vartheta\left(x\right)=\vartheta\left(\lfloor x\rfloor\right)\leq \lfloor x\rfloor\log(4)\leq x\log(4)$ which means $\vartheta\left(x\right)=\mathcal{O}(x)$ therefore because $\small\psi(x)=\sum_{n\leq x}\Lambda(n)=\sum_{p\leq x}\lfloor \log_p(x)\rfloor\log(p)$ we can now write $\psi(x)=\sum_{j=1}^{\lfloor\log_2(x)\rfloor}\sum_{p^j\leq x}\log(p)=\sum_{j=1}^{\lfloor\log_2(x)\rfloor}\vartheta(x^{1/j})=\vartheta(x)+\vartheta(x^{1/2})+\sum_{j=3}^{\lfloor\log_2(x)\rfloor}\vartheta(x^{1/j})$ which finally proves that $\psi(x)=\vartheta(x)+\vartheta(x^{1/2})+\mathcal{O}(x^{1/3}\log(x))\implies \psi(x)=\vartheta(x)+\mathcal{O}(x^{1/2})$. Now by partial summation we have that:
$$\small \frac{\psi(x)}{\ln(x)}+\mathcal{O}\left(\frac{x}{\log(x)^2}\right)=\frac{\psi(x)}{\ln(x)}+\mathcal{O}\left(\int_{2}^x\frac{1}{\ln(t)^2} dt\right)=\frac{\psi(x)}{\ln(x)}+\int_{2}^x\frac{\psi(t)}{t\ln(t)^2} dt=\sum_{1<n\leq x}\frac{\Lambda(n)}{\ln(n)}\\\implies \small \frac{\psi(x)}{\ln(x)}+\mathcal{O}\left(\frac{x}{\log(x)^2}\right)=\sum_{j=1}^{\lfloor\log_2(x)\rfloor}\frac{\pi(x^{1/j})}{j}\implies \small \pi(x)=\frac{\psi(x)}{\ln(x)}+\sum_{j=2}^{\lfloor\log_2(x)\rfloor}\frac{\pi(x^{1/j})}{j}+\mathcal{O}\left(\frac{x}{\log(x)^2}\right)\\\implies \pi(x)=\frac{\psi(x)}{\ln(x)}+\mathcal{O}\left(\frac{x}{\log(x)^2}\right)$$
As required.