Definite Integral of an Infinite Sum
Since the series converges uniformly, we can integrate term-wise. The result is
\begin{align*} \int_{0}^{\pi} f(x) \, dx &= \sum_{n=1}^{\infty} \frac{1}{4^n} \int_{0}^{\pi} \sin(nx) \, dx \\ &= \sum_{n=1}^{\infty} \frac{1}{4^n} \left[ -\frac{\cos (nx)}{n} \right]_{0}^{\pi} \\ &= \sum_{n=1}^{\infty} \frac{1 - (-1)^n}{n \cdot4^n}. \end{align*}
Now using the Taylor expansion $\log(1+x) = \sum_{n=1}^{\infty} \frac{(-1)^{n-1}}{n} x^n$, we can simplify the above series as
$$ = - \log\left(1 - \tfrac{1}{4}\right) + \log\left(1 + \tfrac{1}{4}\right) = \log \left( \tfrac{5}{3} \right). $$
Alternatively, assuming basic knowledge on complex analysis,
\begin{align*} \int_{0}^{\pi} f(x) \, dx &= \operatorname{Im} \left( \int_{0}^{\pi} \sum_{n=1}^{\infty} \left( \frac{e^{ix}}{4} \right)^n \, dx \right) = \operatorname{Im} \left( \int_{0}^{\pi} \frac{e^{ix}}{4 - e^{ix}} \, dx \right) \\ (z=e^{ix}) \quad &= \operatorname{Im} \left( \int_{1}^{-1} \frac{1}{i(4-z)} \, dz \right) = \operatorname{Im} \left[ i \log(4-z) \right]_{1}^{-1} \\ &= \log 5 - \log 3 = \log (5/3). \end{align*}
This provides a natural explanation as to why logarithm appears in the final answer.
An alternative approach: $$ f(x)=\text{Im}\sum_{n\geq 1}\frac{e^{inx}}{4^n} = \text{Im}\left(\frac{e^{ix}}{4-e^{ix}}\right) = \text{Im}\left(\frac{e^{ix}(4-e^{-ix})}{17-8\cos x}\right)=\frac{4\sin x}{17-8\cos x}$$ implies: $$ \int_{0}^{\pi}f(x)\,dx=\left[\tfrac{1}{2}\,\log(17-8\cos x)\right]_{0}^{\pi}=\log\sqrt{\frac{17+8}{17-8}}=\color{red}{\log\tfrac{5}{3}}. $$