Upper bound for $|\zeta'(s)|$ near the line $\sigma=1$, a detailed proof

In page 285 Apostol leaves as a reader's asigment the proof that $|\zeta'(s)|=O(\log^{2}t)$, this is for every $T>0$ there exists a positive constant $K$ (depending on T) such that $$|\zeta'(s)|\leq K\log^{2}t$$ for all $s=\sigma + it$ with $\sigma \geq 1/2$ satisfying $$\sigma>1-\frac{T}{\log t}$$ and $t\geq e$.

With Apostol's hint I start assuming that $\sigma\geq 2$ that provide $|\zeta'(s)|\leq|\zeta'(2)|=\sum_{n=1}^{\infty}\log n/n^{2}$, but I don't understand that this fulls this case, it is for every $T>0$, for $\sigma\geq 2$, $\exists K>0$ such that $|\zeta'(s)|\leq K\log^{2}t$. I don't kwnow how obtain the bound from previous series.

After following (even I follow Apostol' scheme that shows corresponding question handling for $|\zeta(s)|$) I assume $\sigma<2$ and compute $|s|=\sqrt {\sigma^2 +t^2}\leq 2+t\leq e+t\leq 2t$, $|s-1|\geq\sqrt{0+t^2}=t$, so, from $|s-1|\geq t$ I compute $1/|s-1|\leq 1/t$.

Now, I use a known (a previously proved inequality, formula (18) page 284 of [1], below I don't copy this, only I bound following Apostol's proof to estimate $|\zeta(s)|$, now to estimate $|\zeta'(s)|$). I essays the method to write $$|\zeta'(s)|\leq \sum_{n=1}^{N}\frac{\log n}{n^\sigma}+t\int_{N}^{\infty}\frac{\log x}{x^{\sigma+1}}dx+\int_{N}^{\infty}\frac{1}{x^{\sigma+1}}dx+\frac{N^{1-\sigma}\log N}{t}+\frac{N^{1-\sigma}}{t^2}$$

By an integration by parts I compute $$\int_{N}^{\infty}\frac{\log x}{x^{\sigma+1}}dx=\frac{\log N}{\sigma N^\sigma}+\frac{N^\sigma}{\sigma^2}$$ Now following Apostol I take $N=[t]$, then $\log n\leq \log t$ if $n\geq N$ and the hypothesis $1-\sigma<T/\log t$ implies $1/n^\sigma=O(1/n)$ see page 285 of [1] for a full detailed proof, and then I compute $(\log n)/n^\sigma$ as $O((\log n)/n)$.

Near the line $\sigma=1$, using $N<t+1$, I compute $t(\log N)/\sigma N^\sigma=O(\log N)=O(1)$, I believe that this holds because $N$ is fixed (next times I ask to you if big oh computations are true near $\sigma=1$), too $1/(\sigma N^\sigma)=O(1/N)=O(1)$, $N^{1-\sigma}\log N/\log t=O((\log N)/N)=O(1)$, too (as previous I've computed) $1/(N^\sigma)=O(1/N)=O(1)$, and finally $N^{1-\sigma}/t^2=O(1/N^2)=O(1)$ (I believe, another time because $N$ is constant).

By partial summation $$\sum_{n\leq x}\frac{\log n}{n}=\frac{\log x}{x}-\int_{1}^{x}(t+O(1))\frac{1-\log t}{t^2}dt$$ and I believe that I remains equals to $(\log x)/x+\log x-(\log^2 x)/2+O((\log t)/t^2)$. Thus I compute finally

$$|\zeta'(s)|\leq \left(\frac{\log t}{t}+\log t+\frac{\log^2 t}{2}\right)+O\left(\frac{\log t}{t^2}\right)+O(1)+O(1)+O(1)+O(1)+O(1)$$ and this equals to $\leq K\log^2 t$, if I can prove that error term is less than $\log^2 t$, but I don't know.

In [2], page 314 Murty gives as hint that we need take the inverse of square of companion condition, the inequality that appears at first paragraph in this post, that safisfies $\sigma$, to work the exercise.

I assume that this exercise could was written in some course notes. My question, if you don't find a reference with a detailed proof of this is

Question. A proof verification of statement in first paragraph concerning an upper bound for $|\zeta'(s)|$ near the line $\sigma=1$.

Thanks in advance. If you want edit this post, because this is so much large, you can show a summary when the points that possibly are wrong are clear, as you see.

References:

[1] Tom M. Apostol, Introduction to Analytic Number Theory, UTM Springer (1976).

[2] M. Ram Murty, Problems in Analytic Number Theory, Graduate Texts in Mathematics RIM 206, Springer, Second Edition (2008).

There are some mistakes in your computations. For example if $N=\left[t\right]$ then $t\log\left(N\right)/\left(\sigma N^{\sigma}\right)=O\left(\log\left(t\right)\right)$ and not $O\left(1\right)$. Another mistake is in the partial summation. Recalling the formula $$\sum_{n\leq N}a_{n}\phi\left(n\right)=A_{N}\phi\left(N\right)-\int_{1}^{N}A_{t}\phi'\left(t\right)dt$$ where $A_{N}=\sum_{n\leq N}a_{n}$ we have in your case $a_{n}=1$ and $\phi\left(n\right)=\log\left(n\right)/n$ (I'm assuming that because you wrote in the integral $t\left(1+O\left(1\right)\right)\frac{1-\log\left(t\right)}{t}$) and so the first term is $\log\left(N\right)$. But the general idea is right. I write the solution so you can check by yourself if this match with yours or if there are other errors. We have, $$\zeta'\left(s\right)=O\left(\sum_{n\leq N}\frac{\log\left(n\right)}{n}\right)+O\left(\int_{N}^{\infty}\frac{dx}{x^{\sigma+1}}\right)+O\left(t\int_{N}^{\infty}\frac{\log\left(x\right)}{x^{\sigma+1}}dx\right)+O\left(\frac{N^{1-\sigma}\log\left(N\right)}{t}\right)+O\left(\frac{N^{1-\sigma}}{t^{2}}\right)+O\left(\frac{\log\left(N\right)}{N^{\sigma}}\right).$$ For the first sum there is no need to use partial summation; we can observe that $$\sum_{n\leq N}\frac{\log\left(n\right)}{n}\leq\log\left(N\right)\sum_{n\leq N}\frac{1}{n}\ll\log^{2}\left(N\right)$$ for the first integral we have $$\int_{N}^{\infty}\frac{dx}{x^{\sigma+1}}=O\left(\frac{1}{N^{\sigma}}\right)=O\left(1\right)$$ for the second, recalling that $N=\left[t\right]$ $$t\int_{N}^{\infty}\frac{\log\left(x\right)}{x^{\sigma+1}}dx=O\left(\frac{t\log\left(N\right)}{\sigma N^{\sigma}}\right)=O\left(\log\left(t\right)\right)$$ and the other terms are trivially all $O\left(1\right)$. Then $$\zeta'\left(s\right)=O\left(\log^{2}\left(t\right)\right).$$