If $f(x)=\sum^{\infty}_{n=0}\frac{\sin(nx)}{4^n}$. Then value of $\int^{\pi}_{0}f(x)dx$ is 
If $\displaystyle f(x)=\sum^{\infty}_{n=0}\frac{\sin(nx)}{4^n}$. Then value of $\displaystyle \int^{\pi}_{0}f(x)dx$ is 

Plan
$$\int^{\pi}_{0}\sum^{\infty}_{n=0}\frac{\sin(nx)}{4^n}dx=\sum^{\infty}_{n=0}\int^{\pi}_{0}\frac{\sin(nx)}{4^n}dx$$
How do i solve it Help me please
 A: HINT
Since $4^n$ does not depend on $x$, you need
$$
\int_0^\pi \sin(nx)dx
$$
which integrates using the substitution $u = nx$
A: The term for $n=0$ vanishes, so it can be skipped, and for $n>0$ we have:
$$ \int_0^\pi \sin (nx) dx = \Big[\frac{-1}{n}\cos nx\Big]\Big|_{x=0}^{x=\pi} = \frac{1 - \cos (n\pi)}{n} = \frac{1-(-1)^n}{n}$$
You have then $$ \sum_{n=0}^\infty \frac{1}{4^n} \int_0^\pi \sin (nx) dx = \sum_{n=1}^\infty \frac{1}{4^n} \frac{1-(-1)^n}{n} = \sum_{n=1}^\infty \frac{(1/4)^n-(-1/4)^n}{n}$$
You should be probably familiar with the formula $$ \sum_{n=1}^\infty \frac{z^n}{n} = -\ln (1-z) $$
You have then 
$$ \sum_{n=1}^\infty \frac{(1/4)^n-(-1/4)^n}{n} = -\ln(1-\frac14)+\ln(1+\frac14)=\ln\frac53$$
A: Observe that $\dfrac{\sin nx}{4^n}$ is the imaginary part of $\left(\dfrac{e^{ix}}4\right)^n$
As $\left|\dfrac{e^{ix}}4\right|=\dfrac14<1$
$$\sum_{n=0}^\infty\left(\dfrac{e^{ix}}4\right)^n=\dfrac1{1-\dfrac{e^{ix}}4}=\dfrac4{(4-\cos x)-i\sin x}$$
$$\implies f(x)=\sum_{n=0}^\infty\dfrac{\sin nx}{4^n}=\dfrac{4\sin x}{(4-\cos x)^2+\sin^2x}$$
Set $17-8\cos x=y,dy=8\sin x$
$$\implies2\int_0^\pi f(x)=\int_9^{25}\dfrac{dy}y=2\ln\dfrac53$$
