I know how to do (a). I know the sine expansion of $\phi(x)$ on $(0,l)$: $\phi(x)=\sum_{n=1}^\infty B_n \sin \frac{n\pi x}{l}$, but could not get the desired form. Through the formula I mentioned above, we can write $\tilde{\phi}(x)=\phi(2l-x)=-\sum_{n=1}^\infty B_n \sin \frac{n\pi x}{l}$ for $x\in (l,2l)$. I guess there might be something wrong here.
If (b) is solved, the rest should not be too hard. Thank you!