I would like to simplify the formula manually as follows: $$ \int_0^a{\sin \left( \frac{n\pi}{a}x \right) \frac{1}{x}\sin \left( \frac{m\pi}{a}x \right) dx} $$ Discuss the cases where (1) $n=m$ and (2) $n\neq m$, respectively.
The results were obtained by mathematica software:
Integrate[1/x*Sin[n*Pi*x/a0] Sin[n*Pi*x/a0], {x, 0, a0}] // FullSimplify
1/2 (EulerGamma - CosIntegral[2 n \[Pi]] + Log[2 n \[Pi]])
Integrate[1/x*Sin[n*Pi*x/a0] Sin[m*Pi*x/a0], {x, 0, a0}] // FullSimplify
1/2 (CosIntegral[(m - n) \[Pi]] - CosIntegral[(m + n) \[Pi]] - Log[m - n] + Log[m + n])
I.e: $$ \left\{ \begin{array}{l} \frac{1}{2}\left( \gamma -\operatorname{Ci}\left( 2n\pi \right) +\ln \left( 2n\pi \right) \right) & n=m\\ \frac{1}{2}\left( \operatorname{Ci}\left[ \left( m-n \right) \pi \right] -\operatorname{Ci}\left[ \left( m+n \right) \pi \right] +\ln \left( \frac{m+n}{m-n} \right) \right) & n\ne m\\ \end{array} \right. $$ where $\gamma$ is Euler constant, $\operatorname{Ci}$ is Cosine Integral function.
However, my ultimate goal is to know if it is possible to manually infer that result.
Update: For $m=n$, $$ \int_0^a\frac1{x}{\sin^2(\frac{n\pi x}{a})}dx=\int_0^a\frac{1-\cos(\frac{n\pi x}{a})}{2x}dx=\frac12(\gamma-Ci(2n\pi)+\ln(2n\pi)) $$ from here. Do the same for the other.