I suspect I'll be minused for that but I don't know what to do anymore.
Here's the thing:
$$\begin{cases} u_{tt} = u_{xx} & t \geq 0, x\in (0,\pi) \\ u(0,x)=x, u_t(0,x)=1 & x\in[0,\pi] \\ u_x(t,0) = u_x(t,\pi)=0 & t\geq 0 \end{cases}$$
I'm told to solve this by variables separation.
It differs from other examples because I have first derivatives with respect to $x$.
What I get form it, using typical algorithm, is
$$u(t,x) = \sum_{n=1}^{\infty} \cos{nx} (C_n \cos{nt}+D_n\sin{nt}) $$
Applying the condition
$$u(0,x) = x = \sum_{n=1}^{\infty} C_n\cos{nx}$$
and here I'm stuck because I can't make a cosine series here, because cosine series for $x$ has non-zero $a_0 = \frac{\pi}{2}$.
Should I change some variable or substitute other function? Some advices here were to use Fourier Transform but I have to do it by variables separation.
If you follow the separation of variables procedure $$ u(t,x)=X(x)T(t) \\ \frac{X''}{X}=\lambda=\frac{T''}{T} $$ and impose $X'(0)=X'(\pi)=0$, then you end up with solutions $$ X=1,\cos(x),\cos(2x),\cos(3x),\cdots. $$ That is $$ X_0 = 1,X_1=\cos(x),X_2=\cos(2x),\cdots. $$ The corresponding $T_0$ solution satisfies $T_0(t)=A_0+B_0 t$. You overlooked this term because it has only a constant solution in $x$. The full general solution is $$ u(t,x) = (A_0+B_0t)+\sum_{n=1}^{\infty}(A_n\cos(nt)+B_n\sin(nt))\cos(nx). $$ The constants are determined by $$ x=u(0,x)=A_0+\sum_{n=1}^{\infty}A_n\cos(nx) \\ 1=u_t(0,x)=B_0+\sum_{n=1}^{\infty}nB_n\cos(nx). $$ $B_0=1$ and $B_n=0$ for $n=1,2,3,\cdots$.