How to prove $\sum_{d\mid q}\frac{\mu(d)\log d}{d}=-\frac{\phi(q)}{q}\sum_{p\mid q}\frac{\log p}{p-1}$? Prove that $$\sum_{d\mid q}\frac{\mu(d)\log d}{d}=-\frac{\phi(q)}{q}\sum_{p\mid q}\frac{\log p}{p-1},$$
where $\mu$ is Möbius function, $\phi$ is Euler's totient function, and $q$ is a positive integer.
I can get
\begin{align}
\sum_{d\mid q} \frac{\mu(d)\log d}{d}& = \sum_{d\mid q}\frac{\mu(d)}{d}\sum_{p\mid d}\log p \\
& = \sum_{p\mid q} \log p \sum_{\substack{d\mid q \\ p\mid d}} \frac{\mu(d)}{d}
= \sum_{p\mid q} \log p \sum_{\substack{d \\ p\mid d \mid q}} \frac{\mu(d)}{d},
\end{align}
Let $d=pr$, then $\mu(d)=\mu(p)\mu(r)=-\mu(r)$,
$$ \sum_{p\mid q} \log p \sum_{\substack{d \\ p\mid d \mid q}} \frac{\mu(d)}{d}= - \sum_{p\mid q} \frac{\log p}{p} \sum_{\substack{r\mid q \\ p \nmid r}} \frac{\mu(r)}{r}.$$
But I don't know why
$$- \sum_{p\mid q} \frac{\log p}{p} \sum_{\substack{r\mid q \\ p \nmid r}} \frac{\mu(r)}{r}=-\frac{\phi(q)}{q} \sum_{p\mid q} \frac{\log p}{p-1}?$$
Can you help me?
 A: Let me write $n$ instead of $q$.
We have
\begin{align}
\sum_{d|n}\frac{\mu(d)\log(d)}d
&=\sum_{d|n}\frac{\mu(d)}d\sum_{p|d}\log(p)\\
&=\sum_{p|n}\log(p)\sum_{p|d|n}\frac{\mu(d)}d\\
&=\frac 1n\sum_{p|n}\log(p)\sum_{p|d|n}\mu(d)\frac nd
\end{align}
Write $n=p^em$ with $p\nmid m$.
Then $\varphi(n)=p^{e-1}(p-1)\varphi(m)$ and
\begin{align}
\sum_{p|d|n}\mu(d)\frac nd
&=\sum_{d\mid m}\sum_{i=1}^e\mu(p^id)\frac{p^em}{p^id}\\
&=\sum_{d\mid m}\mu(pd)\frac{p^em}{pd}\\
&=-\sum_{d\mid m}\mu(d)\frac{p^em}{pd}\\
&=-p^{e-1}\varphi(m)\\
&=-\frac{\varphi(n)}{p-1}
\end{align}
A: I find a paper "On some identities in multiplicative number theory", Olivier Bordellès and Benoit Cloitre, arXiv:1804.05332v2 https://arxiv.org/abs/1804.05332v2
Using Dirichlet convolution
\begin{eqnarray*}
   - \frac{\varphi(n)}{n} \sum_{p \mid n} \frac{\log p}{p-1} &=& - \frac{1}{n} \sum_{p \mid n} \varphi \left( \frac{n}{p} \right) \log p \\
   &=& - \frac{1}{n} \left( \Lambda \ast \varphi \right) (n) \\
   &=& - \frac{1}{n} \left( - \mu \log \ast \mathbf{1} \ast \mu \ast \mathrm{id} \right) (n) \\
   &=& \frac{1}{n} \left( \mu \log \ast \mathrm{id} \right) (n) \\
   &=& \sum_{d \mid n} \frac{\mu(d) \log d}{d}.
\end{eqnarray*}
