Level 3 — ProductionPartial Differential Equations

Partial Differential Equations

45 minutes60 marksprintable — key stays hidden on paper

Level 3 — Production (from-scratch derivations, code-from-memory, explain-out-loud) Time limit: 45 minutes Total marks: 60


Instructions: Show all working. Derivations must proceed from stated first principles. Where code is requested, write it from memory; minor syntax slips are tolerated if the algorithm is correct.


Question 1 — Classification and canonical setup (8 marks)

For the PDE uxx+4uxy+uyy+3ux=0,u_{xx} + 4u_{xy} + u_{yy} + 3u_x = 0,

(a) State the discriminant test for a second-order linear PDE Auxx+Buxy+Cuyy+=0Au_{xx}+Bu_{xy}+Cu_{yy}+\dots=0 and classify this equation. (3 marks)

(b) For the equation x2uxxy2uyy=0x^2 u_{xx} - y^2 u_{yy} = 0 (with x,y>0x,y>0), determine the region(s) where it is hyperbolic, parabolic, or elliptic, and explain what the classification physically implies about how information propagates. (5 marks)


Question 2 — Full Fourier series from scratch (12 marks)

Let f(x)=xf(x) = x on (π,π)(-\pi, \pi), extended 2π2\pi-periodically.

(a) Derive the coefficient formulas a0,an,bna_0, a_n, b_n for a full Fourier series on (π,π)(-\pi,\pi), showing explicitly the orthogonality integrals you use. (4 marks)

(b) Compute the Fourier series of f(x)=xf(x)=x. (5 marks)

(c) State the Dirichlet conditions and give the value the series converges to at x=πx = \pi. (3 marks)


Question 3 — Heat equation by separation of variables (12 marks)

Consider ut=α2uxxu_t = \alpha^2 u_{xx} on 0<x<L0<x<L with u(0,t)=u(L,t)=0u(0,t)=u(L,t)=0 and u(x,0)=f(x)u(x,0)=f(x).

(a) Carry out separation of variables from scratch: set u=X(x)T(t)u=X(x)T(t), obtain the two ODEs, and explain why the separation constant must be negative. (6 marks)

(b) Solve the eigenvalue problem, write the general series solution, and give the formula for the coefficients. (4 marks)

(c) For L=πL=\pi, α2=1\alpha^2=1, f(x)=sin(3x)f(x)=\sin(3x), write the exact solution u(x,t)u(x,t). (2 marks)


Question 4 — D'Alembert's solution (10 marks)

For the wave equation utt=c2uxxu_{tt}=c^2 u_{xx} on <x<-\infty<x<\infty with u(x,0)=ϕ(x)u(x,0)=\phi(x), ut(x,0)=ψ(x)u_t(x,0)=\psi(x):

(a) Introduce the characteristic coordinates ξ=xct\xi=x-ct, η=x+ct\eta=x+ct and derive D'Alembert's formula from scratch. (6 marks)

(b) Solve for ϕ(x)=ex2\phi(x)=e^{-x^2}, ψ(x)=0\psi(x)=0, and describe physically what the solution represents. (4 marks)


Question 5 — Fourier transform & convolution (10 marks)

