2017 Paper Ⅴ
  1. With $x, y$ denoting Cartesian coordinates and $\mathbf{e}_{1}, \mathbf{e}_{2}$ the associated Cartesian unit basis vectors, let $\mathbf{f}$ denote the vector field$$\mathbf{f}=\frac{x^{2}}{r} \mathbf{e}_{1}+\frac{x y}{r} \mathbf{e}_{2}$$where $r=\sqrt{x^2+y^2}$.
    (a) [6 marks] Find $∇ · \mathbf{f}$.
    (b) [9 marks] Let $R$ denote the triangle in the plane with vertices located at $(0,0),(1,0)$ and $(1,1)$. Determine$$\iint_{R} \mathbf{f} \,\mathrm{d} x \mathrm{d} y .$$(c) [5 marks] Let $S$ be the square region given by$$S=\{(x, y): x ∈[-1,1], y ∈[-1,1]\} .$$Let $C$ denote the curve given by the boundary of $S$, and $\mathbf{n}$ the outward-pointing normal to $S$ in the $x$-$y$ plane. Without explicit calculation, explain why the line integral$$∫_C \mathbf{f} · \mathbf{n} \,\mathrm{d} s$$is zero.
    Solution.
    (a) $\frac{∂r}{∂x}=\frac xr,\frac{∂r}{∂y}=\frac yr⇒∇·{\bf f}={∂f_1\over∂x}+{∂f_2\over∂y}=\left(\frac{2x}r-\frac{x^2}{r^2}\frac xr\right)+\left(\frac{x}{r}-\frac{xy}{r^2}\frac{y}{r}\right)=\frac{2x}{r}$.
    (b) $∫_R\frac{x^2}r\mathrm dx\mathrm dy=∫_{x=0}^1\mathrm dx∫_{y=0}^x\frac{x^2}r\mathrm dy=∫_{x=0}^1x^2\mathrm dx\left[\log\left(\sqrt{x^2+y^2}+y\right)\right]_{y=0}^x=∫_{x=0}^1x^2\mathrm dx\log\left(\sqrt2+1\right)=\frac{1}{3} \log \left(\sqrt{2}+1\right)$.
    $∫_R\frac{xy}r\mathrm dx\mathrm dy=∫_0^1x\left[\sqrt{x^2+y^2}\right]_0^x\mathrm dx=∫_0^1x^2\left(\sqrt{2}-1\right)\mathrm dx=\frac{\sqrt{2}-1}3$. Therefore $∫_R{\bf f}\,\mathrm dx=\left(\frac13\log\left(\sqrt2+1\right),\frac{\sqrt2-1}{3}\right)$.
    (c) For $a∈[0,1]$, we find that ${\bf f}(1,a)·{\bf e}_1=\frac1r$ cancels ${\bf f}({-1},a)·({-\bf e}_1)=-\frac1r$ and ${\bf f}(a,1)·{\bf e}_2=\frac{a}r$ cancels ${\bf f}(-a,{-1})·({-\bf e}_2)=-\frac{a}r$.
  2. Let $T(\mathbf{x}, t)$ denote the temperature at location $\mathbf{x}$ and time $t$ in a closed and bounded region $R$ with thermal conductivity $k(\mathbf{x})>0$, density $\rho$ and specific heat capacity $c$, where $\rho$ and $c$ are positive constants. Denote the boundary of $R$ by $∂R$.
    (a) [3 marks] State the Divergence Theorem.
    (b) [2 marks] Explain why the total heat energy in any region $Ω$ contained in $R$ is given by $\iiint_Ωρ c T \mathrm{~d} V$.
    (c) [6 marks] Assuming Fourier's Law, that the heat flux $\bf q$ is given by$$\mathbf{q}=-k(\mathbf{x}) ∇ T,$$derive the heat equation$$\rho c \frac{\partial T}{\partial t}=∇ ·(k(\mathbf{x}) ∇ T), \quad \mathbf{x} ∈ R$$(d) [9 marks] You may assume that in the presence of a heat energy source $S(\mathbf{x})>0$, the heat equation at steady state is given by$$0=∇ ·(k(\mathbf{x}) ∇ T)+\rho S(\mathbf{x}), \quad \mathbf{x} ∈ R .\tag1$$(i) Show that if there exists a solution of equation (1) with the boundary condition$$T=T_1(\mathbf{x}), \quad \mathbf{x} ∈ \partial R,\tag2$$for some given function $T_{1}$, then this solution is unique.
    (ii) Show that no solution exists for equation (1) if the boundary condition (2) is replaced by a boundary condition of no heat flux into $R$, that is$$\mathbf{n} ·(k(\mathbf{x}) ∇ T)=0, \quad \mathbf{x} ∈ \partial R$$Solution.
    (a) Divergence Theorem: Let $R$ be a closed, bounded region of $\mathbb{R}^3$ with a piecewise smooth boundary $\partial R$, and let $\mathbf{F}$ be a differentiable vector field on $R$. Then$$\iiint_R ∇· \mathbf{F} \,\mathrm{d} V=\iint_{\partial R} \mathbf{F} \cdot \mathrm{d} \mathbf{S},$$where $\mathrm{d} \mathbf{S}$ is oriented in the direction of the outward pointing normal from $R$.
    (b) The specific heat $c$ is the energy required to heat up a kilogram by one degree kelvin, so $cT$ is heat energy per unit mass, $ρcT$ is heat energy per unit volume, so the total heat energy in any region $Ω$ contained in $R$ is given by $\iiint_Ωρ c T \mathrm{~d} V$.
    (c) Since the rate of change of thermal energy in $Ω$ equals the rate of flow of energy into the boundary of $Ω$, we have\begin{align*}
    \frac∂{∂t}\iiint_Ωρ c T \mathrm{~d} V&=\iiint_Ωρ c {∂T\over∂t} \mathrm{~d} V&\text{by Leibniz integral rule}\\
    &=-\iint_{∂Ω}{\bf q}·\mathrm{d}{\bf S}\\
    &=-\iiint_Ω∇·{\bf q}\mathrm{~d}V&\text{by Divergence Theorem}
    \end{align*}Since $Ω$ is arbitrary, $ρ c {∂T\over∂t}=-∇·{\bf q}=∇·(k(\mathbf{x}) ∇ T)$.
    (d)(i)Let $\psi$ be the difference of two solutions, so that$$∇·(k\left(\bf x\right)∇\psi)=0 \text { in } R, \quad\psi=0 \text { on } \partial R$$By the Divergence Theorem,$$\iint_{\partial R}k\left(\bf x\right)∇(ψ^2)\cdot \mathrm{d} \mathbf{S}=\iiint_R∇·\left(k\left(\bf x\right)∇(ψ^2)\right) \mathrm{d} V$$Noting $∇(ψ^2)=2ψ∇ψ$ but $ψ=0$ on $∂R$, the LHS is 0. On the RHS we have$$∇·\left(k\left(\bf x\right)∇(ψ^2)\right)=∇·\left(2ψk\left(\bf x\right)∇ψ\right)=2∇ψ·\left(k\left(\bf x\right)∇ψ\right)+2ψ\cancel{∇·\left(k\left(\bf x\right)∇ψ\right)}=2k\left(\bf x\right)(∇ψ)^2$$Therefore $∇ψ=0$ in $R$. So $ψ$ is constant. But $ψ=0$ on $∂R$. Hence $ψ=0$ throughout $R$.
    (ii)\begin{aligned}0&=\iiint_{R}∇ ·(k(\mathbf{x}) ∇ T)\mathrm dV+\rho\iiint_{R} S(\mathbf{x})\mathrm dV\\
    &=\cancel{\iint_{∂R}k(\mathbf{x}) ∇ T\mathrm d{\bf S}}+\rho\iiint_{R} S(\mathbf{x})\mathrm dV\quad\text{by the Divergence Theorem}\\
    &>0\quad\text{as }S(\mathbf{x})>0
    \end{aligned}
  3. (a) [5 marks] State Gauss' Flux Theorem and show that it is equivalent to Poisson's equation$$∇^2 \varphi=-4 π G \rho,$$where $\varphi$ is the gravitational potential, $\rho$ is the mass density, and $G$ is the gravitational constant.
    (b) [15 marks] The mass density of a planet with a hollow core is given by$$\rho=\left\{\begin{array}{cl}0, & r<r_{0} \\ρ_0 \frac{r_0}{r} e^{-r / r_0}, & r_{0} \leqslant r \leqslant 2 r_{0} \\0, & r>2 r_{0}\end{array}\right.$$where $r$ is the distance from the planet centre, $\rho_{0}$ is a constant density, and $r_{0}$ is a constant length.
    (i) Explain why, for this planet, the gravitational field is given by the expression$$\frac{\mathrm{d} \varphi}{\mathrm{d} r} \mathbf{e}_{r}$$where $\mathbf{e}_{r}$ is the unit vector in the radial direction.
    (ii) Using Gauss' Flux Theorem, determine $\frac{\mathrm{d} \varphi}{\mathrm{d} r}$ for all values of $r$.
    (iii) Show that the gravitational potential difference between the planet centre and the planet surface is given by$$\varphi\left(2 r_{0}\right)-\varphi(0)=\alpha G \rho_{0} r_{0}^{2},$$where you should determine the dimensionless constant $\alpha$.
    [You may use the indefinite integral $∫ \frac{1}{u^2}(1+u) e^{-u} \mathrm{~d} u=-\frac{1}{u} e^{-u}$ without proof.]
    Proof.
    (a) Gauss' Flux Theorem: For a smooth and bounded region $R$, which contains matter of total mass $M$, then$$\iint_{\partial R} \mathbf{f} \cdot \mathrm{d} \mathbf{S}=-4 \pi G M$$Poisson's equation gives us that$$\nabla^2φ=-4 \pi G \rho$$where $\rho(\mathbf{r})$ is the density of the matter. Applying the Divergence Theorem we have$$\iint_{\partial R} \mathbf{f} \cdot \mathrm{d} \mathbf{S}=\iiint_{R} \nabla \cdot \mathbf{f} \mathrm{d} V=\iiint_{R} \nabla^{2}φ \mathrm{d} V=-4 \pi G \iiint_{R} \rho \mathrm{d} V=-4 \pi G M .$$Conversely suppose that we know$$\iint_{\partial R} \mathbf{f} \cdot \mathrm{d} \mathbf{S}=-4 \pi G M$$for any bounded region $R$. Then$$\iiint_{R} \nabla^{2}φ \mathrm{d} V=-4 \pi G \iiint_{R} \rho \mathrm{d} V$$and so$$\iiint_{R}\left(\nabla^{2}φ+4 \pi G \rho\right) \mathrm{d} V=0 \text { for any bounded region } R \text {. }$$Hence (at least if $\nabla^{2}φ$ and $\rho$ are piecewise continuous) we have$$\nabla^{2} φ+4 \pi G \rho \equiv 0$$(b) In spherical coordinates,$$∇φ={\partial φ \over \partial r}{\bf e}_r+ {1 \over r}{\partial φ \over \partial \theta}{\bf e}_θ+ {1 \over r\sin\theta}{\partial φ \over \partialϕ}{\bf e}_ϕ$$With ${\partial φ \over \partial \theta}={\partial φ \over \partialϕ}=0$, we find that $∇φ=\frac{\mathrm{d} \varphi}{\mathrm{d} r} \mathbf{e}_{r}$.
    Applying the flux theorem to the region $r \leqslant R$ we have$$-4πG M(R)=\iint_{r=R} \nabla φ\cdot \mathrm{d} \mathbf{S}=\iint_{r=R} φ'(R) \mathbf{e}_{r} \cdot \mathrm{d} \mathbf{S}=\iint_{r=R} φ'(R) \mathrm{d} S=4 \pi R^{2} φ'(R)⇒φ'(R)=-GR^{-2}M(R)$$where $M(R)$ is the total mass within the region $r \leqslant R$. For $r_0 \leqslant R \leqslant 2r_0$ we have\begin{aligned}M(R) &=\iiint_{r_0⩽r⩽R}ρ_0 \frac{r_0}{r} e^{-r / r_0}\,\mathrm{d}V\\&=4πρ_0r_0\int_{r=r_0}^Rre^{-r/r_0}\mathrm{d} r \\&=4πρ_0r_0\left[-r_0 \left(r+r_0\right)e^{-r/r_0}\right]_{r=r_0}^R\\&=4πρ_0r_0^2 \left(2 r_0e^{-1}-\left(R+r_0\right)e^{-R/r_0}\right)\end{aligned}Hence$$φ'(R)=\begin{cases}0&0<R<r_0\\4πρ_0r_0^2\left(2 r_0e^{-1}-\left(R+r_0\right)e^{-R/r_0}\right)&r_0⩽R⩽2r_0\\4πρ_0r_0^3\left(2 e^{-1}-3e^{-2}\right)&R>2r_0\end{cases}$$then integrate$$φ(R)=\begin{cases}0&0<R<r_0\\r_0 \left(e^{-1}(2 R-5 r_0)+e^{-\frac{R}{r_0}} \left(R+2   r_0\right)\right)&r_0⩽R⩽2r_0\\r_0^2e^{-2}(4-e)&R>2r_0\end{cases}$$
  4. Let $f$ be a $2 π$-periodic function. Throughout this question you may assume that all relevant integrals exist.
    (a) [6 marks]
    (i) Show that for any $a ∈ \mathbb{R}$$$∫_{a}^{a+2 π} f(x) \mathrm{d} x=∫_{0}^{2 π} f(x) \mathrm{d} x .$$(ii) Let $g$ be any function satisfying $g(x)=-g({-x})$ for all $x$. Show that$$∫_{-b}^{b} g(x) \mathrm{d} x=0$$for any $b ∈ \mathbb{R}$.
    (b) [3 marks] Write down the Fourier series for $f$, giving expressions for all of the Fourier coefficients appearing in the series.
    (c) [8 marks] Find the Fourier series for the $2 π$-periodic function defined by$$f(x)=x{|x|}, \quad x ∈[{-π}, π) .$$(d) [3 marks] By quoting an appropriate convergence theorem, show that$$\frac{π^2}{4}=\sum_{n=1}^{∞}({-1})^{n+1}\left[\frac{2 π}{2 n-1}-\frac{8}{π(2 n-1)^3}\right]$$Solution.
    (a)(i) There is $n∈\Bbb Z$ such that $a=2π(n-1)+k,0≤k<2π$, so $∫_a^{a+2 π} f(x) \mathrm{d} x=∫_a^{2πn} f(x) \mathrm{d} x+∫_{2πn}^{a+2π} f(x) \mathrm{d} x=∫_k^{2π}f(x+2π(n-1))\mathrm dx+∫_0^k f(x+2πn) \mathrm{d} x=∫_k^{2π} f(x) \mathrm{d} x+∫_0^k f(x) \mathrm{d} x=∫_0^{2 π} f(x) \mathrm{d} x$.
    (ii)$∫_{-b}^{b} g(x) \mathrm{d} x=∫_{-b}^0 g(x) \mathrm{d} x+∫_0^b g(x) \mathrm{d} x=∫_0^b g({-x}) \mathrm{d} x+∫_0^b g(x) \mathrm{d} x=-∫_0^b g(x) \mathrm{d} x+∫_0^b g(x) \mathrm{d} x=0$
    (b)$f(x)=\frac{a_0}{2}+\sum_{n=1}^{\infty}\left(a_{n} \cos (n x)+b_{n} \sin (n x)\right)$ for $x∈\Bbb R$, where the Fourier coefficients are given by $a_n=\frac{1}{\pi} \int_{-\pi}^{\pi} f(x) \cos (n x) \mathrm{d} x$ for $n⩾0$ and $b_{n}=\frac{1}{\pi} \int_{-\pi}^{\pi} f(x) \sin (n x) \mathrm{d} x$ for $n⩾1$.
    (c)For $n⩾0$, $a_n=\frac{1}{\pi} \int_{-\pi}^{\pi} x{|x|} \cos (n x) \mathrm{d} x=0$ by (a)(ii).
    For $n⩾1$, $b_n=\frac{1}{\pi} \int_{-\pi}^{\pi} x{|x|} \sin (n x) \mathrm{d} x=\frac{2}{\pi} \int_0^{\pi} x^2 \sin (n x) \mathrm{d} x$
    $=\left[-\frac2{nπ}x^2\cos(nx)\right]_0^π+\frac{2}{nπ}∫_0^π2x\cos(nx)\mathrm dx$
    $=\frac{2π}{n}(-1)^{n+1}+\frac{4}{n^2π}[x\sin(nx)]_0^π-\frac{4}{n^2π}∫_0^π\sin(nx)\mathrm dx$
    $=\frac{2π}{n}(-1)^{n+1}-\frac{4}{n^3π}(1-(-1)^n)$$=\begin{cases}-2π\over n&n=2m\\{2π\over n}-\frac8{n^3π}&n=2m-1\end{cases}$$$∴f∼∑_{m=1}^∞\left(-\frac{2π}{2m}\sin(2mx)+\left(\frac{2π}{2m-1}-\frac8{(2m-1)^3π}\right)\sin((2m-1)x)\right)$$(d)Applying Fourier Convergence Theorem to 2π-periodic extension of $f$, substituting $x=π$, we obtain $\frac{π^2}4=\sum_{n=1}^{∞}({-1})^{n+1}\left[\frac{2 π}{2 n-1}-\frac{8}{π(2 n-1)^3}\right]$
  5. (a) [10 marks] Suppose $u(x, t)$ satisfies the dimensionless wave equation$$\frac{∂^2u}{∂t^2}=\frac{∂^2u}{∂x^2}$$By setting $\xi=x-t, \eta=x+t$ and changing variables in the equation, show that $u(x, t)$ must be of the form $u(x, t)=F(x-t)+G(x+t)$. Hence derive D'Alembert's solution given the initial conditions$$u(x, 0)=f(x), \quad \frac{\partial u}{\partial t}(x, 0)=g(x) .$$(b) [10 marks] If $g(x)=0$ for all $x$ and$$f(x)= \cases{\sin x, &$x ∈[-2 π,-π] \cup[π, 2 π]$\\ 0, & otherwise}$$sketch the following cross-sections of the solution $u(x, t)$ :$$u(x, π),\hskip1exu(x, 3 π / 2),\hskip1exu(0, t),\hskip1exu(π / 2, t) .$$State an Initial Boundary Value Problem posed on $x ∈[0, ∞), t>0$ for which $u(x, t)$ is also a solution.
    Solution.
    (a)$\begin{cases}\frac{∂u}{∂t}=-\frac{∂u}{∂ξ}+\frac{∂u}{∂η}\\\frac{∂u}{∂x}=\frac{∂u}{∂ξ}+\frac{∂u}{∂η}\end{cases}⇒\begin{cases}\frac{∂^2u}{∂t^2}=\frac{∂^2u}{∂ξ^2}-2\frac{∂^2u}{∂ξ∂η}+\frac{∂^2u}{∂η^2}\\\frac{∂^2u}{∂x^2}=\frac{∂^2u}{∂ξ^2}+2\frac{∂^2u}{∂ξ∂η}+\frac{∂^2u}{∂η^2}\end{cases}$
    Substitute into $\frac{∂^2u}{∂t^2}=\frac{∂^2u}{∂x^2}$ we obtain $\frac{∂^2u}{∂ξ∂η}=0$.
    Integrate wrt $η$ then integrate wrt $ξ$, $u=F(ξ)+G(η)=F(x-t)+G(x+t)$
    From initial conditions $u(x,0)=f(x),\frac{∂u}{∂t}(x,0)=g(x)$ we have $\cases{F(x)+G(x)=f(x)\ldots\ldots①\\-F'(x)+G'(x)=g(x)}$, the latter integrates to give $-F(x)+G(x)=∫_0^xg(s)\mathrm ds+a\ldots\ldots②$, where $a$ is constant.
    Subtracting and adding ① and ②, $F(x)=\frac12\left(f(x)-∫_0^xg(s)\mathrm ds-a\right),G(x)=\frac12\left(f(x)+∫_0^xg(s)\mathrm ds+a\right)$.
    Thus $u(x,t)=\frac12\left(f(x-t)-∫_0^{x-t}g(s)\mathrm ds-a\right)+\frac12\left(f(x+t)+∫_0^{x+t}g(s)\mathrm ds+a\right)=\frac12\left(f(x-t)+f(x+t)\right)+\frac12∫_{x-t}^{x+t}g(s)\mathrm ds$
    (b) $g(x)=0$ for all $x⇒u(x,t)=\frac12\left(f(x-t)+f(x+t)\right)$\begin{aligned}u(x,π)&=\frac12\left[f(x-π)+f(x+π)\right]\\&=\frac12\left(\cases{-\sin x&$x∈[-π,0]∪[2π,3π]$\\0&otherwise}+\cases{-\sin x&$x∈[-3π,-2π]∪[0,π]$\\0&otherwise}\right)\\&=\cases{-\frac{\sin x}2&$x∈[-3π,-2π]∪[-π,π]∪[2π,3π]$\\0&otherwise}\end{aligned}
    import graph;
    path sinpath=graph(new real(real x){return sin(x)/2;},0,pi);
    path negsinpath=scale(1,-1)*sinpath;
    draw(negsinpath^^shift(2pi,0)*negsinpath^^shift(-pi,0)*sinpath^^shift(-3pi,0)*sinpath);
    unitsize(0.5cm,1cm);
    xaxis(Arrow(),xmax=3.5pi,xmin=-3.5pi);
    yaxis(Arrow(),ymax=2,ymin=-2);
    label("$u(x,\pi)$",(0,2),align=E);
    label("$x$",(3.5pi,0),align=E);
    label("$\pi$",(pi,0),align=N);
    label("$3\pi$",(3pi,0),align=N);
    label("$2\pi$",(2pi,0),align=N);
    label("$-2\pi$",(-2pi,0),align=S);
    label("$-3\pi$",(-3pi,0),align=S);
    label("$-\pi$",(-pi,0),align=S);
    dot(Label("$\frac12$",align=E),(0,0.5));
    dot(Label("$-\frac12$",align=W),(0,-0.5));
    \begin{aligned}u\left(x,\frac{3π}2\right)&=\frac12\left[f\left(x-\frac{3π}2\right)+f\left(x+\frac{3π}2\right)\right]\\&=\frac12\left(\cases{-\cos x&$x∈\left[-\fracπ2,\fracπ2\right]∪\left[\frac{5π}2,\frac{7π}2\right]$\\0&otherwise}+\cases{\cos x&$x∈\left[-\frac{7π}2,-\frac{5π}2\right]∪\left[-\fracπ2,\fracπ2\right]$\\0&otherwise}\right)\\&=\cases{\frac{\cos x}2&$x∈\left[-\frac{7π}2,-\frac{5π}2\right]$\\-\frac{\cos x}2&$x∈\left[\frac{5π}2,\frac{7π}2\right]$\\0&otherwise}\end{aligned}
    import graph;
    path sinpath=graph(new real(real x){return sin(x)/2;},0,pi);
    draw(shift(2.5pi,0)*scale(1,-1)*sinpath^^shift(-3.5pi,0)*sinpath);
    unitsize(0.5cm,1cm);
    xaxis(Arrow(),xmax=4pi,xmin=-4pi);
    yaxis(Arrow(),ymax=2,ymin=-2);
    label("$u\left(x,\frac{3\pi}2\right)$",(0,2),align=E);
    label("$x$",(4pi,0),align=E);
    label("$\frac{5\pi}2$",(2.5pi,0),align=N);
    label("$\frac{7\pi}2$",(3.5pi,0),align=N);
    label("$-\frac{5\pi}2$",(-2.5pi,0),align=S);
    label("$-\frac{7\pi}2$",(-3.5pi,0),align=S);
    dot(Label("$\frac12$",align=W),(0,0.5));
    dot(Label("$-\frac12$",align=W),(0,-0.5));
    $$u(0,t)=\frac12\left(f(-t)+f(t)\right)=0$$\begin{aligned}u\left(\fracπ2,t\right)&=\frac12\left[f\left(\fracπ2-t\right)+f\left(\fracπ2+t\right)\right]\\
    &=\frac12\left[\cases{\cos t&$t∈\left[\frac{3π}2,\frac{5π}2\right]$\\0&otherwise}+\cases{\cos t&$t∈\left[\fracπ2,\frac{3π}2\right]$\\0&otherwise}\right]\\&=\cases{\frac{\cos t}2&$t∈\left[\fracπ2,\frac{5π}2\right]$\\0&otherwise}\end{aligned}
    import graph;
    draw(graph(new real(real x){return cos(x)/2;},0.5pi,2.5pi));
    unitsize(0.5cm,1cm);
    xaxis(Arrow(),xmax=3pi,xmin=0);
    yaxis(Arrow(),ymax=2,ymin=-2);
    label("$\frac{5\pi}2$",(2.5pi,0),align=N);
    label("$\frac{3\pi}2$",(1.5pi,0),align=N);
    label("$\frac{\pi}2$",(0.5pi,0),align=N);
    label("$u\left(\frac{\pi}2,t\right)$",(0,2),align=E);
    label("$t$",(3pi,0),align=E);
    dot(Label("$\frac12$",align=W),(0,0.5));
    dot(Label("$-\frac12$",align=W),(0,-0.5));

    $u(x, t)$ is also a solution for $x∈[0,∞),t>0$ with $u(x,0)= \cases{\sin x, &$x ∈[π, 2 π]$\\ 0, & otherwise},\frac{∂u}{∂t}(0,t)=0$. [cf. Perfectly reflecting boundary conditions]
    Note that $u(0,0)=0,\frac{∂u}{∂t}(0,t)=0$, so $u(0,t)=0$ for all $t>0$.
  6. (a) [6 marks] Derive the heat equation$$\frac{∂T}{∂t}=\kappa \frac{∂^2 T}{∂ x^2}$$for the temperature $T(x, t)$ in a conducting rod whose lateral surface is insulated, where the thermal conductivity $k$, specific heat $c$, and density $\rho$ are all positive constants and $\kappa=k /(\rho c)$.
    (b) [14 marks] Now suppose that the rod is of length $L$ and is insulated at $x=L$, and that the temperature at $x=0$ is maintained so that $T(0, t)=T_{0}$, where $T_{0}>0$ is a constant. Use separation of variables to show that there are solutions of the form$$T(x, t)=T_{0}+\sum_{n=1}^{∞} b_{n} \sin \left(\left(\frac{2 n-1}{2}\right) \frac{π x}{L}\right) \exp \left(-\kappa\left(\frac{2 n-1}{2}\right)^{2} \frac{π^2}{L^2} t\right)$$Find $T$ when the initial temperature is $T(x, 0)=(1+x / L) T_0, 0 \leqslant x \leqslant L$.
    Does the temperature ever drop below $T_0$ at $x=L$ ?
    Solution.
    (a) By 2(b) the thermal energy in $[a,a+h]$ is $∫_a^{a+h}ρcT(x,t)\mathrm dx$.
    The heat flux $q(x,t)$ is the rate at which thermal energy is transported through a cross-section of the rod at time $t$ per unit area per unit time.
    therefore the net rate at which heat enters section is $Aq(a,t)-Aq(a+h,t)$.
    unitsize(1cm);
    draw(ellipse((-2,0),0.5,1)^^ellipse((2,0),0.5,1)^^(-2,1)--(2,1)^^(-2,-1)--(2,-1));
    draw((-3,0)--(-2,0),Arrow);draw((2,0)--(3,0),Arrow);
    label("$a$",(-2,-1.3));label("$a+h$",(2,-1.3));

    By conservation of energy, assuming lateral surface is insulated,$$\frac{\rm d}{{\rm d}t}A∫_a^{a+h}ρcT(x,t)\mathrm dx=Aq(a,t)-Aq(a+h,t)$$Assuming $T_t$ is continuous, Leibniz's Integral Rule with $a,a+h$ constant gives$$\frac{ρc}h∫_a^{a+h}T_t(x,t)\mathrm dx+\frac{q(a+h,t)-q(a,t)}h=0$$Taking the limit $h→0$ and applying Fundamental Theorem of Calculus,$$ρc\frac{∂T}{∂t}+\frac{∂q}{∂x}=0$$By Fourier's Law, $q=-k\frac{∂T}{∂x}$ and $κ=\frac k{ρc}$,$${∂T\over∂t}=κ{∂^2T\over∂x^2}$$(b) Let $T-T_0=f(x)g(t)$, substitute into $\frac{∂T}{∂t}=κ\frac{∂^2T}{∂x^2}$, we get $f(x)g'(t)=κf''(x)g(t)⇒κ\frac{f''(x)}{f(x)}=\frac{g'(t)}{g(t)}=λ$ independent of $x,t$.
    $T(0,t)=0⇒f(0)g(t)=0⇒f(0)=0$.
    The rod is insulated at $x=L$, so $q=-k\frac{∂T}{∂x}$ vanishes there, we get ${∂T\over∂x}(L,t)=0⇒f'(L)g(t)=0⇒f'(L)=0$.
    Case 1. $λ>0$. Let $\fracλ{κ}=ω^2(ω>0)$. Then $f''=ω^2f⇒f=C_1\exp(ωx)+C_2\exp(-ωx)⇒f'=ω\left(C_1\exp(ωx)-C_2\exp(-ωx)\right)$.
    $∴f(0)=f(L)=0⇒C_1=C_2=0$.
    Case 2. $λ=0$. Then $f''=0⇒f=C_1x+C_2$. $f(0)=f(L)=0⇒C_1=C_2=0$.
    Case 3. $λ<0$. Let $\fracλ{κ}=-ω^2(ω>0)$. Then $f''=-ω^2f⇒f=C_1\sin(ωx)+C_2\cos(ωx)$.
    $f(0)=0⇒C_2=0$, $f'=ωC_1\cos(ωx)$.
    $f'(L)=0⇒ωL=\frac{2n-1}2π$ for some $n∈\Bbb Z$.
    $∴f=C_1\sin\left(\frac{(2n-1)π}{2L}x\right),g=C\exp\left(-κ\left(\frac{2n-1}2\right)^2\frac{π^2}{L^2}t\right)$
    By principle of superposition, $T(x, t)=T_{0}+\sum_{n=1}^{∞} b_n \sin \left(\left(\frac{2 n-1}{2}\right) \frac{π x}{L}\right) \exp \left(-\kappa\left(\frac{2 n-1}{2}\right)^{2} \frac{π^2}{L^2} t\right)$
    Substitute $t=0$ into series solution we obtain $T(x,0)=T_0+∑_{n=1}^∞b_n\sin\left(\left(\frac{2n-1}2\right)\frac{πx}L\right)$
    By Fourier series, the coefficients are\begin{aligned}b_n&=\frac1L∫_{-L}^L\left(T(x,0)-T_0\right)\sin\left(\frac{2n-1}2\frac{πx}L\right)\mathrm dx
    \\&=\frac1L∫_{-L}^LT_0\frac xL\sin\left(\frac{2n-1}2\frac{πx}L\right)\mathrm dx
    \\&=\frac{T_0}{L^2}∫_{-L}^Lx\sin\left(\frac{2n-1}2\frac{πx}L\right)\mathrm dx
    \\&=-\frac{T_0}{L^2}\frac{2L}{(2n-1)π}\left[\left.x\cos\left(\frac{2n-1}2\frac{πx}L\right)\right|_{-L}^L-∫_{-L}^L\cos\left(\frac{2n-1}2\frac{πx}L\right)\mathrm dx\right]
    \\&=-\frac{2T_0}{(2n-1)πL}\left[-∫_{-L}^L\cos\left(\frac{2n-1}2\frac{πx}L\right)\mathrm dx\right]
    \\&=-\frac{2T_0}{(2n-1)πL}\left[-\frac{2L}{(2n-1)π}\sin\left(\frac{2n-1}2\frac{πx}L\right)\right]_{-L}^L
    \\&=\frac{8(-1)^{n+1}T_0}{(2n-1)^2π^2}
    \end{aligned}
    $∴T=T_0+∑_{n=1}^∞\frac{8(-1)^{n+1}T_0}{(2n-1)^2π^2}\sin\left(\left(2n-1\over2\right)\frac{πx}{L}\right)\exp\left(-κ\left(2n-1\over2\right)^2\frac{π^2}{L^2}t\right)$
    $∴T(L,t)-T_0=∑_{n=1}^∞\frac{8T_0}{(2n-1)^2π^2}\exp\left(-κ\left(2n-1\over2\right)^2\frac{π^2}{L^2}t\right)$ is always positive (tends to 0 as $t→∞$).