I want to find the analytical solution of the following PDE in Mathematica

$\frac{\partial u}{\partial t} = D_1\frac{\partial^2 u}{\partial x^2} - D_2 u$,

with inital condition $u(x,0) =u_0$ and

boundary conditions $u(-t, t) =u_1, u(k-t,t)=u_2$,

where $D_1, D_2, u_0, u_1, u_2$ and $k$ are constants.

  • 3
    $\begingroup$ You must have previously assigned a value to one of your variable. Evaluate Clear[u, x, t], or restart the kernel, and everything will work fine. $\endgroup$ – MarcoB Jan 18 '17 at 17:22
  • $\begingroup$ I restarted the kernel, it works fine. Thank you MarcoB. $\endgroup$ – Tapan Jan 18 '17 at 21:25
eqn = D[u[x, t], t] == D[u[x, t], {x, 2}];

ic = u[x, 0] == E^(-x^2);

sol = DSolveValue[{eqn, ic}, u[x, t], {x, t}]


E^(-(x^2/(1 + 4 t)))/Sqrt[1 + 4 t]

So no problem here.


Not the answer you're looking for? Browse other questions tagged or ask your own question.