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.


closed as off-topic by MarcoB, Sascha, RunnyKine, Cassini, corey979 Jan 18 '17 at 18:36

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – MarcoB, Sascha, RunnyKine, Cassini, corey979
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 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.