Context:

The question is :

This is my working:
for 0$\leqslant$ x $\leqslant$p, $A_{m}$ = $2\over\pi$$\int^\pi_0 {xh\over p} sin(mx)\,dx$ = $2h\over\pi p$$\int^\pi_0 xsin(mx)\,dx$ = $2h\over\pi p$[$\left.\ -xcos(mx)\over m\right|_0^\pi$ + $1\over m$$\int^\pi_0 cos(mx)\,dx$] = $2h\over\pi p$ [$-\pi cos(m\pi)\over m$ + $1\over m^{2}$ $\left.\sin (mx)\right|_0^\pi$] = $2h\over\pi p$[$-(-1)^{m}\pi \over m $]
similarly, for p$\leqslant$ x $\leqslant$$\pi$, $A_{m}$ = $2\over\pi$$\int^\pi_0 {h(\pi-x)\over (\pi-p)} sin(mx)\,dx$ = $2h\over\pi(\pi-p)$$\int^\pi_0 (\pi-x)sin(mx)\,dx$ = $2h\over\pi(\pi-p)$[$\left.\ -(\pi-x)cos(mx)\over m\right|_0^\pi$ - $1\over m$$\int^\pi_0 cos(mx)\,dx$] = $2h\over\pi(\pi-p)$ [$\pi cos(m\pi)\over m$ - $1\over m^{2}$ $\left.\sin (mx)\right|_0^\pi$] = $2h\over\pi(\pi-p)$[$(-1)^{m}\pi \over m $]
Hope there is no calculation mistake. As there is only one $A_{m}$ expected, should I sum the two coefficients? But I failed to get that desired one, Google finds me similar questions (plucked string), and in some of them there is an issue of "coefficients vanishes when m is even", but I can't see that here, and some use initial conditions http://www.math.hmc.edu/~ajb/PCMI/lecture7.pdf, but in this question what should I use?
I believe quite some people has worked on or seen there exercises before, and I admits my working is long and ugly, so, can people just tell me am I in the right track? And what has been wrong? Any hints are welcomed and would be appreciated! My self-study is lack of guidelines and there is no classmates I can talk to.