Solution (source code)

= Solution

\b[<Separation of variables> replaces a compatible <partial differential equation> by ordinary differential <eigenvalue> equations.] For example, with a thermally diffusive rod, $u_t=D u_{xx}$, try $u=X(x)T(t)$. Wherever division is valid,
$$
\frac{T'}{DT}=\frac{X''}{X}=-\lambda.
$$
The two sides depend on independent variables, so each must be constant. Homogeneous end temperatures $u(0,t)=u(L,t)=0$ give $X_n=\sin(n\pi x/L)$ and $\lambda_n=(n\pi/L)^2$. The general initial-temperature profile is represented by superposing these separated modes:
$$
\boxed{u(x,t)=\sum_{n=1}^\infty b_n\sin\frac{n\pi x}{L}\,e^{-D(n\pi/L)^2t},\qquad
b_n=\frac2L\int_0^L u(x,0)\sin\frac{n\pi x}{L}\,dx.}
$$
Each spatial mode decays at its own rate. For a fixed-end <wave equation> the same spatial <eigenfunctions> instead have oscillatory time factors $A_n\cos(cn\pi t/L)+B_n\sin(cn\pi t/L)$, with coefficients fixed by initial <displacement> and velocity. Similar constructions separate <Laplace's equation> in suitable coordinate systems.

A single product is usually only one mode, not the most general solution. Linear <superposition> and <completeness> of the spatial <eigenfunctions> are what extend the method to general allowed data. Nonhomogeneous boundary values can first be removed by a known stationary or particular solution. Separation is effective when the geometry, coefficients and <boundary conditions> admit a common separated eigenproblem; an arbitrary nonlinear equation or inseparable geometry need not do so. Self-adjoint <Sturm-Liouville problems> explain the weighted <orthogonality> and <completeness> in many physical applications.