# Solving Nonlinear Heat Equation with initial Conditions

I have the following setup for the linear heat equation on an infinite rod (see below). This is a pretty standard setup and the initial condition is $$e^{-x^2}$$. This initial condition is not special, it just provides a way to ensure that the code works.

Clear[x, t];
With[{u = u[t, x]}, eq = D[u, t] == k D[D[u, x], x];
ic = u == Exp[-x^2] /. t -> 0;
bc = D[u, x] == 0 /. x -> 0;]
asol = DSolveValue[{eq, ic, bc}, u, {t, x}, Assumptions -> {k > 0}];
asol[t, x]


What I want to do is test different ideas and so I want to modify this linear heat equation into the nonlinear heat equation or another PDE that is similar but is different than a linear PDE.

The nonlinear heat equation is defined as the following

$$$$\frac{\partial u}{\partial t} = \frac{\partial}{\partial x}\left[g(u) \frac{\partial u}{\partial x}\right]$$$$

and further literature on the nonlinear heat equation can be found here.

If we assume that $$g(u) = u$$ then I would expect that I could modify the setup as:

Clear[x, t];
With[{u = u[t, x]}, eq = D[u, t] == k D[ u D[u, x], x];
ic = u == Exp[-x^2] /. t -> 0;
bc = D[u, x] == 0 /. x -> 0;]
asol = DSolveValue[{eq, ic, bc}, u, {t, x}, Assumptions -> {k > 0}];
asol[t, x]


However, Mathematica simply regurgitates the code and does not produce an output.

I also wish to have a different type of setup such as:

$$$$\frac{\partial u}{\partial t} = \frac{\partial}{\partial x}\left[h(x) \frac{\partial u}{\partial x}\right]$$$$

and modify the first block of code for this as well.

If anyone can help me understand why my latter setup doesn't work and can show me how to set it up correctly, I would be very thankful.

Also this is not for a class. It is for my own personal understanding.

• The chance to obtain an analytic solution for a nonlinear PDE is basically 0. Try NDSolve. Keep in mind that you have to supply appropriate boundary conditions. However, I am not 100% whether the newest version of Mathematica can handle this nonlinearity. Best, you consult this and this. – Henrik Schumacher Jan 8 at 15:11

You can find examples of this for the numerical solver NDSolve in the