(a) Using the definition f^(k)=f(x)eikxdx\hat f(k)=\int_{-\infty}^{\infty} f(x)e^{-ikx}\,dx, prove the differentiation property f^(k)=ikf^(k)\widehat{f'}(k)=ik\,\hat f(k) (state the decay assumption you need). (4 marks)

(b) State the convolution theorem and explain in words why the solution of the infinite-domain heat equation ut=α2uxxu_t=\alpha^2 u_{xx}, u(x,0)=f(x)u(x,0)=f(x) can be written as a convolution of ff with a Gaussian kernel. (6 marks)


Question 6 — Finite differences, code from memory (8 marks)

(a) Derive the explicit (FTCS) finite-difference scheme for ut=α2uxxu_t=\alpha^2 u_{xx} using forward difference in time and central difference in space, giving the update formula and the stability parameter rr. (4 marks)

(b) Write from memory a short Python/NumPy loop that advances one time step of this scheme for an interior grid with Dirichlet ends. State the CFL stability condition. (4 marks)


Answer keyMark scheme & solutions

Question 1 (8 marks)

(a) Discriminant Δ=B24AC\Delta = B^2 - 4AC. If Δ>0\Delta>0 hyperbolic, Δ=0\Delta=0 parabolic, Δ<0\Delta<0 elliptic. (1) Here A=1, B=4, C=1A=1,\ B=4,\ C=1: Δ=164=12>0\Delta = 16 - 4 = 12 > 0. (1)hyperbolic (lower-order 3ux3u_x term does not affect classification). (1)

(b) A=x2A=x^2, B=0B=0, C=y2C=-y^2. Δ=04(x2)(y2)=4x2y2\Delta = 0 - 4(x^2)(-y^2)=4x^2y^2. (2) For x,y>0x,y>0, Δ=4x2y2>0\Delta=4x^2y^2>0 everywhere ⇒ hyperbolic throughout the open first quadrant. (1) (Parabolic only on axes where x=0x=0 or y=0y=0.) (1) Physically: hyperbolic equations have real characteristics, so signals/information propagate along them at finite speed (wave-like); initial disturbances travel without instant smoothing. (1)


Question 2 (12 marks)

(a) Assume f=a02+(ancosnx+bnsinnx)f=\frac{a_0}{2}+\sum(a_n\cos nx+b_n\sin nx). Use orthogonality on (π,π)(-\pi,\pi): ππcosmxcosnxdx=πδmn,ππsinmxsinnxdx=πδmn,ππcosmxsinnxdx=0.\int_{-\pi}^{\pi}\cos mx\cos nx\,dx=\pi\delta_{mn},\quad \int_{-\pi}^{\pi}\sin mx\sin nx\,dx=\pi\delta_{mn},\quad \int_{-\pi}^{\pi}\cos mx\sin nx\,dx=0. (2) Multiply by the relevant basis function and integrate: a0=1πππfdx,an=1πππfcosnxdx,bn=1πππfsinnxdx.a_0=\frac1\pi\int_{-\pi}^{\pi}f\,dx,\quad a_n=\frac1\pi\int_{-\pi}^{\pi}f\cos nx\,dx,\quad b_n=\frac1\pi\int_{-\pi}^{\pi}f\sin nx\,dx. (2)

(b) f=xf=x is odd ⇒ a0=0a_0=0, an=0a_n=0. (1) bn=1πππxsinnxdx=2π0πxsinnxdx.b_n=\frac1\pi\int_{-\pi}^{\pi}x\sin nx\,dx=\frac2\pi\int_0^{\pi}x\sin nx\,dx. (1) Integration by parts: 0πxsinnxdx=[xcosnxn]0π+1n0πcosnxdx=πcosnπn=π(1)nn.\int_0^\pi x\sin nx\,dx=\left[-\frac{x\cos nx}{n}\right]_0^\pi+\frac1n\int_0^\pi\cos nx\,dx=-\frac{\pi\cos n\pi}{n}=-\frac{\pi(-1)^n}{n}. (2) So bn=2π(π(1)nn)=2(1)n+1nb_n=\frac2\pi\cdot\left(-\frac{\pi(-1)^n}{n}\right)=\frac{2(-1)^{n+1}}{n}. (1) x=n=12(1)n+1nsinnx\boxed{\,x=\sum_{n=1}^{\infty}\frac{2(-1)^{n+1}}{n}\sin nx\,}

(c) Dirichlet conditions: ff periodic, with a finite number of maxima/minima and finite number of finite discontinuities per period, and absolutely integrable over a period. (2) At x=πx=\pi (a jump discontinuity of the periodic extension), the series converges to the midpoint f(π)+f(π+)2=π+(π)2=0\frac{f(\pi^-)+f(-\pi^+)}{2}=\frac{\pi+(-\pi)}{2}=0. (1)


Question 3 (12 marks)

(a) Let u=X(x)T(t)u=X(x)T(t). Then XT=α2XTXT'=\alpha^2 X''T, divide by α2XT\alpha^2 XT: Tα2T=XX=λ (const).\frac{T'}{\alpha^2 T}=\frac{X''}{X}=-\lambda \text{ (const)}. (2) Gives X+λX=0X''+\lambda X=0 and T+α2λT=0T'+\alpha^2\lambda T=0. (2) If λ0\lambda\le 0 the spatial solutions (exponential/linear) cannot satisfy X(0)=X(L)=0X(0)=X(L)=0 nontrivially; only λ>0\lambda>0 (written λ<0-\lambda<0 as the constant) yields sinusoidal solutions matching the BCs and a decaying TT. (2)

(b) X(0)=X(L)=0λn=(nπL)2X(0)=X(L)=0\Rightarrow \lambda_n=\left(\frac{n\pi}{L}\right)^2, Xn=sinnπxLX_n=\sin\frac{n\pi x}{L}. (1) Tn=eα2(nπ/L)2tT_n=e^{-\alpha^2(n\pi/L)^2 t}. (1) u(x,t)=n=1bnsinnπxLeα2(nπ/L)2t,bn=2L0Lf(x)sinnπxLdx.u(x,t)=\sum_{n=1}^\infty b_n\sin\frac{n\pi x}{L}e^{-\alpha^2(n\pi/L)^2 t},\quad b_n=\frac2L\int_0^L f(x)\sin\frac{n\pi x}{L}dx. (2)

(c) f=sin3xf=\sin 3x matches n=3n=3, L=πL=\pi, α2=1\alpha^2=1, so b3=1b_3=1, others 00: u(x,t)=e9tsin3x.u(x,t)=e^{-9t}\sin 3x. (2)


Question 4 (10 marks)

