A guitar string of length $l$ is pulled at the point $x=\xi$ over a small distance $h$ and released. Find the deflection $u(x,t)$ of the string for $t>0$.
Initial conditions:
$u(0,t)=0$
$u(l,t)=0$
$u(x,0)=f(x)$
$\left. \begin{array}{l} \frac{l}{\xi}x & 0<x<\xi\\ \frac{h}{\xi}(l-x) & \xi<x<l \end{array} \right\} =f(x)$
$u_t(x,0)=0$
$1$- Wave equation:
$\frac{\partial^2 u}{\partial x^2}=\frac{1}{c^2} \frac{\partial^2 u}{\partial t^2}$
$X''T=\frac{1}{c^2} XT''$
$\frac{X''}{X}=\frac{1}{c^2}\frac{T''}{T}=-m^2$ , where $-m^2$ is the separation constant.
$X''+Xm^2=0 \rightarrow X=A\cos{mx}+B\sin{mx}$
$T''+m^2c^2T=0 \rightarrow T=C\cos{mct}+D\sin{mct}$
Applying initial conditions I get $m=\frac{n\pi}{l}$
Further, $u(x,t)=C\sin{mct}.B\cos{mx}$
By superposition,
$u(x,t)=\sum^{\infty}_{n=1} E_n \sin{\frac{n\pi x}{l}}\cos{\frac{n\pi c t}{l}}$
Finding $E_n$:
$E_n=\frac{2}{l}\int^{\xi}_{0}\frac{h}{\xi} x \sin{\frac{n \pi}{l}x$ dx+ \frac{2}{l}\int^l_[\xi} \int ^l_{xi} \frac{h}{\xi}(l-x)\sin{n\pi}{l}x$ $dx$
$=\frac{4h}{\xi n^2\pi^2}\sin {\frac{n\pi}{l}}-4h\cos{\frac{n\pi\xi}{l}}+\frac{2h}{n\pi}\cos{\frac{n\pi\xi}{l}}$
But that is not the answer.
The initial displacement function $f$ should be $0$ at $x=0$ and $x=l$, and should be $h$ at $x=\xi$, and it should be continuous. So your displacement function should be $$ f(x) = \left\{\begin{array}{ll} \frac{hx}{\xi}, & 0 \le x \le \xi, \\ \frac{h(l-x)}{(l-\xi)}, & \xi \le x \le l. \end{array} \right. $$ Then, when you compute the Fourier coefficients, you can use $$ f(0)=0=f(l), \\ f'(x) = \left\{\begin{array}{ll} \frac{h}{\xi}, & 0 \le x \le \xi, \\ -\frac{h}{(l-\xi)}, & \xi \le x \le l, \end{array} \right. $$ and use integration by parts to evaluate the Fourier coefficients of $f$: \begin{align} E_n & =\frac{2}{l}\int_{0}^{l}\sin\left(\frac{n\pi x}{l}\right)f(x)dx \\ & = \frac{2}{l}\cdot\frac{l}{n\pi}\int_{0}^{l}\cos\left(\frac{n\pi x}{l}\right)f'(x)dx \\ & = \frac{2}{n\pi}\left[\int_{0}^{\xi}\cos\left(\frac{n\pi x}{l}\right)dx\frac{h}{\xi}-\int_{\xi}^{l}\cos\left(\frac{n\pi x}{l}\right)dx\frac{h}{l-\xi}\right] \\ & = \frac{2}{n\pi}\frac{l}{n\pi}\left[\sin\left(\frac{n\pi\xi}{l}\right)\frac{h}{\xi}+\sin\left(\frac{n\pi\xi}{l}\right)\frac{h}{l-\xi}\right] \\ & = \frac{2l}{n^2\pi^2}\sin\left(\frac{n\pi\xi}{l}\right)\frac{hl}{\xi(l-\xi)} \\ & = \frac{2hl^2}{n^2\pi^2\xi(l-\xi)}\sin\left(\frac{n\pi\xi}{l}\right). \end{align}