Solution (source code)

= Solution

By <Fourier's law>, $q_x=-kT_x$. With nonzero <thermal conductivity> $k$, zero outward <heat flux> at both endpoints gives homogeneous <Neumann boundary conditions>:
$$
\boxed{T_x(0,t)=0,\qquad T_x(L,t)=0}.
$$
The outward normal has opposite signs at the two ends, but a zero-flux condition gives zero derivative at each.