Small transverse disturbances $u(x, t)$ of a uniform ideal string of length $\pi$, fixed at its ends and stretched straight under constant tension, obey the one-dimensional wave equation $$u_{tt}=c^2u_{xx}$$ for $0\leq x \leq \pi$ with boundary conditions $$u(0,t)=u(\pi,t)=0.$$
The initial displacement of the string is $$u(x,0)=0$$ and its initial velocity is $$u_t(x,0)=kx(\pi−x).$$ Use the method of separation of variables to complete the general solution to the wave equation expressed in the form of an infinite sum.
Sorry if the question is a bit long I wasn't sure how much info to leave in. I found the general solution $$u(x,t) = \sum_{n=1}^\infty \sin(nx)(A_n \sin(nct)+B_n \cos(nct))$$ and used the initial displacement to obtain $B_n=0$ but I'm not sure how to find $A_n$. I tried using the half Fourier series but I'm not sure I'm doing it correctly.
This is the integral I'm trying to solve. $$nc A_n = \frac{2}{\pi}\int_0^\pi kx(\pi-x)\sin(nx)\ dx$$ Is this the correct method?