Calculus · real student question

Solve the partial differential equation dC/dt = D * d2C/dx2 - k*C.

Question

Solve the partial differential equation

Ct=D2Cx2kC\frac{\partial C}{\partial t}=D\frac{\partial^{2}C}{\partial x^{2}}-kC

Step-by-step solution

  1. Read the physics in the two terms. DCxxD\,C_{xx} is ordinary diffusion and kC-kC 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.

  2. Make the substitution that peels off the decay. Set

    C(x,t)=ektu(x,t)C(x,t)=e^{-kt}u(x,t)

    Then Ct=ekt(utku)C_{t}=e^{-kt}\left(u_{t}-ku\right) and Cxx=ektuxxC_{xx}=e^{-kt}u_{xx}, because the exponential does not depend on xx.

  3. Substitute and cancel. The equation becomes

    ekt(utku)=Dektuxxkektue^{-kt}\left(u_{t}-ku\right)=De^{-kt}u_{xx}-ke^{-kt}u

    Dividing by ekte^{-kt} (never zero) gives utku=Duxxkuu_{t}-ku=Du_{xx}-ku, and the ku-ku terms cancel on both sides:

    ut=Duxxu_{t}=Du_{xx}

    The decay term is gone exactly — not approximately — so every known solution of the heat equation transfers.

  4. Solve the reduced problem by separation of variables. Writing u=X(x)T(t)u=X(x)T(t) and dividing by XTXT:

    TT=DXX=λ\frac{T'}{T}=D\frac{X'\prime}{X}=-\lambda

    so T(t)=eλtT(t)=e^{-\lambda t} and X+λDX=0X'\prime+\dfrac{\lambda}{D}X=0. For λ>0\lambda>0 this gives X=Acosλ/Dx+Bsinλ/DxX=A\cos\sqrt{\lambda/D}\,x+B\sin\sqrt{\lambda/D}\,x; the admissible λ\lambda are fixed by the boundary conditions.

  5. Assemble the general separated solution. Undoing the substitution,

    C(x,t)=ektn(AncosλnDx+BnsinλnDx)eλntC(x,t)=e^{-kt}\sum_{n}\left(A_{n}\cos\sqrt{\tfrac{\lambda_{n}}{D}}x+B_{n}\sin\sqrt{\tfrac{\lambda_{n}}{D}}x\right)e^{-\lambda_{n}t}

    with the coefficients An,BnA_{n},B_{n} determined by the initial profile C(x,0)C(x,0).

  6. Sanity-check the limiting cases. If k=0k=0 the substitution is trivial and the equation is the plain heat equation ✓. If D=0D=0 the PDE reduces to Ct=kCC_{t}=-kC, whose solution C=C0ektC=C_{0}e^{-kt} is exactly what the substitution predicts with uu constant ✓. Every mode decays at the combined rate k+λnk+\lambda_{n}, so decay and diffusion simply add in the exponent.

Answer

C(x,t)=ektu(x,t)whereut=DuxxC(x,t)=e^{-kt}u(x,t)\quad\text{where}\quad u_{t}=Du_{xx}

Need to solve a different problem like this? Open the solver →