I'm interested in solving a heat equation with a discontinuous source term in one dimension on the real line:
$$\frac{\partial u}{\partial t}(x, t) = -x\theta(x) u(x, t) - x\theta(-x)u(-x, t) + D\frac{\partial^2 u}{\partial x^2}(x, t)$$
where $\theta(\cdot)$ is the Heaviside function. The boundary conditions are that $\lim_{|x|\rightarrow\infty} u(x, t) = 0$. The initial condition is arbitrary, but even for a symmetric Gaussian or a symmetric exponential an analytical solution would be interesting.
Because of the discontinuity in the right-hand side induced by $\theta(\cdot)$, my intuition would be to solve in the two domains $x > 0$ and $x < 0$ and patch them together at $x=0$. However, the source terms have the effect of causing exponential decay with rate $x$ at the point $x$ for $x > 0$ and corresponding growth at the point $-x$. This introduces an asymmetry, which should cause a diffusive flux back to the side $x > 0$. Solving for the solution in the two domains does not seem to capture this feedback, and I'm not sure how to solve globally. What are some avenues to proceed?
As I understand your equation, it can be written as $$ u_t = -xu(|x|,t)+u_{xx}. $$ Take first the case where $x>0$. A separation of variables $u(x,t) = e^{-ct}X(x)$ gives $$ -c = -x+\frac{X''}{X}. $$ A bounded solution to this uses the Airy function ${\rm Ai}$, $$ X(x) = {\rm Ai}(x-c), $$ because ${\rm Ai}''(x) = x\,{\rm Ai}(x)$. Take $c$ to be minus a negative root of ${\rm Ai}$; there are infinitely many choices.
So we have $$ u(x,t) = e^{-ct}{\rm Ai}(x-c), \qquad (x > 0). $$
Then for $x<0$ we need to solve $$ u_t = -xe^{-ct}{\rm Ai}(-x-c)+u_{xx}. $$ For this it is sufficient to take $$ u(x,t) = -e^{-ct}{\rm Ai}(-x-c), \qquad (x < 0). $$ Thus $u$ is an odd function of $x$, and with the choice of $c$, $u$ is continuous and once differentiable with respect to $x$ at $x = 0$.
To get existence of $u_{xx}(0,t)$, this can be achieved by a linear combination of two such functions with different values of $c$, arranged so that the second derivative is zero at the origin.