Math100 said:
Just to confirm from where you left off,
\begin{align*}
&\frac{1}{\varphi(k)}+O(\frac{1}{\log {x}}+\int_{2}^{x}(\frac{1}{t\log {t}}\cdot \frac{1}{\varphi(k)}+\frac{R(t)}{t\log^2 {t}})dt\\
&=\frac{1}{\varphi(k)}+O(\frac{1}{\log {x}}+\frac{1}{\varphi(k)}\int_{2}^{x}\frac{dt}{t\log {t}}+\int_{2}^{x}\frac{R(t)}{t\log^2 {t}}dt+\int_{x}^{\infty}\frac{R(t)}{t\log^2 {t}}dt\\
&=\frac{1}{\varphi(k)}+O(\frac{1}{\log {x}}+\frac{\log\log {x}-\log\log {2}}{\varphi(k)}+C+O(\frac{1}{\log {2}})+O(\frac{1}{\log {x}})\\
&=\frac{1}{\varphi(k)}(1+\log\log {x}-\log\log {2})+C+O(\frac{1}{\log {x}})\\
&=\frac{1}{\varphi(k)}\log\log {x}+\frac{1}{\varphi(k)}(1-\log\log {2})+C+O(\frac{1}{\log {x}})\\
&=\frac{1}{\varphi(k)}\log\log {x}+A+O(\frac{1}{\log {x}})\\
\end{align*}
where ## A=\frac{1}{\varphi(k)}(1-\log\log {2})+C ##.
Is this correct?
Looks ok, modulo a few typos. Let me explain the calculation (explanations in brackets ##[\,\cdot\,]## at the end of a line):
\begin{align*}
\sum_{{p\ {\text{ prime }} \atop p\leq x} \atop p\equiv h{\pmod{k}}}{\frac{1}{p}}&=
\sum_{n=1}^{[x]}b_n=\sum_{n=1}^{[x]}\dfrac{a_n}{\log n}=\sum_{n=1}^{[x]}a_nf(n)\\
&\stackrel{\text{Abel}}{=}\left(\sum_{n=1}^xa_n\right)f(x)-\left(\sum_{n=1}^1 a_n\right)f(1)-\int_1^x \left(\sum_{n=1}^t a_n\right)f'(t)\,dt \\
&\stackrel{\text{Dirichlet}}{=}\left({\frac{\log(x)}{\varphi (k)}}+R(x)\right)\cdot \dfrac{1}{\log x}-\int_2^x\left({\frac{\log(t)}{\varphi (k)}}+R(t)\right)\left(\dfrac{1}{\log t}\right)'\,dt\\
&= \dfrac{1}{\log x}\left({\frac{\log(x)}{\varphi (k)}}+O(1)\right)+\int_2^x \left(\dfrac{1}{t \log^2 t}\right) \left({\frac{\log(t)}{\varphi (k)}}+R(t)\right)\,dt\\
&= \dfrac{1}{\varphi (k)}+O\left(\dfrac{1}{\log x}\right)+\ldots \quad \left[\dfrac{1}{\log x}\cdot O(1)=\dfrac{1}{\log x}\cdot C=\dfrac{C}{\log x}=O\left(\dfrac{1}{\log x}\right)\right]\\[12pt]
\ldots &+\dfrac{1}{\varphi (k)}\int_2^x \dfrac{1}{t \log t}\,dt+ C \int_2^x \dfrac{1}{t \log^2 t}\,dt \;\ldots\quad \left[R(t)=O(1)=C\right]\\[12pt]
&=\dfrac{1-\log\log 2}{\varphi (k)}+O\left(\dfrac{1}{\log x}\right)+\dfrac{\log\log x}{\varphi (k)}+\ldots \\[12pt]
&\quad\quad\quad\left[\dfrac{d}{dt}\log (\log (t))=\dfrac{1}{t\log t}\Rightarrow \int_2^x \dfrac{1}{t \log t}\,dt=\log (\log (x))-\log\log (2)\right]\\[12pt]
&\quad\quad\quad\left[\text{ and }\log\log 2 \text{ joins the first term}\right]\\[12pt]
\ldots &+ C\cdot \left(\underbrace{\int_2^\infty \dfrac{1}{t \log^2 t}\,dt}_{=\dfrac{1}{\log 2}}- \underbrace{\int_x^\infty \dfrac{1}{t \log^2 t}\,dt}_{=\dfrac{1}{\log x}}\right)\;\ldots\quad \left[\int_a^b =\int_a^\infty -\int_x^\infty \right]\\[12pt]
&=\dfrac{1-\log\log 2}{\varphi (k)}+O\left(\dfrac{1}{\log x}\right)+\dfrac{\log\log x}{\varphi (k)}+\underbrace{\dfrac{C}{\log 2}}_{=:A}-\dfrac{C}{\log x}\\[12pt]
&=\dfrac{\log\log x}{\varphi (k)}+A+O\left(\dfrac{1}{\log x}\right)+\dfrac{1-\log\log 2}{\varphi (k)}\;\ldots\quad\\[12pt]
&\quad\quad\quad\left[O\left(\log^{-1}(x)\right)-C\log^{-1}(x)=(C'-C)\log^{-1}(x)=O(\log^{-1}(x))\right]
\end{align*}
I hesitate to decide where to put ##\dfrac{1-\log\log 2}{\varphi (k)}## to.
If we pushed it in the first term ## \dfrac{\log\log x}{\varphi (k)}## we would get ##\gamma \dfrac{\log\log x}{\varphi (k)}=O\left(\dfrac{\log\log x}{\varphi (k)}\right)## which would ruin our nice first term, which is the entire reason we did this here.
We cannot put it into ##O\left(\dfrac{1}{\log x}\right)## because this gets small for increasing ##x## whereas ##\dfrac{1-\log\log 2}{\varphi (k)}## is independent of ##x##. It would ruin the boundary.
If we put it in ##A##, then we cheat a little bit. Why do we have ##\varphi (k)## explicitly in the first term if we treat it as a constant in ##A##? ##k## is a constant, so ##A## is probably a good place to be. Thus
$$
A=\dfrac{C}{\log 2}+\dfrac{1-\log\log 2}{\varphi (k)}
$$
##C## came in as ##R(t)=O(1)## which is already quite arbitrary. I guess that's why it's best that ##A## swallows ##\dfrac{1-\log\log 2}{\varphi (k)}## as another additive constant, est. ##+1.37\cdot \varphi (k).##