Fourier series coefficients in PDEs

I have a problem that involves solving a PDE using separation of variables. For context, here is the question:

$u(x,t)$ is the displacement of a string at position $x$ and time $t$, which is stretched between $x=0$ and $x=1$. Its motion satisfies $$u_{tt}+2\alpha u_t=c^2u_{xx},$$ where $\alpha$ and $c$ are real positive constants and is subject to $u(0,t)=u(1,t)=0$, $u(x,0)=f(x)$ $\left( f \text{ is an arbitrary function} \right)$ and it is initially at rest i.e. $u_t(x,0)=0$. Assume $\alpha <c\pi$.

I derived the general solution without any problems, but now I need to find a formula for the remaining coefficient. It may be more apparent with the equation below. $$u(x,t)=\sum_{n \in \mathbb{N}}c_ne^{-\alpha t}\sin(n \pi x)\left( \frac{\gamma_n}{\alpha}\cos(\gamma_n t)+\sin(\gamma_n t) \right) \: \: \forall t>0, \: x \in (0,1),$$ where $\gamma_n=\sqrt{c^2n^2\pi^2-\alpha^2}$. The only initial condition I have not considered is $u(x,0)=f(x)$. The initial condition implies that $$\sum_{n \in \mathbb{N}}\frac{c_n\gamma_n}{\alpha}\sin(n \pi x)=f(x).$$

Now, I believe that this means that $c_n$ is equal to the half-range Fourier sine series coefficients of $f(x)$... $$c_n=\frac{2\alpha}{\gamma_n}\int_0^1f(x)\sin(n\pi x) \: \text{d}x.$$ But I'm not $100\%$ sure. Any help/confirmation would be great!


This is why I prefer to just derive the conditions each time. You have

$$f(x) = \sum_{n \in \mathbb{N}} \frac{c_{n} \gamma_{n}}{\alpha} \sin(n \pi x)$$

Multiplying by $\sin(m \pi x)$ $\quad (*)$

$$\implies f(x) \sin(m \pi x) = \sum_{n \in \mathbb{N}} \frac{c_{n} \gamma_{n}}{\alpha} \sin(n \pi x) \sin(m \pi x)$$

Integrating over our domain

\begin{align} \implies \int_{0}^{1} f(x) \sin(m \pi x) dx &= \int_{0}^{1} \sum_{n \in \mathbb{N}} \frac{c_{n} \gamma_{n}}{\alpha} \sin(n \pi x) \sin(m \pi x) dx \\ &= \sum_{n \in \mathbb{N}} \frac{c_{n} \gamma_{n}}{\alpha} \int_{0}^{1} \sin(n \pi x) \sin(m \pi x) dx \\ &= \frac{c_{m} \gamma_{m}}{\alpha} \bigg( \frac{1}{2} \bigg), \quad \text{if } n = m \ne 0 \\ \end{align}

I'll leave you to do the $n \ne m$ ($\ne 0$) case (and for extra practice, multiply by $\cos(m \pi x)$ at $(*)$ and integrate to see what happens). Hence,

$$c_{m} = \frac{2 \alpha}{\gamma_{m}} \int_{0}^{1} f(x) \sin(m \pi x) dx, \quad n = m \ne 0$$