PDE (heat equation type) with strange boundary value behaviour I have the following PDE:
$$u_t=u_{xx}$$
EDIT (Because I was not clear):
The boundary conditions can be stated in two versions. In general it is known that the solution is symmetric in $x$ and we know that $u(x=1,t)=0$. 
So the boundary conditions can be stated as version 1:
$$u(x=1,t)=0 \qquad \text {and} \qquad u_x(x=0,t)=0.$$
Now, by the symmetry in $x$ it is also true that $u(x=-1,t)=0$. So the second version of boundary condtions can be stated as:
$$u(x=1,t)=0 \qquad \text {and} \qquad u(x=-1,t)=0.$$
If I apply method of separation $u=T(t)X(x)$, I will get the following system of ODEs:
$$T'(t)/T(t)=-k^2 \qquad X''(x)/X(x)=-k^2.$$
These have the general solutions:
$$T(t)=T_0\mathrm{e}^{-k^2t} \qquad X(x)=a\sin(kx)+b\cos(kx).$$

Now, here comes the strange thing (different solutions depending on what solution "path" I take and which boundary condition version I use). 
If I use $u(x=\pm1,t)=0$, I get $X(x=\pm1)=0$:
$$0=a\sin(k)+b\cos(k) \qquad 0=-a\sin(k)+b\cos(k)$$
Adding both equations gives:
$0=b\cos(k) \implies b = 0$ or $k=\pi+\pi l$, with $l\in \mathbb{Z}$. 
Considering $b=0$: This can imply $a=0$, which leads to a trivial solution, but it can also lead to a consistent result for $k=\pi l$, in which $l\in \mathbb{Z}$.
How is it possible, that there are the two different solutions?
$$X(x)=a\sin(\pi l x) \text{     or    } X(x)=b\cos((\pi/2+\pi l)x) $$
I would be glad if someone could point out my mistake.

It is interessting to note, that the boundary conditions $u(x=1,t)$ and $u_x(x=0,t)=0$ lead to one answer only.
Why does it matter which boundary conditions I use? And how can I know that I am using the right conditions?
 A: Let me offer a more structured approach to your problem. Than you may see what is weird about it.
We note that the equation is constant coefficient and posed on $\mathbb{R}_t \times [-1,1]_x$. This shows that is possible to use the Fourier transform (in $t$) to reduce the problem to the following ODE:
$$i\tau\hat{u} = \hat{u}_{xx},\\\hat{u}(\tau,\pm1) = 0.$$
Using integration by parts we see that the operator $\partial_{xx}$ with domain $C^\infty([-1,1])$ is self-adjoint on $L^2([-1,1])$. This implies that the spectrum is contained in the reals, that is the equation above has only the trivial solution for $\tau \in \mathbb{R}\setminus 0$. For $\tau = 0$ we know that $u$ must be linear and the boundary conditions demand that it is zero.
The problem is that you do not impose initial conditions for $t=t_0$. Then you would get the usual heat equation on the domain $[-1,1]$ with Dirichlet boundary condition. So if you start with some $u(t_0) = u_0$ in some reasonable space (say $C^0_0 = \{f \in C^0\,|\, f(\pm 1) = 0\}$) then you get a unique solution which is not zero. But: You can only solve for $t > t_0$.
The case of the initial value (in $x$) problem (for completeness): Let $\alpha_{\pm} = \frac{1 \pm i}{\sqrt 2}$ and note that $\alpha_{\pm}^2 = i$. Then the general solution to our equation is given by
$$\hat{u}(\tau, x) = c_1 e^{\alpha_+ \sqrt \tau x} + c_2 e^{\alpha_- \sqrt \tau x}.$$
So, we see that you have to many boundary conditions (three for two unknowns) and i guess (haven't checked it) you have some additional condition such that you can take the inverse fourier transform (because the real part of the exponential is non-zero).
