We have $u_{tt}-u_{xx}=0$ subject to ic $u(x,0)=0$ and
$$ u_t(x,0) = \begin{cases} \cos (\pi(x-1)), & x \in (1,2) \\ 0, & \text{otherwise} \end{cases} $$
I would like to find and draw solutions at $t=3$ if $x \in (- \infty, 3) $ with $u(3,t) = 0$
Do I have to consider even extensions of the initial conditions $u_t(x,0)$? But, in this problem we have the extra condition that $u(3,t)=0$, how do we handle such cases?
A general solution of this equation can be written as $$ u(x,t) = f(x-t) + g(x+t) $$ Form the initial conditions you can find $f(x)$ and $g(x)$ for $x\in(-\infty,3)$: $$ \left\{\begin{array}{ll} f(x)+g(x)=0 & \text{for } x\in (-\infty,3) \\ -f'(x)+g'(x) = \cos(\pi(x-1)) & \text{for } x\in (1,2) \\ -f'(x)+g'(x) = 0 & \text{for } x\in (-\infty,1]\cup[2,3) \\ \end{array}\right. $$ but to get a full solution, you'll also need their values for $x\ge 3$ as well. You can obtain them from the boundary condition: $$ f(3-t) + g(3+t) = 0 \quad \text{for } t\in\mathbb{R}$$ $$ \Rightarrow \text{for }x\ge 3\quad g(x) = -f(6-x), \;f(x)=-g(6-x)$$ The boundary condition determines the proper method to extend the initial conditions for $x\ge 3$.