Suppose that we have $\pi(x)\log(x)=x+O(\frac x{\log(x)})$. I want to prove that $\vartheta(x)=\sum_\limits{p\le x}\log(p)=x+O(\frac x{\log(x)})$.
I've used the relation $\lim\limits_{x\to\infty}\frac{\pi(x)\log (x)-\vartheta(x)}{x}=0$. So given $\epsilon>0$, there exists some $N>0$ such that for all $x\ge N$
$$-\epsilon x<\pi(x)\log (x)-\vartheta(x)<\epsilon x$$
or
$$-\epsilon x<\pi(x)\log (x)-x+x-\vartheta(x)<\epsilon x$$
Since $\pi(x)\log(x)=x+O(\frac x{\log(x)})$, there exists some $M>0$ such that for all $x\ge 2$,
$$-M\frac x{\log(x)}\le\pi(x)\log(x)-x\le M\frac x{\log(x)}$$ Thus we have
$$-\epsilon x+\vartheta(x)-x\le\pi(x)\log(x)-x\le M\frac x{\log(x)}$$
and
$$-M\frac x{\log(x)}\le\pi(x)\log(x)-x\le\epsilon x+\vartheta(x)-x$$
So taking $\epsilon\to0$, implies that
$$-M\frac x{\log(x)}\le\vartheta(x)-x\le M\frac x{\log(x)}$$ or $\vartheta(x)-x=O(\frac x{\log(x)})$. But this is for all $x\ge N$ and not for $x\ge 2$. So I want to know if there is a way to eliminate this problem? Could anyone give me some suggestion, please?
I've also tried to solve the problem like below
$$\vartheta(x)=\sum_{p\le x}\log(p)\le\sum_{p\le x}\log(x)=\pi(x)\log(x)=x+O(\frac x{\log(x)})$$
But I couldn't prove that
$$\vartheta(x)\ge x+O(\frac x{\log(x)}).$$
Hint: by the Abel summation formula $$\theta\left(x\right)=\pi\left(x\right)\log\left(x\right)-\int_{2}^{x}\frac{\pi\left(t\right)}{t}dt.$$