Weird result using separation of variables in wave equation problem hello I have a homework and i think this problem is wrong:

$$
\left\{
\begin{array}{ll}
u_{tt} &= u_{xx}\\
u_{x}(0, t) &= 0 \\
u_x (1, t) &= t \\
u(x,0) &= 0 \\
u_t(x,0) &= \cos{\pi x}\\
\end{array}
\right.
$$

I think in 3rd equation $u_x(1, t)$ must be equal to zero not $t$.
because if $u_x(1, t) = t$ then:
$$ X'(1)T(t) = t \qquad\Rightarrow T(t) = ct  \qquad \Rightarrow T''(t) = 0$$
am I wrong? is this problem solvable?
thanks
 A: Why do you think that the problem in unsolvable? Are you solving the problem through separation of variables?
Let $u(x,t)=X(x)T(t)$. Substitution into the PDE produces
$$X(x)T''(t)-X''(x)T(t)=0$$
where by seperating the variables, we obtain
$$\frac{X''(x)}{X(x)}=\frac{T''(t)}{T(t)}=-\lambda$$
for some constant $\lambda$. We have
$$X''(x)+\lambda X(x)=0\tag{1}$$
$$T''(t)+\lambda T(t)=0\tag{2}$$
Inside $(1)$, we need to analyze the boundary conditions given by $u_x(0,t)=0$ and $u_x(1,t)=t$. So,
$$u_x(0,t)=X'(0)T(t)=0 ~~~\Rightarrow~~X'(0)=0$$
$$u_x(1,t)=X'(1)T(t)=t ~~~\Rightarrow~~T(t)=\frac{t}{X'(1)} ~~~\Rightarrow~~ T(t) = ct  ~~~\Rightarrow~~ T''(t) = 0$$
Hence, we need to solve $-X''(x)T(t)=0$. But, from $(2)$ we see that
$$T''(t)+\lambda T(t) = 0 \implies \lambda T(t)=0 \implies T(t)=0$$
which suggests that
$$u(x,t)=X(x)T(t)=0$$
which appears to be incorrect. Does solving for $(1)$ or $(2)$ first impact the final answer? It appears that we made a fatal mistake by solving $(1)$ first.
A: Using separation of variables, assume a solution of the form 
$$u(x,t)=X(x)T(t)$$
such that 
$$u_x(x,t) = X'(x)T(t)$$
$$u_{xx}(x,t) = X''(x)T(t)$$
$$u_t(x,t) = X(x)T'(t)$$
$$u_{tt}(x,t) = X(x)T''(t)$$
Substitution into the PDE $u_{xx} = u_{tt}$ yields:
$$X''(x)T(t) = X(x)T''(t)$$
$$\dfrac{X''(x)}{X(x)} = \lambda = \dfrac{T''(t)}{T(t)}$$
for some $\lambda \in \mathbb{R}$. Then, we have the equations
$$X''(x) - \lambda X(x) = 0$$
$$T''(t) - \lambda T(t) = 0$$
Evaluating the first boundary condition:
$$u_x(0,t) = X'(0)T(t) = 0$$
from which we assume $X'(0) = 0$.
Evaluating the second boundary condition:
$$u_x(1,t) = X'(1)T(t) = t$$
from which we assume $T(t) = ct$ with $c = \dfrac{1}{X'(1)}$. Since $T(t)$ is linear, 
$$T''(t) = 0$$
But from 
$$T''(t) - \lambda T(t) = 0$$
we get that $T(t) = 0$ and thus $$u(x,t) = X(x)T(t) = 0$$
Something isn't right here.....
A: Let us introduce $p = u_t + u_x$ and $q = u_t - u_x$. From the PDE, we deduce $p_t = p_x$ and $q_t = -q_x$, i.e. two linear advection equations with speed $-1$ and $+1$ are obtained. The solution obtained by the method of characteristics is $p(x,t) = \cos\pi(x+t)$ and $q(x,t) = \cos\pi(x-t)$ for $t \leq x$ and $t \leq 1-x$. Integrating $u_t = \frac12(p+q)$ over time or using d'Alembert's formula, one obtains
\begin{aligned}
u(x,t) &= \frac12\int_{0}^{t} (\cos\pi(x+s) + \cos\pi(x-s))\, \text d s \\
&= \frac12\int_{x-t}^{x+t} \cos\pi\xi\, \text d \xi\\
&= \frac{\sin(\pi t) \cos (\pi x)}{\pi}
\end{aligned}
for $t \leq x$ and $t \leq 1-x$.
Now, in order to reach the boundaries, we must expand the solution a bit further. Let us consider $t\geq x$ and $t \leq 1-x$. In this domain, we still have $p(x,t) = \cos\pi(x+t)$. On the boundary $x = 0$, we have $u_x = 0$, that is $q = p$. The boundary value of $p$ at the time $t-x$ is the same as its initial value at the abscissa $t-x$. Hence, the method of characteristics gives $q(x,t) = \cos\pi(t-2x)$ for $t \geq x$ and $t \leq 1-x$. Integration of $u_t = \frac12(p+q)$ over time gives
$$
u(x,t) = \frac{\sin(2\pi x) }{2\pi} + \frac12\int_{x}^{t} (\cos\pi(x+s) + \cos\pi(s-2x))\, \text d s\, .
$$
And so on for $t \leq x$ and $t \geq 1-x$ (see e.g. (1) chap. 12-*)...

(1) R. Habermann, Applied Partial Differential Equations: with Fourier Series and Boundary Value Problems, 5th ed. Pearson Education Inc., 2013.