(a) With ξ=xct\xi=x-ct, η=x+ct\eta=x+ct: chain rule gives utt=c2(uξξ2uξη+uηη)u_{tt}=c^2(u_{\xi\xi}-2u_{\xi\eta}+u_{\eta\eta}) and uxx=uξξ+2uξη+uηηu_{xx}=u_{\xi\xi}+2u_{\xi\eta}+u_{\eta\eta}. (2) Substituting into utt=c2uxxu_{tt}=c^2u_{xx}4c2uξη=0-4c^2 u_{\xi\eta}=0uξη=0u_{\xi\eta}=0. (1) Integrate: u=F(ξ)+G(η)=F(xct)+G(x+ct)u=F(\xi)+G(\eta)=F(x-ct)+G(x+ct). (1) Apply ICs: F(x)+G(x)=ϕ(x)F(x)+G(x)=\phi(x), cF+cG=ψ(x)-cF'+cG'=\psi(x). Integrating the second: F+G=1c0xψds+K-F+G=\frac1c\int_0^x\psi\,ds+K. Solve: u(x,t)=12[ϕ(xct)+ϕ(x+ct)]+12cxctx+ctψ(s)ds.u(x,t)=\frac12[\phi(x-ct)+\phi(x+ct)]+\frac1{2c}\int_{x-ct}^{x+ct}\psi(s)\,ds. (2)

(b) ψ=0\psi=0: u(x,t)=12[e(xct)2+e(x+ct)2].u(x,t)=\frac12[e^{-(x-ct)^2}+e^{-(x+ct)^2}]. (2) Physically: the initial Gaussian bump splits into two half-amplitude copies travelling right and left at speed cc without change of shape. (2)


Question 5 (10 marks)

(a) f^(k)=f(x)eikxdx\widehat{f'}(k)=\int_{-\infty}^\infty f'(x)e^{-ikx}dx. Integrate by parts: =[f(x)eikx]+ikf(x)eikxdx.=[f(x)e^{-ikx}]_{-\infty}^{\infty}+ik\int_{-\infty}^\infty f(x)e^{-ikx}dx. (2) Assuming f(x)0f(x)\to 0 as x|x|\to\infty (so the boundary term vanishes): f^(k)=ikf^(k)\widehat{f'}(k)=ik\hat f(k). (2)

(b) Convolution theorem: fg^=f^g^\widehat{f*g}=\hat f\cdot\hat g (and inversely, product of transforms ↔ convolution). (2) Transforming the heat equation in xx: u^t=α2k2u^\hat u_t=-\alpha^2 k^2\hat uu^(k,t)=f^(k)eα2k2t\hat u(k,t)=\hat f(k)e^{-\alpha^2 k^2 t}. (2) This is a product of transforms, so by the convolution theorem u=fGu=f * G where GG is the inverse transform of eα2k2te^{-\alpha^2 k^2 t} — a Gaussian heat kernel G(x,t)=14πα2tex2/(4α2t)G(x,t)=\frac{1}{\sqrt{4\pi\alpha^2 t}}e^{-x^2/(4\alpha^2 t)}. Hence the temperature is the initial data smoothed (convolved) by a spreading Gaussian. (2)


Question 6 (8 marks)

(a) Forward time: utuin+1uinΔtu_t\approx\frac{u_i^{n+1}-u_i^n}{\Delta t}. Central space: uxxui+1n2uin+ui1nΔx2u_{xx}\approx\frac{u_{i+1}^n-2u_i^n+u_{i-1}^n}{\Delta x^2}. (2) Equate: uin+1=uin+r(ui+1n2uin+ui1n)u_i^{n+1}=u_i^n+r(u_{i+1}^n-2u_i^n+u_{i-1}^n), with r=α2ΔtΔx2r=\frac{\alpha^2\Delta t}{\Delta x^2}. (2)

(b) From memory:

u_new = u.copy()
u_new[1:-1] = u[1:-1] + r*(u[2:] - 2*u[1:-1] + u[:-2])
u_new[0] = uL; u_new[-1] = uR   # Dirichlet ends
u = u_new

(3) Stability (CFL): r=α2ΔtΔx212r=\dfrac{\alpha^2\Delta t}{\Delta x^2}\le \dfrac12. (1)


[
  {"claim":"b_n for f(x)=x on (-pi,pi) equals 2(-1)^(n+1)/n",
   "code":"n=symbols('n',positive=True,integer=True); x=symbols('x'); b=Rational(1,pi)*integrate(x*sin(n*x),(x,-pi,pi)); b=simplify(b); expected=2*(-1)**(n+1)/n; result=simplify(b-expected)==0"},
  {"claim":"Fourier series at x=pi converges to 0 (midpoint of jump)",
   "code":"val=(pi+(-pi))/2; result=(val==0)"},
  {"claim":"Heat solution with f=sin(3x),L=pi,alpha=1 is exp(-9t)sin(3x): satisfies u_t=u_xx",
   "code":"x,t=symbols('x t'); u=exp(-9*t)*sin(3*x); result=simplify(diff(u,t)-diff(u,x,2))==0"},
  {"claim":"D'Alembert (psi=0,phi=exp(-x^2)) solves wave eqn u_tt=c^2 u_xx",
   "code":"x,t,c=symbols('x t c'); u=(exp(-(x-c*t)**2)+exp(-(x+c*t)**2))/2; result=simplify(diff(u,t,2)-c**2*diff(u,x,2))==0"}
]