**Proof plan.** Each separated solution $u_n(t,x) = A_n e^{-\kappa n^2\pi^2 t/L^2}\cos(n\pi x/L)$ satisfies the [heat equation](/page/Heat%20Equation) and the Neumann conditions $\partial_x u_n(t,0) = \partial_x u_n(t,L) = 0$, and the constant mode $A_0/2$ (corresponding to eigenvalue $\lambda_0 = 0$) is a stationary solution. The proof has four steps: we first establish that $\sum_{n=1}^{\infty} |A_n| < \infty$ using [integration by parts](/theorems/210) and Parseval's theorem (Claim 1), then apply the [Weierstrass M-test](/theorems/272) for [uniform convergence](/page/Uniform%20Convergence) on $[0,\infty) \times [0,L]$ (Claim 2), show that exponential decay in $n$ for $t > 0$ justifies term-by-term [differentiation](/page/Derivative) to arbitrary order (Claim 3), and finally verify the PDE, [boundary](/page/Boundary), and initial conditions.
**Step 1 (Coefficient decay).**
[claim:Fourier Cosine Coefficient Decay]
Let $g \in C^1([0,L])$ with $g'(0) = g'(L) = 0$, and let $A_n = \frac{2}{L}\int_0^L g(x)\cos\frac{n\pi x}{L}\,d\mathcal{L}^1(x)$ for $n \geq 1$. Then $\sum_{n=1}^{\infty} |A_n| < \infty$.
[/claim]
[proof]
Integrate by parts with $u = g(x)$ and $dv = \cos(n\pi x/L)\,d\mathcal{L}^1(x)$:
\begin{align*}
\int_0^L g(x)\cos\frac{n\pi x}{L}\,d\mathcal{L}^1(x) &= \left[\frac{L}{n\pi}g(x)\sin\frac{n\pi x}{L}\right]_0^L - \frac{L}{n\pi}\int_0^L g'(x)\sin\frac{n\pi x}{L}\,d\mathcal{L}^1(x).
\end{align*}
The boundary term vanishes because $\sin(0) = \sin(n\pi) = 0$. Therefore
\begin{align*}
A_n &= -\frac{2}{n\pi}\int_0^L g'(x)\sin\frac{n\pi x}{L}\,d\mathcal{L}^1(x).
\end{align*}
Define $C_n := \frac{2}{L}\int_0^L g'(x)\sin\frac{n\pi x}{L}\,d\mathcal{L}^1(x)$, the Fourier sine coefficients of $g'$. Then $A_n = -\frac{L}{n\pi}C_n$, and
\begin{align*}
|A_n| &= \frac{L}{n\pi}|C_n|.
\end{align*}
Since $g' \in C^0([0,L])$, Parseval's theorem gives $\sum_{n=1}^{\infty} |C_n|^2 \leq \frac{2}{L}\|g'\|_{L^2([0,L])}^2 < \infty$. By the Cauchy–Schwarz inequality:
\begin{align*}
\sum_{n=1}^{N} |A_n| &= \frac{L}{\pi}\sum_{n=1}^{N}\frac{|C_n|}{n} \leq \frac{L}{\pi}\left(\sum_{n=1}^{N}\frac{1}{n^2}\right)^{1/2}\left(\sum_{n=1}^{N}|C_n|^2\right)^{1/2} \leq \frac{L}{\pi}\cdot\frac{\pi}{\sqrt{6}}\cdot\left(\frac{2}{L}\right)^{1/2}\|g'\|_{L^2([0,L])}.
\end{align*}
The right-hand side is bounded independently of $N$, so $\sum_{n=1}^{\infty} |A_n| < \infty$.
[/proof]
**Step 2 (Uniform convergence of the [series](/page/Series) on $[0,\infty) \times [0,L]$).**
[claim:Uniform Convergence Of The Fourier Cosine Series Solution]
The partial sums $u_N(t,x) := \frac{A_0}{2} + \sum_{n=1}^{N} A_n e^{-\kappa n^2\pi^2 t/L^2}\cos(n\pi x/L)$ converge uniformly on $[0,\infty) \times [0,L]$ to a [continuous](/page/Continuity) [function](/page/Function) $u$.
[/claim]
[proof]
The constant term $A_0/2$ is continuous and independent of $N$, so it suffices to show uniform convergence of $\sum_{n=1}^{\infty} A_n e^{-\kappa n^2\pi^2 t/L^2}\cos(n\pi x/L)$. For each $n \geq 1$ and all $(t,x) \in [0,\infty) \times [0,L]$:
\begin{align*}
\sup_{(t,x) \in [0,\infty) \times [0,L]} \left|A_n e^{-\kappa n^2\pi^2 t/L^2}\cos\frac{n\pi x}{L}\right| \leq |A_n|,
\end{align*}
since $0 \leq e^{-\kappa n^2\pi^2 t/L^2} \leq 1$ and $|\cos(n\pi x/L)| \leq 1$. By Claim 1, $\sum_{n=1}^{\infty} |A_n| < \infty$. The [Weierstrass M-test](/theorems/272) with $M_n = |A_n|$ gives absolute and uniform convergence on $[0,\infty) \times [0,L]$. Each partial sum $u_N$ is continuous, so $u$ is continuous on $[0,\infty) \times [0,L]$.
[/proof]
**Step 3 (Term-by-term differentiation for $t > 0$ and verification of the PDE).**
[claim:Smoothness And Term By Term Differentiation For Positive Time]
For every $\delta > 0$ and every pair of non-negative integers $(j,k)$, the series $\sum_{n=1}^{\infty} \partial_t^j \partial_x^k \left[A_n e^{-\kappa n^2\pi^2 t/L^2}\cos(n\pi x/L)\right]$ converges uniformly on $[\delta,\infty) \times [0,L]$. Consequently $u \in C^{\infty}((0,\infty) \times [0,L])$ and term-by-term differentiation is justified.
[/claim]
[proof]
Fix $\delta > 0$ and non-negative integers $j, k$. The constant mode $A_0/2$ is annihilated by any derivative ($j + k \geq 1$), so only the $n \geq 1$ terms contribute. Differentiating the $n$-th term $j$ times in $t$ and $k$ times in $x$ produces
\begin{align*}
\partial_t^j \partial_x^k \left[A_n e^{-\kappa n^2\pi^2 t/L^2}\cos\frac{n\pi x}{L}\right] &= A_n \left(-\frac{\kappa n^2\pi^2}{L^2}\right)^j \left(\frac{n\pi}{L}\right)^k e^{-\kappa n^2\pi^2 t/L^2}\,\psi_{n,k}(x),
\end{align*}
where $\psi_{n,k}(x)$ equals $\cos(n\pi x/L)$ when $k$ is even and $-\sin(n\pi x/L)$ when $k$ is odd, so $|\psi_{n,k}(x)| \leq 1$ in both cases. For $t \geq \delta$:
\begin{align*}
\left|\partial_t^j \partial_x^k \left[A_n e^{-\kappa n^2\pi^2 t/L^2}\cos\frac{n\pi x}{L}\right]\right| &\leq |A_n| \left(\frac{\kappa\pi^2}{L^2}\right)^j \left(\frac{\pi}{L}\right)^k n^{2j+k}\, e^{-\kappa n^2\pi^2 \delta/L^2}.
\end{align*}
For any integer $m \geq 0$ and any $s > 0$, the function $r \mapsto r^m e^{-sr}$ on $[0,\infty)$ attains its maximum at $r = m/s$ with value $(m/(se))^m$. Setting $r = n^2$, $s = \kappa\pi^2\delta/(2L^2)$, and choosing $m = j + \lceil k/2 \rceil$ so that $n^{2m} \geq n^{2j+k}$:
\begin{align*}
n^{2j+k}\,e^{-\kappa n^2\pi^2\delta/L^2} &\leq n^{2m}\,e^{-\kappa n^2\pi^2\delta/L^2} \leq C_{j,k,\delta,\kappa,L}\,e^{-\kappa n^2\pi^2\delta/(2L^2)},
\end{align*}
where $C_{j,k,\delta,\kappa,L} := \sup_{n \geq 1} n^{2m} e^{-\kappa n^2\pi^2\delta/(2L^2)} < \infty$. Therefore
\begin{align*}
\sup_{(t,x) \in [\delta,\infty) \times [0,L]} \left|\partial_t^j \partial_x^k \left[A_n e^{-\kappa n^2\pi^2 t/L^2}\cos\frac{n\pi x}{L}\right]\right| &\leq C_{j,k,\delta,\kappa,L}\,|A_n|\,e^{-\kappa n^2\pi^2\delta/(2L^2)} =: M_n.
\end{align*}
Since $\sum_{n=1}^{\infty} |A_n| < \infty$ and $e^{-\kappa n^2\pi^2\delta/(2L^2)} \leq 1$, we have $\sum_{n=1}^{\infty} M_n \leq C_{j,k,\delta,\kappa,L}\sum_{n=1}^{\infty}|A_n| < \infty$. By the [Weierstrass M-test](/theorems/272), the differentiated series converges uniformly on $[\delta,\infty) \times [0,L]$.
Since $\delta > 0$ was arbitrary, for any $(t_0,x_0)$ with $t_0 > 0$ we choose $\delta = t_0/2$ and conclude that $u$ is infinitely differentiable near $(t_0,x_0)$. Therefore $u \in C^{\infty}((0,\infty) \times [0,L])$, and for $t > 0$:
\begin{align*}
\partial_t u - \kappa\,\partial_{xx} u &= \sum_{n=1}^{\infty} A_n\left(-\frac{\kappa n^2\pi^2}{L^2} + \kappa\frac{n^2\pi^2}{L^2}\right)e^{-\kappa n^2\pi^2 t/L^2}\cos\frac{n\pi x}{L} = 0,
\end{align*}
since each $n \geq 1$ term satisfies the heat equation by the separation-of-variables construction, and the constant mode $A_0/2$ satisfies $\partial_t(A_0/2) - \kappa\,\partial_{xx}(A_0/2) = 0$ trivially.
[/proof]
**Step 4 (Boundary and initial conditions).**
For the Neumann conditions, term-by-term differentiation in $x$ is justified for $t > 0$ by Claim 3. Differentiating:
\begin{align*}
\partial_x u(t,x) &= -\sum_{n=1}^{\infty} A_n \frac{n\pi}{L} e^{-\kappa n^2\pi^2 t/L^2}\sin\frac{n\pi x}{L}.
\end{align*}
At $x = 0$: each term contains $\sin(0) = 0$, so $\partial_x u(t,0) = 0$. At $x = L$: each term contains $\sin(n\pi) = 0$, so $\partial_x u(t,L) = 0$.
For the initial condition, at $t = 0$ the series reduces to
\begin{align*}
u(0,x) &= \frac{A_0}{2} + \sum_{n=1}^{\infty} A_n \cos\frac{n\pi x}{L},
\end{align*}
which is the Fourier cosine series of $g$ on $[0,L]$. Since $g \in C^1([0,L])$ with $g'(0) = g'(L) = 0$, extending $g$ to an even, $2L$-periodic function on $\mathbb{R}$ produces a $C^1$ function whose Fourier coefficients satisfy $\sum_{n=1}^{\infty} |A_n| < \infty$ (Claim 1). The uniform convergence established in Claim 2 (evaluated at $t = 0$) then gives $u(0,x) = g(x)$ for all $x \in [0,L]$.