Linear PDEs

Introduction

The key defining property of a PDE is that there is more than one independent variable (x, y, z, etc) and a dependent variable that is an unknown function of these variables. As we’re focusing on linear PDEs linearity is an important concept to keep in mind. Let ℒ be an operator and u and v be functions, ℒ is linear if and only if ℒ(u+v) = ℒu+ℒv and ℒ(cu) = cℒu (where c is a constant). 
An important property obtained from linearity is the superposition principle: if (Subscript[u, 1]), ..., (Subscript[u, n])  are solutions of a PDE then (∑_(j=1)^n)(Subscript[c, j])(Subscript[u, j])(x) is also a solution.

Examples

Find all u(x,y) satisfying the equation (Subscript[u, xx ])= 0. Integrating once we obtain (Subscript[u, x])(x,y) = f(y). Integrating again we obtain our answer: u(x,y) = f(y)x + g(y)

Solve the PDE (Subscript[u, xx]) + u = 0. If we were solving an ODE instead we’d obtain m = ± i as the solution to the characteristic equation and hence the general solution would be u(x) = a*cos(x)+b*sin(x). However, we have an extra variable y so the solution is u(x) = f(y)cos(x)+g(y)sin(x)

First order linear PDEs

The constant coefficient equation

The constant coefficient equation is (Subscript[au, x])+(Subscript[bu, y])=0 where a and b are constants not both zero. We proceed with a change of variables: x' = ax+by, y'=bx-ay. Now write the equation in terms of the new variables using the chain rule: 
(Subscript[u, x]) = ∂u/∂x' ∂x'/∂x + ∂u/∂y' ∂y'/∂x = (Subscript[au, x'])+ (Subscript[bu, y']) and (Subscript[u, y ])=((∂u)/(∂y)) ((∂y')/(∂y ))+ ((∂u)/(∂x')) ((∂x')/(∂y ))= (Subscript[bu, x])-(Subscript[au, y'])  hence (Subscript[au, x])+(Subscript[bu, y]) = a((Subscript[au, x'])+(Subscript[bu, y']))+b((Subscript[bu, x'])-(Subscript[au, y'])) = ((a^2)+(b^2))(Subscript[u, x']) so the equation we need to solve is of the form  (Subscript[u, x]) = c which means the solution is u = f(y') = f(bx-ay)

The variable coefficient equation

The equation (Subscript[u, x])+(Subscript[yu, y]) = 0 can be solved using the following method. Note that the PDE tells us that the directional derivative in the direction of the vector (1,y) is 0. The curves on the xy plane with (1,y) as tangent vectors have slopes y and equations (dy/dx) = y/1⇒∫dy/y = ∫dx ⇒ y = (Ce^x). These curves are called the characteristic curves of the PDE. As C is changed, the curves fill out the xy plane perfectly without intersecting.

Manipulate[Plot[{c1*(E^x), c2*E^x, c3*E^x},{x,-5,5}], {c1,-5,5, Appearance->"Labeled"},{c2,-5,5, Appearance->"Labeled"}, {c3,-5,5, Appearance->"Labeled"}]

On each of the curves u(x,y) is constant because d/dx u(x,(Ce^x)) = ∂u/∂x + (Ce^x)∂u/∂y = (Subscript[u, x])+(Subscript[yu, y])= 0. Thus u(x,(Ce^x)) = u(0, (Ce^x)) = u(0,C) is independent of x. Putting y = (Ce^x)and C = (e^(-x))y we have u(x,y) = u(0, (e^(-x))y). It follows that u(x,y) = f((e^(-x))y). Now if we wanted to find the solution that matches the initial condition u(0,y) = (y^3) we would set x to 0 on the general solution and obtain (y^3) = f((e^(-0))y) so that f(y) = (y^3), hence u(x,y) = ((((e^(-x))y))^3) = (e^(-3x))(y^3).

Examples

Solve the PDE (Subscript[u, x])+2(xy^2)(Subscript[u, y])= 0. The characteristic curves satisfy the ODE (dy/dx) = ((2(xy^2))/1) = 2(xy^2). To solve the ODE we separate variables (dy/(y^2)) = 2x dx ⇒ ((-1)/y)= (x^2)-C so y = (((C-(x^2)))^(-1)). These curves are the characteristics. Again u(x,y) is a constant on each such curve so u(x,y) - f(C). Solving  y = (((C-(x^2)))^(-1)) for C we obtain u(x,y) = f((x^2)+(1/y)).

The Heat Equation

The heat equation can be used as a model of heat transfer in a metal bar, or diffusion of a gas/liquid in another gas/liquid. Consider a one-dimensional metal bar lying along the x-axis. Let u(x,t) be the temperature of the bar at position x and time t. Then the one dimensional heat equation is (Subscript[u, t]) = (Subscript[Du, xx]), Dϵ ℝ.

Heat Equation in Finite Bar with Boundary Conditions

Suppose the metal bar has length L and is lying between x = 0 and x = L. There are 2 natural types of boundary conditions

Suppose the ends of the metal bar are kept at constant temperature. Take our zero temperature such that this constant is zero, ie impose u(0,t) = u(L, t) = 0 ∀ t. These are the Dirichlet boundary conditions

Suppose the ends are thermally isolated (there is no flow of heat in or out) => 𝒥(0,t) = 𝒥(L, t) = 0. Then Fourier’s Law => (Subscript[u, x])(0,t) = (Subscript[u, x])(L,t) = 0 ∀ t. These are the Neumann boundary conditions.

Dirichlet Boundary Conditions

Let’s solve the heat equation with Dirichlet boundary conditions. We need to find solutions of

(Subscript[u, t]) = (Subscript[u, xx]) 0 <x < L, t > 0 (setting D = 1)

u(0,t) = 0  t>0, u(L,t) = 0  t>0 (boundary conditions)

u(x,0) = ϕ(x) (initial condition, where ϕ(x) is a given function

Separation of Variables

Look for solutions of (1) of the form u(x,t) = X(x)T(t). Note u=0 is always a solution, so focus on nonzero solutions. Substitute u(x,t) = X(x)T(t) into (1) to obtain (∂/(∂t))(X(x)T(t)) = ((∂^2)/(∂(x^2)))(X(x)T(t)) for simplicity we will denote (∂/(∂t))with a dot and (∂/(∂x)) with a ‘ so the previous equation is X(x) (OverDot[T])(t) = X'' (x) T(t) =>(((OverDot[T])(t))/(T(t))) = ((X''(x))/(X(x))) ∀ x ∈(0,L), t > 0
 as the left hand side only depends on t and the right hand side only depends on x both sides have to equal a constant λ ie (OverDot[T])(t) = λT(t) and X''(x) = λX(x). We also have the boundary conditions X(0)T(t) = 0 ∀t >0, X(L)T(t) = 0 ∀ t > 0 => X(0) = 0, X(L) = ) ∀t>0. So we first solve X''(x)= λX(x) 0<x<L with X(0)X(L) = 0. We need to consider 3 separate cases

Case 1: λ = 0. X''(x) = 0 => X(x) = ax+b. X(0) = 0 => b = 0 so X(x) = ax. X(L) = 0 => aL = 0 => a = 0 (since L>0) so X(x) = 0

Case 2: λ > 0. X''(x) = λX(x), X(x) = (ae^((Sqrt[λ])x))+ (be^(-(Sqrt[λ])x)), X(0)= 0 => a+b = 0, b = -a. So X(x) = a((e^((Sqrt[λ])x))-(e^(-(Sqrt[λ])x))), X(L) = 0 => a((e^((Sqrt[λ])x))-(e^(-(Sqrt[λ])x))) = 0  => a = 0 => X(x) = 0

Case 3: λ<0. X''(x) = λX(x) has general solution X(x) = asin(Sqrt[-λ])x+bcos(Sqrt[-λ])x, X(0) = 0 => a*0+b*1 = 0 (ie b=0) so X(x) = asin(Sqrt[-λ])x, X(L) = 0 => asin(Sqrt[-λ])L = 0 => a = 0  or sin(Sqrt[-λ])L = 0. If a is zero then we get the 0 solution so sin(Sqrt[-λ])L = 0 => (Sqrt[-λ])L = nπ n ∈ ℝ => λ = (((n^2)(π^2))/(L^2))so we get a set of solutions (Subscript[X, n])(x) = (Subscript[a, n])sin((nπx)/L).

We now go back to solve for T(t): (Subscript[(OverDot[T]), n])(t) = (Subscript[λ, n])(Subscript[T, n])(t) =-(((n^2)(π^2))/(L^2))(Subscript[T, n])(t) => (Subscript[T, n])(t) = (Subscript[c, n])(e^(-(((n^2)(π^2))/(L^2))t)) so (Subscript[u, n])(x,t) = (Subscript[X, n])(x)(Subscript[T, n])(t) = (Subscript[B, n])(e^((((n^2)(π^2))/(L^2))t))sin ((nπx)/L). Since the PDE is linear the superposition principle holds so u(x,t) = (∑_(n=1)^∞)(Subscript[B, n])(e^((((n^2)(π^2))/(L^2))t))sin ((nπx)/L) is a solution. Note that it also satisfies the Dirichlet boundary conditions u(0,t) = (∑_(n=1)^∞)(Subscript[B, n])(e^(-(((n^2)(π^2))/(L^2))t))sin 0 = 0, u(L,t) =(∑_(n=1)^∞)(Subscript[B, n])(e^(-(((n^2)(π^2))/(L^2))t))sin(nπ) = 0 . Ignoring issues of convergence for the time being, we have found solutions of (Subscript[u, xx]) = (Subscript[u, t]) x ∈ (0,L), t >0, u(0,t) = u(L,t) = 0, t > 0 in the form (∑_(n=1)^∞)(Subscript[B, n])(e^(-(((n^2)(π^2))/(L^2))t))sin ((nπx)/L)(*)

Properties of General Solution

u(x,t) = (∑_(n=1)^∞)(Subscript[B, n])(e^(-(((((nπ)/L)))^2)t))sin ((nπx)/L). Since (e^(-(((((nπ)/L)))^2)t)) tends to zero as t tends to infinity then u(x,t) → 0 as t →∞. Heat flows out of the end of the bar so the temperature of the bar converges to the (fixed) value at the endpoints. 
The basis solution (Subscript[u, n])(x,t) = (e^(-(((((nπ)/L)))^2)t))sin ((nπx)/L)→0 exponentially as t→∞ with rate (((n^2)(π^2))/(L^2))which increases as n increases

Quiet[Manipulate[Plot[{E^(-((n*Pi)/L)^2*t)*Sin[(n*Pi*x)/L]},{x,0,15}], {n,1,20, 1, Appearance->"Labeled"}, {L,0.5,30, Appearance->"Labeled"}, {t,0.5,30, Appearance->"Labeled"}]]

Neumann Boundary Conditions

Suppose we had imposed Neumann boundary conditions instead ie (Subscript[u, x])(0,t) = 0 and (Subscript[u, x])(L,t) = 0 ∀ t > 0. Then using the same separation of variables technique it can be shown that u(x, t) = ((Subscript[A, 0])/2) + (∑_(n=1)^∞)(Subscript[A, n])(e^(-(((((nπ)/L)))^2)t))cos ((nπx)/L). These two solutions to the heat equation raise the following questions:

Do the solutions converge for suitable coefficients (Subscript[A, n]) and (Subscript[B, n])?

Can we pick (Subscript[A, n]) and (Subscript[B, n]) such that u(x,0) = ϕ(x) for arbitrary initial condition ϕ satisfying the boundary conditions used to derive the solution?

This leads us to the topic of fourier series

Fourier Series

First consider the representation ϕ:[0,L] →ℝ by ϕ(x) = (∑_(n=1)^∞)(Subscript[B, n])sin ((nπx)/L). Assuming such a representation exists, we can write a simple expression for the coordinates (Subscript[B, n]) by using the following results:

(∫_0^L)cos(((nπx)/L))cos(((mπx)/L))dx = (1/2)(Subscript[δ, nm]), m,n ≥1, (∫_0^L)cos(((mπx)/L))dx = 0

(∫_0^L)sin(((nπx)/L))sin(((mπx)/L))dx = (L/2)(Subscript[δ, nm])

(Subscript[A, m]) = (2/L)(∫_0^L)ϕ(x)cos ((mπx)/L)dx, m ≥0

(Subscript[B, m]) = (2/L)(∫_0^L)ϕ(x)sin ((mπx)/L)dx, m ≥0

The expansion ϕ(x) = ((Subscript[A, 0])/2)+(∑_(n=1)^∞)(Subscript[A, n])cos(((nπx)/L))with (Subscript[A, n])(2/L)(∫_0^L)ϕ(x)cos ((nπx)/L)dx is called the Fourier cosine series of ϕ:[0,L]→ℝ.

Worked Out Example

Solve the heat equation (Subscript[u, xx]) = (Subscript[u, t])on the interval [0,1] with Dirichlet BCs and initial condition u(x,0) = ϕ(x). Here we have L = 1. so u(x,t) = (∑_(n=1)^∞)(Subscript[B, n])(e^(-(((nπ))^2)t))sin nπx. Matching initial conditions we find (Subscript[B, n]) = 2(∫_0^1)x(1-x)nπx dx = 2[((-(((-1))^n))/(nπ))+((((-1))^n)/(nπ))-(2/((n^3)(π^3)))((((-1))^n)-1)] = (4/((n^3)(π^3)))(1-(((-1))^n)). Therefore the particular solution to our problem is u(x,t) = (∑_(n=1)^∞)(4/((n^3)(π^3)))(1-(((-1))^n))(e^(-(((nπ))^2)t))sin nπx

TermsInFourierSeries=50;
FramesOfAnimation=50;
l=1;
T=.2; 
ϕ[x_]:=x(1-x) 
B[n_]=2/l Integrate[ϕ[x]Sin[n π x/l],{x,0,l}]; 
u[x_,t_,N_]:=Sum[B[n]Exp[-n^2π^2/l^2 t]Sin[n π x/l],{n,1,N}] 
uPlots=Table[Plot[u[x,t,TermsInFourierSeries],{x,0,l},PlotRange->{-.1,.25},Filling->Axis],{t,0,T,T/FramesOfAnimation }];
ListAnimate[uPlots]

Full Fourier Series

Suppose f:[-l,l]→ℝ is a function, and define its 2l-periodic extension by (Subscript[f, per])(x) := f(x-2nl) for (2n-1)l≤x<(2n+1)l so (Subscript[f, per])(x+2l) = (Subscript[f, per])(x) ∀x ∈ℝ. Note that the functions cos(((nπx)/l)) and sin(((nπx)/l))are also 2l periodic so we can expand (Subscript[f, per])(x) ∼ ((Subscript[A, 0])/2) + (∑_(n=1)^∞)((Subscript[A, n])cos ((nπx)/l)+(Subscript[B, n])((sinnπx)/l)) for some coefficients (Subscript[A, n]), (Subscript[B, n]). Suppose such an expansion exists, then we can determine the coefficients using the following results:

(∫_(-l)^l)cos ((nπx)/l)cos ((mπx)/l)dx = (∫_(-l)^l)sin ((nπx)/l)sin ((mπx)/l)dx = (Subscript[lδ, nm]) for n,m ≥1

(∫_(-l)^l)cos ((nπx)/l)dx = (∫_(-l)^l)sin ((nπx)/l)dx = 0 for n≥1

(∫_(-l)^l)cos ((nπx)/l)sin ((mπx)/l)dx = 0 for n,m ≥1

The functions (1/(Sqrt[2l])), (1/(Sqrt[l]))cos ((nπx)/l), (1/(Sqrt[l]))sin ((nπx)/l), n =1,2,... are orthogonal on [-l,l] with respect to the inner product <u,v>:= (∫_(-l)^l)u(x)v(x)dx

(Subscript[A, m]) = (1/l)(∫_(-l)^l) f(x)cos ((mπx)/l)dx m =0,1,2,...

(Subscript[B, m])= (1/l)(∫_(-l)^l) f(x)sin ((mπx)/l)dx m =0,1,2,...

The expansion ((Subscript[A, 0])/2)+(∑_(n=1)^∞)((Subscript[A, n])cos ((nπx)/l)+(Subscript[B, n])((sinnπx)/l)) with coefficients as defined above (5,6) is called the full Fourier series of f:[-l,l]→ℝ (or of (Subscript[f, per]): ℝ→ℝ)

Convergence Properties of Fourier Series

Suppose (Subscript[f, n]): J→ℝ is a sequence of functions where J⊂ℝ is some interval. We define the Nth partial sum of the sequence ((Subscript[f, n])) to be the function (Subscript[S, N]): J →ℝ given by (Subscript[S, N])(x) :=(∑_(n=1)^N)(Subscript[f, n])(x) . We say that a series (∑_(n=1)^∞)(Subscript[f, n])converges pointwise on J to a function f: J →ℝ if for each fixed x ∈J, |f(x)-(Subscript[S, N])(x)|→0 as N→∞ or equivalently ∀ϵ>0, ∃(SubStar[N]) ∈ ℕ such that |f(x)-(Subscript[S, N])(x)|<ϵ ∀N ≥(SubStar[N]) ∀x ∈J.

Example

(Subscript[f, n])(x) = (x^(n-1))-(x^n) = (1-x)(x^(n-1)) on [0,1] => (Subscript[S, N])(x) = (∑_(n=1)^N)((x^(n-1))-(x^n)) = 1-(x^N). We have pointwise convergence on [0,1]. (Subscript[S, N])(x) = 1-(x^N) →f(x) := 1 if 0 ≤x<1 or 0 if x=1. However the convergence is not uniform on [0,1] since for example (Subscript[S, N])((2^((-1)/N))) = 1-((((2^((-1)/N))))^N) = (1/2) ∀ N => (sup_(x∈[0,1]))|f(x)-(Subscript[S, N])(x)|≥|f((2^((-1)/N))) -(Subscript[S, N])((2^((-1)/N)))| = (1/2)

A function f is called piecewise continuous on [a,b] if the one sided limits f((SuperMinus[x])) and f((SuperPlus[x])) exist at each x ∈[a,b] and f((SuperMinus[x])) = f((SuperPlus[x])) except at finitely many points, where it has jump discontinuities.

Theorem

Given f:[-l,l]→ℝ with 2l periodic extension (Subscript[f, per])

Suppose (Subscript[f, per]) and (Subscript[f', per]) are both piecewise continuous on ℝ. Then the full Fourier series of f converges pointwise to the function x ↦ (1/2)((Subscript[f, per])((SuperMinus[x]))+(Subscript[f, per])((SuperPlus[x]))) on ℝ

Suppose (Subscript[f, per]) is continuous and (Subscript[f', per]) is piecewise continuous on ℝ. Then the full Fourier series of f converges pointwise to (Subscript[f, per]) on ℝ

Suppose (Subscript[f, per]) and (Subscript[f', per]) are both continuous on ℝ. Then the full Fourier series of f converges uniformly to (Subscript[f, per]) on ℝ

Relationship Between Full Fourier Series and Fourier Sine/Cosine Series

So far we have considered three types of Fourier series:

The Fourier sine series of ϕ:[0,l]→ℝ  ϕ(x)∼(∑_(n=1)^∞)(Subscript[B, n])sin ((nπx)/l)for 0≤x≤l where  (Subscript[B, n])=(2/l)(∫_0^l) ϕ(x)sin ((nπx)/l)dx, n ≥1

The Fourier cosine series of ϕ:[0,l]→ℝ  ϕ(x)∼ ((Subscript[A, 0])/2)+(∑_(n=1)^∞)(Subscript[B, n])sin ((nπx)/l)for 0≤x≤l where  (Subscript[A, n])=(2/l)(∫_0^l) ϕ(x)cos ((nπx)/l)dx, n ≥0

The full Fourier series of f:[-l,l]→ℝ  f(x)∼  ((Subscript[A, 0])/2)+(∑_(n=1)^∞)((Subscript[A, n])cos ((nπx)/l)+(Subscript[B, n])((sinnπx)/l)) where  (Subscript[A, n])=(1/l)(∫_(-l)^l) ϕ(x)cos ((nπx)/l)dx n ≥0  and (Subscript[B, n])=(1/l)(∫_(-l)^l) ϕ(x)sin ((nπx)/l)dx, n ≥1

How are these series related? Main idea: extend ϕ from [0,l] to [-l,l] in such a way that the full Fourier series of the extended function contains only either sine or cosine terms.

For any function f:[-l,l]→ℝ, f is even if f(-x) = f(x) ∀x ∈[-l,l], f is odd if (-x) = -f(x) ∀x ∈[-l,l]. For ϕ:[0,l]→ℝ the even extension of ϕ is the function (Subscript[ϕ, even]):[-l,l]→ℝ defined as (Subscript[ϕ, even])(x):= ϕ(x) for 0 ≤x≤l and ϕ(-x) for -l≤x<0. Similarly (Subscript[ϕ, odd]):= ϕ(x) for 0 < x ≤ l, -ϕ(-x) for -l≤x<0 and 0 for x = 0.  To compute the full Fourier series of (Subscript[ϕ, even]) and (Subscript[ϕ, odd]) we will use one two more results:

For a piecewise continuous function ρ:[-l,l]→ℝ if ρ is even then (∫_(-l)^l)ρ(x)dx = 2 (∫_0^l)ρ(x)dx and if ρ is odd then (∫_(-l)^l)ρ(x)dx=0

Let f, g be functions on [-l,l]. Then if f and g are both even fg is even, if f and g are both odd fg is even and if f is even and g is odd fg is odd

Theorem

Let ϕ:[0,l]→ℝ

The full Fourier series of (Subscript[ϕ, even]) is ((Subscript[A, 0])/2)+(∑_(n=1)^∞)(Subscript[A, n])cos ((nπx)/l) with  (Subscript[A, n])=(2/l)(∫_0^l) ϕ(x)cos ((nπx)/l)dx which agrees with the Fourier cosine series of ϕ

The full Fourier series of (Subscript[ϕ, odd]) is (∑_(n=1)^∞)(Subscript[B, n])sin ((nπx)/l) with  (Subscript[B, n])=(2/l)(∫_0^l) ϕ(x)sin ((nπx)/l)dx which agrees with the Fourier sine series of ϕ

Convergence Properties of Fourier Sine and Cosine Series

Theorem

Let ϕ:[0,l]→ℝ and assume that both ϕ and ϕ’ are continuous on [0,l]

The Fourier sine and cosine series of ϕ both converge pointwise to ϕ on (0,l)

If ϕ(0) = ϕ(l) = 0 then the Fourier sine series of ϕ converges uniformly to ϕ on [0,l]

If ϕ'((SuperPlus[0])) = ϕ'((SuperMinus[l])) = 0 then the Fourier cosine series of ϕ converges uniformly to ϕ on [0,l]

The Wave Equation

The wave equation arises in many physical problems, for example, vibration of a stretched string or a stretched thin elastic membrane, propagation of electromagnetic fields, propagation of sound waves. Consider the 1-dimensional wave equation: (Subscript[u, tt]) = (c^2)(Subscript[u, xx]). Suppose the string is of length l, lying in between x = 0 and x = l. There are two types of natural boundary conditions at x= 0 (or x=l)

String is champed at x = 0  => u(0,t) = 0 ∀t. These are the Dirichlet boundary conditions

String is attached to a massless ring that is free to slide over a frictionless transverse rod. Transverse force on ring is T  ((∂u)/(∂x)). Must equal zero (otherwise massless ring would experience infinite acceleration) => (Subscript[u, x])(0,t) = 0 ∀t. These are the Neumann boundary conditions

With the heat equation (Subscript[u, t ])= (Subscript[u, xx]), we only need to specify the initial condition u(x,0) since the heat equation is first order in time. By contrast, since the wave equation is second order in time, we must specify initial conditions u(x,0) and (Subscript[u, t])(x,0)

Solution of the Wave Equation with Neumann Boundary Conditions

Find solutions u(x,t) of

(Subscript[u, tt]) = (c^2)(Subscript[u, xx]), 0 < x < l, t >0 (wave equation)

(Subscript[u, x])(0,t) = (Subscript[u, x])(l,t) = 0, t > 0 (Neumann boundary conditions)

u(x,0) = ϕ(x), (Subscript[u, t])(x,0) = ψ(x), 0<x<l (initial conditions)

Separation of Variables

Try solutions of the form u(x,t) = X(x)T(t). The boundary conditions become 0 = (Subscript[u, x])(0,t) = X'(0)T(t) and 0 = (Subscript[u, x])(1,t) = x'(l)T(t). So either T(t) = 0 (=> u(x,t) = 0) or X'(0) = 0 = X'(l). The wave equation (Subscript[u, tt]) = (c^2)(Subscript[u, xx]) becomes X(x)(Overscript[T, ..])(t) = (c^2)X''(x)T(t) => (((Overscript[T, ..])(t))/((c^2)T(t))) = ((X''(x))/(X(x))) 0<x<l, t>0 which is only possible if both sides equal some undetermined constant λ∈ℝ (((Overscript[T, ..])(t))/((c^2)T(t))) = ((λc)^2), ((X''(x))/(X(x))) = λ or  (Overscript[T, ..])(t) = ((λc)^2)T(t) t > 0, X''(x) = λX(x), X'(0) = 0 = X'(l), t > 0, 0 <x<l.

Case 1: λ = 0. X''(x) = 0 has the general solution X(x) = ax+b, X'(0) =  = 0, X'(L) = a = 0 => a = 0. So (Subscript[X, 0])(t) = (Subscript[b, 0]) is a solution corresponding to λ = (Subscript[λ, 0]) = 0. Then (Overscript[T, ..])(t)= 0 => (Subscript[T, 0])(t) = (Subscript[c, 0])t+(Subscript[d, 0]). Overall we obtain a solution (Subscript[u, 0])(x,t) = (Subscript[X, 0])(x)(Subscript[T, 0])(t) = (Subscript[b, 0])((Subscript[c, 0])t+(Subscript[d, 0])) = ((Subscript[c, 0])/2)t+ ((Subscript[D, 0])/2). This solution physically corresponds to string with uniform (in x) displacement, increasing over time.

Case 2: λ > 0. X''(x) = λX(x) has general solution X(x) = (ae^((Sqrt[λ])x))+ (be^(-(Sqrt[λ])x))=> X'(x) = a(Sqrt[λ])(e^((Sqrt[λ])x))-b(Sqrt[λ])(e^(-(Sqrt[λ])x)). Now apply boundary conditions: X'(0) = a(Sqrt[λ])-b(Sqrt[λ]) = (a-b)(Sqrt[λ]) = 0 => a = b. Then X'(l) = 0 = a(Sqrt[λ])((e^((Sqrt[λ])x))-(e^(-(Sqrt[λ])x))) = 0 => a = 0 so the only solution is X(x) = 0

Case 3: λ < 0.  X''(x) = λX(x)  has general solution X(x) = a sin(Sqrt[-λ])x+ b cos (Sqrt[-λ])x => X'(x) = a(Sqrt[-λ])cos(Sqrt[-λ])x-b(Sqrt[-λ])sin(Sqrt[-λ])x . Boundary conditions: X'(0) = 0 => a(Sqrt[-λ]) = 0 =>a = 0 so X'(x) = -b(Sqrt[-λ])sin(Sqrt[-λ])x, then X'(l) = 0 => -b(Sqrt[-λ])sin(Sqrt[-λ])l = 0 => either b=0 or sin(Sqrt[-λ])l = 0 => (Sqrt[-λ])l = nπ => λ = (Subscript[λ, n]) = -(((n^2)(π^2))/(l^2)). We get solutions (Subscript[X, n])(x) = (Subscript[b, n])cos (Sqrt[-λ])x = (Subscript[b, n])cos ((nπx)/l). Then (Overscript[T, ..])(t)=((λc)^2)T(t) becomes (Overscript[(Subscript[T, n]), ..])(t)=- (((n^2)(π^2)(c^2))/(l^2))(Subscript[T, n])(t) which has general solution (Subscript[T, n])(t) = (Subscript[c, n])sin((nπc)/l)t + (Subscript[d, n]) cos ((nπc)/l)t. Overall we obtain a solution (Subscript[u, n])(x,t) = (Subscript[X, n])(x)(Subscript[T, n])(t) = (Subscript[b, n])cos ((nπx)/l) [(Subscript[c, n])sin((nπc)/l)t + (Subscript[d, n]) cos ((nπc)/l)t] = [(Subscript[c, n])sin((nπc)/l)t + (Subscript[d, n]) cos ((nπc)/l)t]cos ((nπx)/l)   n = 1,2,3,..

Since the wave equation is linear, arbitrary linear combinations of solutions are also solutions so the general solution of the wave equation with Neumann boundary conditions is u(x,t) = ((Subscript[c, 0])/2)t+ ((Subscript[D, 0])/2)+(∑_(n=1)^∞) {(Subscript[c, n])sin((nπc)/l)t + (Subscript[d, n]) cos ((nπc)/l)t}cos ((nπx)/l)

Matching the Initial Conditions

We now need to match the initial conditions, ie find values of (Subscript[C, n]), (Subscript[D, n]) so that u(x,0) = ϕ(x) (1) and (Subscript[u, t])(x,0) = ψ(x) (2). From our general solution we see that (1) becomes ((Subscript[D, 0])/2)+(∑_(n=1)^∞)(Subscript[D, n])cos ((nπx)/l). Then we know from the discussion of Fourier cosine series that (Subscript[D, n]) = (2/l)(∫_0^l) ϕ(x)cos ((nπx)/l)dx. Our general solution also implies that (Subscript[u, t])(x,t) = ((Subscript[c, 0])/2)+ 0+(∑_(n=1)^∞) {(Subscript[c, n])((nπc)/l)cos((nπc)/l)t - (Subscript[D, n]) ((nπc)/l)sin ((nπc)/l)t}cos ((nπx)/l). So condition (2) becomes ψ(x) = ((Subscript[c, 0])/2)+(∑_(n=1)^∞)(Subscript[c, n])((nπc)/l)cos((nπc)/l). Then the discussion of Fourier cosine series implies (Subscript[C, 0]) = (2/l)(∫_0^l) ψ(x)dx, (Subscript[C, n]) = (2/(nπc))(∫_0^l) ψ(x)cos ((nπx)/l)dx n≥1.

Example

Take initial conditions u(x,0) = ϕ(x) = 0, (Subscript[u, t])(x,0) = ψ(x) =(( 2v)/l)x if 0 ≤x≤(l/2) and ((2v)/l)(l-x) if (l/2)<x<l where v is an arbitrary constant. We can check that (Subscript[c, 0]) = v, (Subscript[c, n ])= ((-lv)/c)4 (((1+(((-1))^n)))/((n^3)(π^3))), (Subscript[D, n])=0 ∀n≥1 so u(x,t) = (v/2)t-((4lv)/((cπ)^3))(∑_(n=1)^∞) (((1+(((-1))^n)))/(n^3))sin((nπc)/l)t cos ((nπx)/l)

TermsInFourierSeries=10; 
FramesOfAnimation=50;
l=1; (* length of string *)
v=2; (* initial speed *)
c=1; (* wave speed *)
T=1; (* final time *)
ϕ[x_]:=0 (* initial shape of string *)
ψ[x_]:=Piecewise[{{2v x/l ,0≤x<l/2},{2v/l(l-x),l/2≤x<l}},0] (* initial velocity of string *)
Dcoeff[0]=2/l Integrate[ϕ[x],{x,0,l}];
Dcoeff[n_]=2/l Integrate[ϕ[x]Cos[n π x/l],{x,0,l}];
Ccoeff[0]=2/l Integrate[ψ[x],{x,0,l}];
Ccoeff[n_]=2/(n π c)Integrate[ψ[x]Cos[n π x/l],{x,0,l}];
uCase1[x_,t_,N_]:=Ccoeff[0]/2t+Dcoeff[0]/2+Sum[(Ccoeff[n]Sin[ n π c /l t]+Dcoeff[n]Cos[n π c/l t]) Cos[n π x/l],{n,1,N}] 
Case1Plots=Table[Plot[uCase1[x,t,TermsInFourierSeries],{x,0,l},PlotRange->{-.1,1}],{t,0,T,T/FramesOfAnimation}];
ListAnimate[Case1Plots]

Maximum Principle

Maximum Principle for the Heat Equation

Suppose u(x,t) satisfies the heat equation (Subscript[u, t]) = (Subscript[u, xx]) in a region 0 ≤x≤l and 0≤t≤T. Let D = (0,l)×(0,T) and (Overscript[D, -]) = closure of D = [0,l]×[0,T]. Let Γ be the union of the initial surface [0,1]×{0} and the two boundaries {0}×[0,T] and {1}×[0,T]. u is continuous and so achieves its maximum value on (Overscript[D, -])  ie there exists ((SuperStar[x]), (SuperStar[t])) ∈ (Overscript[D, -])  such that u((SuperStar[x]), (SuperStar[t])) = (sup_((x,t) ∈(Overscript[D, -]) ))u(x,t) = (max_((x,t) ∈(Overscript[D, -]) ))u(x,t) . Then the maximum principle has a weak and a strong form, as follows

Weak Maximum Principle

The maximum value of u(x,t) is achieved on Γ

Strong Maximum Principle

If u(x,t) achieves its maximum on D = (0,l)×(0,T) or on top = (0,l)×{T} then u must be constant

By applying the weak/strong maximum principle to -u(x,t) we also get the corresponding result for minimum values of u(x,t). The physical interpretation of these results is as follows: the hottest/coldest spot in a metal rod occurs either initially (at time 0) or at an endpoint of the bar

Uniqueness of Solution of Heat Equation with Dirichlet Boundary Conditions

We consider here the inhomogeneous heat equation with general Dirichlet boundary conditions

Theorem

There is at most one solution to (Subscript[u, t])-(Subscript[u, xx]) = f(x,t), 0 ≤x≤l, t>0 with u(0,t) = (Subscript[h, 0])(t) t >0, u(l,t) = (Subscript[h, 1])(t) t >0 (Dirichlet boundary conditions) and u(x,0) = ϕ(x), 0≤x≤l.

Proof

Assume that (Subscript[u, 1]) and (Subscript[u, 2]) are two solutions and let w = (Subscript[u, 1])-(Subscript[u, 2])be their difference. Then we have (Subscript[w, t]) = (Subscript[w, xx]) 0≤x≤l, t>0 with w(0,t) = 0 t>0, w(l,t) = 0 t>0, w(x,0) = 0 0≤x≤l. By the weak maximum/minimum principle, the maximum and minimum of w(x,t) is achieved on Γ. But w is zero there so w = 0 on all of (Overscript[D, -]) = [0,l]×[0,T]

Laplace’s Equation

Let D be an open, bounded subset of (ℝ^2). Let ∂D = boundary of D and (Overscript[D, -]) = D⋃∂D = closure of D.

Definitions

Laplace’s equation: Δu = 0 on D

Poisson Equation: Δu = f on D (for a given function f)

Dirichlet Condition: u(Subscript[|, ∂D]) = h (for a given function h)

We say that u is a harmonic function on D if Δu =0 for x ∈D. We write u ∈(C^2)(D)⋂(C^0)((Overscript[D, -])) if u, (Subscript[u, x]), (Subscript[u, y]), (Subscript[u, xx]), (Subscript[u, xy]), (Subscript[u, yy]) exist and are continuous on D and u is continuous on (Overscript[D, -]) = D⋃∂D

Laplace’s Equation on a Disk

Δu = 0 on D = {(x,y)|(x^2)+(y^2) < (a^2)},  u(Subscript[|, ∂D]) = h for a given positive radius a>0 and a given continuous function h. We proceed using polar coordinates (x,y) = (r cosφ,r sinφ), (r,φ) = ((Sqrt[(x^2)+(y^2)]), arctan((y/x))). Write u(x,y) = u(r cosφ,r sinφ) = (OverTilde[u])(r,φ). Recall that the Laplacian of a vector v in polar coordinates is (Subscript[v, rr])+(1/r)(Subscript[v, r])+(1/(r^2))(Subscript[v, φφ]).