Solution (source code)

= Solution
{c}

Take a bar of constant cross-sectional <area> $A$, thermally insulated along its sides, with no internal heat production. <Fourier's law> says that the <heat flux> in the positive $x$ direction is
$$
q(x,t)=-k(x)T_x(x,t).
$$
The <thermal conductivity> $k(x)$ is positive. On a small slice $[x,x+\Delta x]$, <conservation of energy> gives
$$
A\int_x^{x+\Delta x}\rho c_pT_t(s,t)\,ds
=A\bigl[q(x,t)-q(x+\Delta x,t)\bigr].
$$
Here $\rho c_p$ is the volumetric <heat capacity>, the product of <mass density> and <specific heat capacity>. Divide by $A\Delta x$, take $\Delta x\to0$, and use $\rho c_p=1$. The resulting <heat equation> is
$$
\boxed{T_t=-q_x=\frac{\partial}{\partial x}\bigl(k(x)T_x\bigr).}
$$
For differentiable $k$, this is $T_t=kT_{xx}+k'T_x$; retaining the divergence form also expresses <conservation of energy> correctly across an interface where $k$ jumps.