A vibrating string of length 1 in a resistant medium with fixed ends, linear initial displacement, and zero initial velocity is modeled by the following problem
$$\left\{ \begin{array}{l l} u_{tt} - c^2u_{xx} + ru_t = 0 & \quad \mbox{$0<x<1, t>0$} \\ \quad u(x,0) = \begin{cases} x & \textrm{ if $0\le x\le 1/2$} \\ 1-x & \textrm{ if $1/2\le x\le 1,$} \end{cases} \\ \quad u_t(x,0) = 0, \\ u(0,t) = u(1,t) = 0, \\ \end{array} \right. $$
where $r$ is a constant, and $0<r<2\pi c$. Use separation of variable to find a series solution.
I have left the condition for $u(x,0)$ blank because I'm not sure how to code into the problem another brace for the two initial conditions that it has which are $x$ if $0 \leq x \leq 1/2$ and $1-x$ if $1/2 \leq x \leq 1$.
$$u(x,0)=\begin{cases}x,&\text{ when }x<1/2\\1-x,&\text{ when }x\geq1/2\end{cases}$$– Joonas Ilmavirta Mar 26 '18 at 19:03