I want to solve Laplace problem on a disk.
$$U_{xx}+U_{yy}=0 \quad on \quad D=\{r<a\}$$
$$U(a,\theta)=1+3\sin\theta \quad for\quad r=a$$
The solution is given by the formula
$$u(r,\theta)=\frac{A_0}{2}+\sum_{n=1}^{\infty}r^n(A_n\cos n\theta +B_n\sin n\theta)$$ $$A_n=\frac{1}{\pi a^n}\int_{0}^{2\pi}u(a,\theta)\sin(n\theta)d\theta\quad for \quad n\geq 0$$ $$B_n=\frac{1}{\pi a^n}\int_{0}^{2\pi}(u(a,\theta)\sin(n\theta)d\theta\quad for\quad n\geq1$$
I want to calculate the coefficent$ B_n$
$$B_n=\frac{1}{\pi a^n}\int_{0}^{2\pi}(1+3\sin\theta)\sin(n\theta)d\theta=\frac{1}{\pi a^n}\Bigg(\int_{0}^{2\pi}\sin(n\theta )d\theta +3\int_{0}^{2\pi}\sin\theta sin(n\theta)d\theta \Bigg)$$ $$\int_{0}^{2\pi}\sin(n\theta)d\theta=0\quad for \quad all \quad n$$ $$\int_{0}^{2\pi}\sin\theta \sin(n\theta )d\theta =\frac{1}{2} \int_{0}^{2\pi}\cos((1-n)\theta)-\cos((1+n)\theta)d\theta=$$ $$=\frac{1}{2} \bigg[\frac{1}{1-n}\sin((1-n)2\pi)-\frac{1}{1+n}\sin((1+n)2\pi)\bigg]_{0}^{2\pi}=0$$ The answer which is given is $B_n = \frac{3}{a}$ for $n=1$ and $B_n=0$ for $n > 1.$
I don't know how we get that answer, as from my calculation $B_n$ is zero for all $n\geq 1.$
Your last integral is not quite right
$$ \int_0^{2\pi} \sin\theta \sin(n\theta)d\theta = 0 $$
for $n \ne 1$. But your result is undefined for $n=1$, so you have to do that integral separately.
While you do that, there is a better method without integration. Notice that $f(\theta)$ is already a Fourier series, with terms corresponding to $n=0$ and $n=1$. So all you need to do is compare:
$$ f(\theta) = 1 + 3\sin \theta = \frac{A_0}{2} + a(A_1\cos\theta + B_1\sin\theta) $$
with all the other coefficients $0$. Can you finish?