Solve the partial differential equation
Read the physics in the two terms. is ordinary diffusion and is first-order decay: substance spreads out while also disappearing at a rate proportional to how much is present. The two mechanisms are independent, which suggests the solution should factor into a decay part times a diffusion part.
Make the substitution that peels off the decay. Set
Then and , because the exponential does not depend on .
Substitute and cancel. The equation becomes
Dividing by (never zero) gives , and the terms cancel on both sides:
The decay term is gone exactly — not approximately — so every known solution of the heat equation transfers.
Solve the reduced problem by separation of variables. Writing and dividing by :
so and . For this gives ; the admissible are fixed by the boundary conditions.
Assemble the general separated solution. Undoing the substitution,
with the coefficients determined by the initial profile .
Sanity-check the limiting cases. If the substitution is trivial and the equation is the plain heat equation ✓. If the PDE reduces to , whose solution is exactly what the substitution predicts with constant ✓. Every mode decays at the combined rate , so decay and diffusion simply add in the exponent.
Need to solve a different problem like this? Open the solver →