#set document(title: "4.6 PDEs, Separation of Variables, and The Heat Equation", author: "Jiří Lebl") #set page(width: 8.5in, height: auto, margin: 1in) #import "@preview/cetz:0.5.2" #set text(font: ("STIX Two Text", "Libertinus Serif", "New Computer Modern"), size: 10.5pt, lang: "en") #show math.equation: set text(font: ("STIX Two Math", "New Computer Modern Math")) #set par(justify: true, leading: 0.62em, spacing: 0.9em) #set enum(spacing: 1.1em) // room between list items so tall inline fractions don't collide #set list(spacing: 1.1em) #set table(stroke: 0.5pt + rgb("#c7ccd3")) #let BLUE = rgb("#183B6F") // brand navy — section bars + example/solution labels (white on navy 11.09:1) #let ORANGE = rgb("#A94509") // brand primary-700 — AA-safe deep orange for TEXT (5.93:1 on white; raw brand #F37021 is 2.94:1 and must never carry text) #let RED = rgb("#DC2626") // brand error-600 #let GREEN = rgb("#059669") // brand success-600 (decoration only; small green text uses green-text #007942) #show heading.where(level: 1): it => block(width: 100%, above: 0pt, below: 16pt, fill: gradient.linear(BLUE, rgb("#2C5AA0")), inset: (x: 14pt, y: 12pt), radius: 3pt, text(fill: white, weight: "bold", size: 19pt, it.body)) #show heading.where(level: 2): it => block(width: 100%, above: 18pt, below: 10pt, fill: BLUE, inset: (x: 10pt, y: 6pt), radius: 2pt, text(fill: white, weight: "bold", size: 12pt, it.body)) #show heading.where(level: 3): it => text(fill: ORANGE, weight: "bold", size: 12.5pt, it.body) #show heading.where(level: 4): it => text(fill: BLUE, weight: "bold", size: 10.5pt, it.body) #let examplebox(label, title, body) = block(width: 100%, breakable: true, fill: rgb("#EFF1F5"), stroke: 0.5pt + rgb("#CFDDF0"), radius: 4pt, inset: 10pt, above: 12pt, below: 12pt)[ #block(below: 6pt)[#box(fill: BLUE, inset: (x: 6pt, y: 2pt), radius: 2pt, text(fill: white, weight: "bold", size: 8.5pt, label)) #h(0.4em) #strong[#title]] #body] // rail = decorative left rule (raw brand token); labelcolor = AA-safe label text shade #let notebox(label, rail, labelcolor, tint, body) = block(width: 100%, breakable: true, fill: tint, stroke: (left: 3pt + rail), inset: (left: 10pt, rest: 8pt), radius: (right: 4pt), above: 11pt, below: 11pt)[ #text(fill: labelcolor, weight: "bold", size: 7.5pt, tracking: 0.5pt)[#upper(label)] #linebreak() #body] #let solutionbox(body) = block(above: 4pt, below: 8pt)[ #text(fill: BLUE, weight: "bold", size: 8.5pt)[Solution] #linebreak() #body] #let figph(msg) = block(width: 100%, height: 60pt, fill: rgb("#f6f7f9"), stroke: (paint: rgb("#c7ccd3"), dash: "dashed"), radius: 4pt, inset: 10pt)[ #align(center + horizon, text(fill: rgb("#889"), style: "italic", size: 9pt, msg))] // Standardize inlined figure sizes: measure the natural CeTZ canvas, then scale to a // consistent envelope (aspect-aware; see build_typst.py FIG_* constants). Unlike the // print preamble, dimensions are FLOORED: in an editor a user can trim a figure to a // degenerate 1-D shape (a bare line), and w/h or tw/w would then divide by zero. #let _STD_W = 3.5 #let _WIDE_W = 5.6 #let _MAX_H = 3.4 #let _ASPECT_WIDE = 2.2 #let _UPSCALE_MAX = 1.15 #let stdfig(body) = context { let m = measure(body) let w = calc.max(m.width / 1in, 0.01) let h = calc.max(m.height / 1in, 0.01) let tw = if w / h > _ASPECT_WIDE { _WIDE_W } else { _STD_W } let s = calc.min(tw / w, _MAX_H / h, _UPSCALE_MAX) align(center, box(scale(x: s * 100%, y: s * 100%, reflow: true, body))) } #show figure: set block(breakable: false) #set figure(gap: 8pt) #show figure.caption: set text(size: 8.5pt, fill: rgb("#555")) == 4.6#h(0.6em)PDEs, Separation of Variables, and The Heat Equation Let us recall that a #emph[partial differential equation] or PDE is an equation containing the partial derivatives with respect to several independent variables. Solving PDEs will be our main application of Fourier series. A PDE is said to be #emph[linear]if the dependent variable and its derivatives appear at most to the first power and in no functions. We will only talk about linear PDEs. Together with a PDE, we usually have specified some #emph[boundary conditions], where the value of the solution or its derivatives is specified along the boundary of a region, and/or some #emph[initial conditions] where the value of the solution or its derivatives is specified for some initial time. Sometimes such conditions are mixed together and we will refer to them simply as #emph[side conditions]. We will study three specific partial differential equations, each one representing a more general class of equations. First, we will study the #emph[heat equation], which is an example of a #emph[parabolic]PDE. Next, we will study the #emph[wave equation], which is an example of a #emph[hyperbolic PDE]. Finally, we will study the #emph[Laplace equation], which is an example of an #emph[elliptic PDE]. Each of our examples will illustrate behavior that is typical for the whole class. === Heat on an Insulated Wire Let us first study the heat equation. Suppose that we have a wire (or a thin metal rod) of length #math.equation(block: false, alt: "L")[$L$] that is insulated except at the endpoints. Let #math.equation(block: false, alt: "x")[$x$] denote the position along the wire and let #math.equation(block: false, alt: "t")[$t$] denote time. See Figure #math.equation(block: false, alt: "1")[$1$]. #figure(figph[Diagram of an insulated wire: a thin cylinder along the x-axis from 0 to L, capped at both ends, with a vertical axis at the left labelled temperature u.], alt: "Diagram of an insulated wire: a thin cylinder along the x-axis from 0 to L, capped at both ends, with a vertical axis at the left labelled temperature u.", caption: [Figure #math.equation(block: false, alt: "1")[$1$]: Insulated wire.]) Let #math.equation(block: false, alt: "u open parenthesis x , t close parenthesis")[$u ( x , t )$] denote the temperature at point #math.equation(block: false, alt: "x")[$x$] at time #math.equation(block: false, alt: "t")[$t$]. The equation governing this setup is the so-called#emph[one-dimensional heat equation]: #math.equation(block: true, alt: "the fraction ∂ u over ∂ t equals k the fraction ∂ squared u over ∂ x squared ,")[$frac(∂ u, ∂ t) = k frac(∂^(2) u, ∂ x^(2)) ,$] where #math.equation(block: false, alt: "k greater than 0")[$k > 0$] is a constant (the #emph[thermal conductivity] of the material). That is, the change in heat at a specific point is proportional to the second derivative of the heat along the wire. This makes sense; if at a fixed #math.equation(block: false, alt: "t")[$t$] the graph of the heat distribution has a maximum (the graph is concave down), then heat flows away from the maximum. And vice-versa. We will generally use a more convenient notation for partial derivatives. We will write #math.equation(block: false, alt: "u sub t")[$u_(t)$] instead of #math.equation(block: false, alt: "the fraction ∂ u over ∂ t")[$frac(∂ u, ∂ t)$], and we will write #math.equation(block: false, alt: "u sub x x")[$u_(x x)$] instead of #math.equation(block: false, alt: "the fraction ∂ squared u over ∂ x squared")[$frac(∂^(2) u, ∂ x^(2))$]. With this notation the heat equation becomes #math.equation(block: true, alt: "u sub t equals k u sub x x .")[$u_(t) = k u_(x x) .$] For the heat equation, we must also have some boundary conditions. We assume that the ends of the wire are either exposed and touching some body of constant heat, or the ends are insulated. For example, if the ends of the wire are kept at temperature 0, then we must have the conditions #math.equation(block: true, alt: "u open parenthesis 0 , t close parenthesis equals 0 and u open parenthesis L , t close parenthesis equals 0 .")[$u ( 0 , t ) = 0 #h(1em) "and" #h(1em) u ( L , t ) = 0 .$] If, on the other hand, the ends are also insulated we get the conditions #math.equation(block: true, alt: "u sub x open parenthesis 0 , t close parenthesis equals 0 and u sub x open parenthesis L , t close parenthesis equals 0 .")[$u_(x) ( 0 , t ) = 0 #h(1em) "and" #h(1em) u_(x) ( L , t ) = 0 .$] Let us see why that is so. If #math.equation(block: false, alt: "u sub x")[$u_(x)$] is positive at some point #math.equation(block: false, alt: "x sub 0")[$x_(0)$], then at a particular time, #math.equation(block: false, alt: "u")[$u$] is smaller to the left of #math.equation(block: false, alt: "x sub 0")[$x_(0)$], and higher to the right of #math.equation(block: false, alt: "x sub 0")[$x_(0)$]. Heat is flowing from high heat to low heat, that is to the left. On the other hand if #math.equation(block: false, alt: "u sub x")[$u_(x)$] is negative then heat is again flowing from high heat to low heat, that is to the right. So when #math.equation(block: false, alt: "u sub x")[$u_(x)$] is zero, that is a point through which heat is not flowing. In other words, #math.equation(block: false, alt: "u sub x open parenthesis 0 , t close parenthesis equals 0")[$u_(x) ( 0 , t ) = 0$] means no heat is flowing in or out of the wire at the point #math.equation(block: false, alt: "x equals 0")[$x = 0$]. We have two conditions along the #math.equation(block: false, alt: "x")[$x$]-axis as there are two derivatives in the #math.equation(block: false, alt: "x")[$x$] direction. These side conditions are said to be #emph[homogeneous] (i.e., #math.equation(block: false, alt: "u")[$u$] or a derivative of #math.equation(block: false, alt: "u")[$u$] is set to zero). We also need an initial condition—the temperature distribution at time #math.equation(block: false, alt: "t equals 0")[$t = 0$]. That is, #math.equation(block: true, alt: "u open parenthesis x , 0 close parenthesis equals f open parenthesis x close parenthesis ,")[$u ( x , 0 ) = f ( x ) ,$] for some known function #math.equation(block: false, alt: "f open parenthesis x close parenthesis")[$f ( x )$]. This initial condition is not a homogeneous side condition. === Separation of Variables The heat equation is linear as #math.equation(block: false, alt: "u")[$u$] and its derivatives do not appear to any powers or in any functions. Thus the principle of superposition still applies for the heat equation (without side conditions). If #math.equation(block: false, alt: "u sub 1")[$u_(1)$] and #math.equation(block: false, alt: "u sub 2")[$u_(2)$] are solutions and #math.equation(block: false, alt: "c sub 1 , c sub 2")[$c_(1) , c_(2)$] are constants, then #math.equation(block: false, alt: "u equals c sub 1 u sub 1 plus c sub 2 u sub 2")[$u = c_(1) u_(1) + c_(2) u_(2)$] is also a solution. #notebox("Your Turn", rgb("#8a94a6"), rgb("#556666"), rgb("#f7f8fa"))[ Verify the principle of superposition for the heat equation. ] Superposition also preserves some of the side conditions. In particular, if #math.equation(block: false, alt: "u sub 1")[$u_(1)$] and #math.equation(block: false, alt: "u sub 2")[$u_(2)$] are solutions that satisfy #math.equation(block: false, alt: "u open parenthesis 0 , t close parenthesis equals 0")[$u ( 0 , t ) = 0$] and #math.equation(block: false, alt: "u sub open parenthesis L , t close parenthesis equals 0")[$u_( L , t ) = 0$], and #math.equation(block: false, alt: "c sub 1 , c sub 2")[$c_(1) , #h(0.222em) c_(2)$] are constants, then #math.equation(block: false, alt: "u equals c sub 1 u sub 1 plus c sub 2 u sub 2")[$u = c_(1) u_(1) + c_(2) u_(2)$] is still a solution that satisfies #math.equation(block: false, alt: "u open parenthesis 0 , t close parenthesis equals 0")[$u ( 0 , t ) = 0$] and#math.equation(block: false, alt: "u sub open parenthesis L , t close parenthesis equals 0")[$u_( L , t ) = 0$]. Similarly for the side conditions #math.equation(block: false, alt: "u sub x open parenthesis 0 , t close parenthesis equals 0")[$u_(x) ( 0 , t ) = 0$] and #math.equation(block: false, alt: "u sub x open parenthesis L , t close parenthesis equals 0")[$u_(x) ( L , t ) = 0$]. In general, superposition preserves all homogeneous side conditions. The method of #emph[separation of variables] is to try to find solutions that are sums or products of functions of one variable. For example, for the heat equation, we try to find solutions of the form #math.equation(block: true, alt: "u open parenthesis x , t close parenthesis equals X open parenthesis x close parenthesis T open parenthesis t close parenthesis .")[$u ( x , t ) = X ( x ) T ( t ) .$] That the desired solution we are looking for is of this form is too much to hope for. What is perfectly reasonable to ask, however, is to find enough “building-block” solutions of the form #math.equation(block: false, alt: "u open parenthesis x , t close parenthesis equals X open parenthesis x close parenthesis T open parenthesis t close parenthesis")[$u ( x , t ) = X ( x ) T ( t )$] using this procedure so that the desired solution to the PDE is somehow constructed from these building blocks by the use of superposition. Let us try to solve the heat equation #math.equation(block: true, alt: "u sub t equals k u sub x x with u open parenthesis 0 , t close parenthesis equals 0 , u open parenthesis L , t close parenthesis equals 0 , and u open parenthesis x , 0 close parenthesis equals f open parenthesis x close parenthesis .")[$u_(t) = k u_(x x) #h(1em) "with" #h(1em) u ( 0 , t ) = 0 , #h(1em) u ( L , t ) = 0 , #h(1em) "and" #h(1em) u ( x , 0 ) = f ( x ) .$] Let us guess #math.equation(block: false, alt: "u open parenthesis x , t close parenthesis equals X open parenthesis x close parenthesis T open parenthesis t close parenthesis")[$u ( x , t ) = X ( x ) T ( t )$]. We will try to make this guess satisfy the differential equation, #math.equation(block: false, alt: "u sub t equals k u sub x x")[$u_(t) = k u_(x x)$], and the homogeneous side conditions, #math.equation(block: false, alt: "u open parenthesis 0 , t close parenthesis equals 0")[$u ( 0 , t ) = 0$] and #math.equation(block: false, alt: "u open parenthesis L , t close parenthesis equals 0")[$u ( L , t ) = 0$]. Then, as superposition preserves the differential equation and the homogeneous side conditions, we will try to build up a solution from these building blocks to solve the nonhomogeneous initial condition #math.equation(block: false, alt: "u open parenthesis x , 0 close parenthesis equals f open parenthesis x close parenthesis")[$u ( x , 0 ) = f ( x )$]. First we plug #math.equation(block: false, alt: "u open parenthesis x , t close parenthesis equals X open parenthesis x close parenthesis T open parenthesis t close parenthesis")[$u ( x , t ) = X ( x ) T ( t )$] into the heat equation to obtain #math.equation(block: true, alt: "X open parenthesis x close parenthesis T prime open parenthesis t close parenthesis equals k X double prime open parenthesis x close parenthesis T open parenthesis t close parenthesis .")[$X ( x ) T^(′) ( t ) = k X^(″) ( x ) T ( t ) .$] We rewrite as #math.equation(block: true, alt: "the fraction T prime open parenthesis t close parenthesis over k T open parenthesis t close parenthesis equals the fraction X double prime open parenthesis x close parenthesis over X open parenthesis x close parenthesis .")[$frac(T^(′) ( t ), k T ( t )) = frac(X^(″) ( x ), X ( x )) .$] This equation must hold for all #math.equation(block: false, alt: "x")[$x$] and all #math.equation(block: false, alt: "t")[$t$]. But the left hand side does not depend on #math.equation(block: false, alt: "x")[$x$] and the right hand side does not depend on #math.equation(block: false, alt: "t")[$t$]. Hence, each side must be a constant. Let us call this constant #math.equation(block: false, alt: "minus λ")[$− λ$] (the minus sign is for convenience later). We obtain the two equations #math.equation(block: true, alt: "the fraction T prime open parenthesis t close parenthesis over k T open parenthesis t close parenthesis equals minus λ equals the fraction X double prime open parenthesis x close parenthesis over X open parenthesis x close parenthesis .")[$frac(T^(′) ( t ), k T ( t )) = − λ = frac(X^(″) ( x ), X ( x )) .$] In other words #math.equation(block: true, alt: "X double prime open parenthesis x close parenthesis plus λ X open parenthesis x close parenthesis equals 0 ,; T prime open parenthesis t close parenthesis plus λ k T open parenthesis t close parenthesis equals 0 .")[$X^(″) ( x ) + λ X ( x ) = 0 , \ T^(′) ( t ) + λ k T ( t ) = 0 .$] The boundary condition #math.equation(block: false, alt: "u open parenthesis 0 , t close parenthesis equals 0")[$u ( 0 , t ) = 0$] implies #math.equation(block: false, alt: "X open parenthesis 0 close parenthesis T open parenthesis t close parenthesis equals 0")[$X ( 0 ) T ( t ) = 0$]. We are looking for a nontrivial solution and so we can assume that #math.equation(block: false, alt: "T open parenthesis t close parenthesis")[$T ( t )$] is not identically zero. Hence #math.equation(block: false, alt: "X open parenthesis 0 close parenthesis equals 0")[$X ( 0 ) = 0$]. Similarly, #math.equation(block: false, alt: "u open parenthesis L , t close parenthesis equals 0")[$u ( L , t ) = 0$] implies #math.equation(block: false, alt: "X open parenthesis L close parenthesis equals 0")[$X ( L ) = 0$]. We are looking for nontrivial solutions #math.equation(block: false, alt: "X")[$X$] of the eigenvalue problem #math.equation(block: false, alt: "X double prime plus λ X equals 0 , X open parenthesis 0 close parenthesis equals 0 , X open parenthesis L close parenthesis equals 0")[$X^(″) + λ X = 0 , X ( 0 ) = 0 , X ( L ) = 0$]. We have previously found that the only eigenvalues are #math.equation(block: false, alt: "λ sub n equals the fraction n squared π squared over L squared")[$λ_(n) = frac(n^(2) π^(2), L^(2))$], for integers #math.equation(block: false, alt: "n greater than or equal to 1")[$n ≥ 1$], where eigenfunctions are #math.equation(block: false, alt: "sin open parenthesis the fraction n π over L x close parenthesis")[$sin ( frac(n π, L) x )$]. Hence, let us pick the solutions #math.equation(block: true, alt: "X sub n open parenthesis x close parenthesis equals sin open parenthesis the fraction n π over L x close parenthesis .")[$X_(n) ( x ) = sin ( frac(n π, L) x ) .$] The corresponding #math.equation(block: false, alt: "T sub n")[$T_(n)$] must satisfy the equation #math.equation(block: true, alt: "T n ′ open parenthesis t close parenthesis plus the fraction n squared π squared over L squared k T sub n open parenthesis t close parenthesis equals 0 .")[$T_(n)^(′) ( t ) + frac(n^(2) π^(2), L^(2)) k T_(n) ( t ) = 0 .$] By the method of integrating factor, the solution of this problem is #math.equation(block: true, alt: "T sub n open parenthesis t close parenthesis equals e to the power the fraction minus n squared π squared over L squared k t .")[$T_(n) ( t ) = e^(frac(− n^(2) π^(2), L^(2)) k t) .$] It will be useful to note that #math.equation(block: false, alt: "T sub n open parenthesis 0 close parenthesis equals 1")[$T_(n) ( 0 ) = 1$]. Our building-block solutions are #math.equation(block: true, alt: "u sub n open parenthesis x , t close parenthesis equals X sub n open parenthesis x close parenthesis T sub n open parenthesis t close parenthesis equals sin open parenthesis the fraction n π over L x close parenthesis e to the power the fraction minus n squared π squared over L squared k t .")[$u_(n) ( x , t ) = X_(n) ( x ) T_(n) ( t ) = sin ( frac(n π, L) x ) e^(frac(− n^(2) π^(2), L^(2)) k t) .$] We note that #math.equation(block: false, alt: "u sub n open parenthesis x , 0 close parenthesis equals sin open parenthesis the fraction n π over L x close parenthesis")[$u_(n) ( x , 0 ) = sin ( frac(n π, L) x )$]. Let us write #math.equation(block: false, alt: "f open parenthesis x close parenthesis")[$f ( x )$] as the sine series #math.equation(block: true, alt: "f open parenthesis x close parenthesis equals ∑ n equals 1 infinity b sub n sin open parenthesis the fraction n π over L x close parenthesis .")[$f ( x ) = ∑_(n = 1)^(∞) b_(n) sin ( frac(n π, L) x ) .$] That is, we find the Fourier series of the odd periodic extension of #math.equation(block: false, alt: "f open parenthesis x close parenthesis")[$f ( x )$]. We used the sine series as it corresponds to the eigenvalue problem for #math.equation(block: false, alt: "X open parenthesis x close parenthesis")[$X ( x )$] above. Finally, we use superposition to write the solution as #math.equation(block: true, alt: "u open parenthesis x , t close parenthesis equals ∑ n equals 1 infinity b sub n u sub n open parenthesis x , t close parenthesis equals ∑ n equals 1 infinity b sub n sin open parenthesis the fraction n π over L x close parenthesis e to the power the fraction minus n squared π squared over L squared k t .")[$u ( x , t ) = ∑_(n = 1)^(∞) b_(n) u_(n) ( x , t ) = ∑_(n = 1)^(∞) b_(n) sin ( frac(n π, L) x ) e^(frac(− n^(2) π^(2), L^(2)) k t) .$] Why does this solution work? First note that it is a solution to the heat equation by superposition. It satisfies #math.equation(block: false, alt: "u open parenthesis 0 , t close parenthesis equals 0")[$u ( 0 , t ) = 0$] and #math.equation(block: false, alt: "u open parenthesis L , t close parenthesis equals 0")[$u ( L , t ) = 0$], because #math.equation(block: false, alt: "x equals 0")[$x = 0$] or #math.equation(block: false, alt: "x equals L")[$x = L$] makes all the sines vanish. Finally, plugging in #math.equation(block: false, alt: "t equals 0")[$t = 0$], we notice that #math.equation(block: false, alt: "T sub n open parenthesis 0 close parenthesis equals 1")[$T_(n) ( 0 ) = 1$] and so #math.equation(block: true, alt: "u open parenthesis x , 0 close parenthesis equals ∑ n equals 1 infinity b sub n u sub n open parenthesis x , 0 close parenthesis equals ∑ n equals 1 infinity b sub n sin open parenthesis the fraction n π over L x close parenthesis equals f open parenthesis x close parenthesis .")[$u ( x , 0 ) = ∑_(n = 1)^(∞) b_(n) u_(n) ( x , 0 ) = ∑_(n = 1)^(∞) b_(n) sin ( frac(n π, L) x ) = f ( x ) .$] #examplebox("Example 1")[][ Suppose that we have an insulated wire of length #math.equation(block: false, alt: "1")[$1$], such that the ends of the wire are embedded in ice (temperature 0). Let #math.equation(block: false, alt: "k equals 0.003")[$k = 0.003$]. Then suppose that initial heat distribution is #math.equation(block: false, alt: "u open parenthesis x , 0 close parenthesis equals 50 x open parenthesis 1 minus x close parenthesis")[$u ( x , 0 ) = 50 x ( 1 − x )$]. See Figure #math.equation(block: false, alt: "2")[$2$]. #figure(figph[Plot of the initial temperature in the wire, x from 0 to 1: a downward-opening parabola, zero at both iced ends and peaking near 12.5 at the midpoint.], alt: "Plot of the initial temperature in the wire, x from 0 to 1: a downward-opening parabola, zero at both iced ends and peaking near 12.5 at the midpoint.", caption: [Figure #math.equation(block: false, alt: "2")[$2$]: Initial distribution of temperature in the wire.]) We want to find the temperature function #math.equation(block: false, alt: "u open parenthesis x , t close parenthesis")[$u ( x , t )$]. Let us suppose we also want to find when (at what #math.equation(block: false, alt: "t")[$t$]) does the maximum temperature in the wire drop to one half of the initial maximum of #math.equation(block: false, alt: "12.5")[$12.5$]. We are solving the following PDE problem: #math.equation(block: true, alt: "u sub t equals 0.003 u sub x x ,; u open parenthesis 0 , t close parenthesis equals u open parenthesis 1 , t close parenthesis equals 0 ,; u open parenthesis x , 0 close parenthesis equals 50 x open parenthesis 1 minus x close parenthesis f o r 0 less than x less than 1 .")[$u_(t) = 0.003 u_(x x) , \ u ( 0 , t ) = u ( 1 , t ) = 0 , \ u ( x , 0 ) = 50 x ( 1 − x ) " " " " " " " " upright(f) upright(o) upright(r) " " 0 < x < 1 .$] We write #math.equation(block: false, alt: "f open parenthesis x close parenthesis equals 50 x open parenthesis 1 minus x close parenthesis")[$f ( x ) = 50 x ( 1 − x )$] for #math.equation(block: false, alt: "0 less than x less than 1")[$0 < x < 1$] as a sine series. That is, #math.equation(block: false, alt: "f open parenthesis x close parenthesis equals ∑ n equals 1 infinity b sub n sin open parenthesis n π x close parenthesis")[$f ( x ) = ∑_(n = 1)^(∞) b_(n) sin ( n π x )$], where #math.equation(block: true, alt: "0 i f n e v e n ,; the fraction 400 over π cubed n cubed i f n o d d .")[$0 upright(i) upright(f) " " n " " upright(e) upright(v) upright(e) upright(n) , \ frac(400, π^(3) n^(3)) upright(i) upright(f) " " n " " upright(o) upright(d) upright(d) .$] #figure(figph[Three-dimensional surface of wire temperature over x from 0 to 1 and time 0 to 100. The initial arch peaking near 12.5 decays smoothly to close to zero by t equals 100, with both ends held at zero.], alt: "Three-dimensional surface of wire temperature over x from 0 to 1 and time 0 to 100. The initial arch peaking near 12.5 decays smoothly to close to zero by t equals 100, with both ends held at zero.", caption: [Figure #math.equation(block: false, alt: "3")[$3$]: Plot of the temperature of the wire at position #math.equation(block: false, alt: "x")[$x$] at time #math.equation(block: false, alt: "t")[$t$].]) The solution #math.equation(block: false, alt: "u open parenthesis x , t close parenthesis")[$u ( x , t )$], plotted in Figure #math.equation(block: false, alt: "3")[$3$] for \\( 0 \\leq t \\leq 100\\), is given by the series: #math.equation(block: true, alt: "u open parenthesis x , t close parenthesis equals ∑ n equals 1 n o d d infinity the fraction 400 over π cubed n cubed sin open parenthesis n π x close parenthesis e to the power minus n squared π squared 0.003 t .")[$u ( x , t ) = ∑_(limits(n = 1)_(n " " upright(o) upright(d) upright(d)))^(∞) frac(400, π^(3) n^(3)) sin ( n π x ) e^(− n^(2) π^(2) 0.003 t) .$] Finally, let us answer the question about the maximum temperature. It is relatively easy to see that the maximum temperature will always be at #math.equation(block: false, alt: "x equals 0.5")[$x = 0.5$], in the middle of the wire. The plot of #math.equation(block: false, alt: "u open parenthesis x , t close parenthesis")[$u ( x , t )$] confirms this intuition. If we plug in #math.equation(block: false, alt: "x equals 0.5")[$x = 0.5$] we get #math.equation(block: true, alt: "u open parenthesis 0.5 , t close parenthesis equals ∑ n equals 1 n o d d infinity the fraction 400 over π cubed n cubed sin open parenthesis n π 0.5 close parenthesis e to the power minus n squared π squared 0.003 t .")[$u ( 0.5 , t ) = ∑_(limits(n = 1)_(n " " upright(o) upright(d) upright(d)))^(∞) frac(400, π^(3) n^(3)) sin ( n π 0.5 ) e^(− n^(2) π^(2) 0.003 t) .$] For #math.equation(block: false, alt: "n equals 3")[$n = 3$] and higher (remember #math.equation(block: false, alt: "n")[$n$] is only odd), the terms of the series are insignificant compared to the first term. The first term in the series is already a very good approximation of the function. Hence #math.equation(block: true, alt: "u open parenthesis 0.5 , t close parenthesis approximately equals the fraction 400 over π cubed e to the power minus π squared 0.003 t .")[$u ( 0.5 , t ) ≈ frac(400, π^(3)) e^(− π^(2) 0.003 t) .$] The approximation gets better and better as #math.equation(block: false, alt: "t")[$t$] gets larger as the other terms decay much faster. Let us plot the function #math.equation(block: false, alt: "0.5 , t")[$0.5 , t$], the temperature at the midpoint of the wire at time #math.equation(block: false, alt: "t")[$t$], in Figure #math.equation(block: false, alt: "4")[$4$]. The figure also plots the approximation by the first term. #figure(figph[Plot of the temperature at the midpoint of the wire, falling exponentially from about 12.5 to roughly 0.8 over time 0 to 100. The green one-term approximation starts slightly higher but coincides with the blue exact curve past t equals 5.], alt: "Plot of the temperature at the midpoint of the wire, falling exponentially from about 12.5 to roughly 0.8 over time 0 to 100. The green one-term approximation starts slightly higher but coincides with the blue exact curve past t equals 5.", caption: [Figure #math.equation(block: false, alt: "4")[$4$]: Temperature at the midpoint of the wire (the bottom curve), and the approximation of this temperature by using only the first term in the series (top curve).]) After #math.equation(block: false, alt: "t equals 5")[$t = 5$] or so it would be hard to tell the difference between the first term of the series for #math.equation(block: false, alt: "u open parenthesis x , t close parenthesis")[$u ( x , t )$] and the real solution #math.equation(block: false, alt: "u open parenthesis x , t close parenthesis")[$u ( x , t )$]. This behavior is a general feature of solving the heat equation. If you are interested in behavior for large enough #math.equation(block: false, alt: "t")[$t$], only the first one or two terms may be necessary. Let us get back to the question of when is the maximum temperature one half of the initial maximum temperature. That is, when is the temperature at the midpoint #math.equation(block: false, alt: "12.5 / 2 equals 6.25")[$12.5 / 2 = 6.25$]. We notice on the graph that if we use the approximation by the first term we will be close enough. We solve #math.equation(block: true, alt: "6.25 equals the fraction 400 over π cubed e to the power minus π squared 0.003 t .")[$6.25 = frac(400, π^(3)) e^(− π^(2) 0.003 t) .$] That is, #math.equation(block: true, alt: "t equals the fraction ln the fraction 6.25 π cubed over 400 over minus π squared 0.003 approximately equals 24.5 .")[$t = frac(ln frac(6.25 π^(3), 400), − π^(2) 0.003) ≈ 24.5 .$] So the maximum temperature drops to half at about #math.equation(block: false, alt: "t equals 24.5")[$t = 24.5$]. ] We mention an interesting behavior of the solution to the heat equation. The heat equation “smoothes” out the function #math.equation(block: false, alt: "f open parenthesis x close parenthesis")[$f ( x )$] as #math.equation(block: false, alt: "t")[$t$] grows. For a fixed #math.equation(block: false, alt: "t")[$t$], the solution is a Fourier series with coefficients #math.equation(block: false, alt: "b sub n e to the power the fraction minus n squared π squared over L squared k t")[$b_(n) e^(frac(− n^(2) π^(2), L^(2)) k t)$]. If #math.equation(block: false, alt: "t greater than 0")[$t > 0$], then these coefficients go to zero faster than any #math.equation(block: false, alt: "the fraction 1 over n to the power P")[$frac(1, n^(P))$] for any power #math.equation(block: false, alt: "p")[$p$]. In other words, the Fourier series has infinitely many derivatives everywhere. Thus even if the function #math.equation(block: false, alt: "f open parenthesis x close parenthesis")[$f ( x )$] has jumps and corners, then for a fixed #math.equation(block: false, alt: "t greater than 0")[$t > 0$], the solution #math.equation(block: false, alt: "u open parenthesis x , t close parenthesis")[$u ( x , t )$] as a function of #math.equation(block: false, alt: "x")[$x$] is as smooth as we want it to be. #examplebox("Example 2")[][ When the initial condition is already a sine series, then there is no need to compute anything, you just need to plug in. Consider #math.equation(block: true, alt: "u sub t equals 0.3 u sub x x , u open parenthesis 0 , t close parenthesis equals u open parenthesis 1 , t close parenthesis equals 0 , u open parenthesis x , 0 close parenthesis equals 0.1 sin open parenthesis π t close parenthesis plus sin open parenthesis 2 π t close parenthesis .")[$u_(t) = 0.3 u_(x x) , #h(2em) u ( 0 , t ) = u ( 1 , t ) = 0 , #h(2em) u ( x , 0 ) = 0.1 sin ( π t ) + sin ( 2 π t ) .$] The solution is then #math.equation(block: true, alt: "u open parenthesis x , t close parenthesis equals 0.1 sin open parenthesis π t close parenthesis e to the power minus 0.3 π squared t plus sin open parenthesis 2 π t close parenthesis e to the power minus 1.2 π squared t .")[$u ( x , t ) = 0.1 sin ( π t ) e^(− 0.3 π^(2) t) + sin ( 2 π t ) e^(− 1.2 π^(2) t) .$] ] === Insulated Ends Now suppose the ends of the wire are insulated. In this case, we are solving the equation #math.equation(block: true, alt: "u sub t equals k u sub x x with u sub x open parenthesis 0 , t close parenthesis equals 0 , u sub x open parenthesis L , t close parenthesis equals 0 , and u open parenthesis x , 0 close parenthesis equals f open parenthesis x close parenthesis .")[$u_(t) = k u_(x x) #h(1em) "with" #h(1em) u_(x) ( 0 , t ) = 0 , #h(1em) u_(x) ( L , t ) = 0 , #h(1em) "and" #h(1em) u ( x , 0 ) = f ( x ) .$] Yet again we try a solution of the form #math.equation(block: false, alt: "u open parenthesis x , t close parenthesis equals X open parenthesis x close parenthesis T open parenthesis t close parenthesis")[$u ( x , t ) = X ( x ) T ( t )$]. By the same procedure as before we plug into the heat equation and arrive at the following two equations #math.equation(block: true, alt: "X double prime open parenthesis x close parenthesis plus λ X open parenthesis x close parenthesis equals 0 ,; T prime open parenthesis t close parenthesis plus λ k T open parenthesis t close parenthesis equals 0 .")[$X^(″) ( x ) + λ X ( x ) = 0 , \ T^(′) ( t ) + λ k T ( t ) = 0 .$] At this point the story changes slightly. The boundary condition #math.equation(block: false, alt: "u sub x open parenthesis 0 , t close parenthesis equals 0")[$u_(x) ( 0 , t ) = 0$] implies #math.equation(block: false, alt: "X prime open parenthesis 0 close parenthesis T open parenthesis t close parenthesis equals 0")[$X^(′) ( 0 ) T ( t ) = 0$]. Hence #math.equation(block: false, alt: "X prime open parenthesis 0 close parenthesis equals 0")[$X^(′) ( 0 ) = 0$]. Similarly, #math.equation(block: false, alt: "u sub x open parenthesis L , t close parenthesis equals 0")[$u_(x) ( L , t ) = 0$] implies #math.equation(block: false, alt: "X prime open parenthesis L close parenthesis equals 0")[$X^(′) ( L ) = 0$]. We are looking for nontrivial solutions #math.equation(block: false, alt: "X")[$X$] of the eigenvalue problem #math.equation(block: false, alt: "X double prime plus λ X equals 0 ,")[$X^(″) + λ X = 0 ,$] #math.equation(block: false, alt: "X prime open parenthesis 0 close parenthesis equals 0 ,")[$X^(′) ( 0 ) = 0 ,$] #math.equation(block: false, alt: "X prime open parenthesis L close parenthesis equals 0 ,")[$X^(′) ( L ) = 0 ,$]. We have previously found that the only eigenvalues are #math.equation(block: false, alt: "λ sub n equals the fraction n squared π squared over L squared")[$λ_(n) = frac(n^(2) π^(2), L^(2))$], for integers #math.equation(block: false, alt: "n greater than or equal to 0")[$n ≥ 0$], where eigenfunctions are #math.equation(block: false, alt: "cos open parenthesis the fraction n π over L close parenthesis X")[$cos ( frac(n π, L) ) X$] (we include the constant eigenfunction). Hence, let us pick solutions #math.equation(block: true, alt: "X sub n open parenthesis x close parenthesis equals cos open parenthesis the fraction n π over L x close parenthesis and X sub 0 open parenthesis x close parenthesis equals 1 .")[$X_(n) ( x ) = cos ( frac(n π, L) x ) #h(1em) "and" #h(1em) X_(0) ( x ) = 1 .$] The corresponding #math.equation(block: false, alt: "T sub n")[$T_(n)$] must satisfy the equation #math.equation(block: true, alt: "T n ′ open parenthesis t close parenthesis plus the fraction n squared π squared over L squared k T sub n open parenthesis t close parenthesis equals 0 .")[$T_(n)^(′) ( t ) + frac(n^(2) π^(2), L^(2)) k T_(n) ( t ) = 0 .$] For #math.equation(block: false, alt: "n greater than or equal to 1")[$n ≥ 1$], as before, #math.equation(block: true, alt: "T sub n open parenthesis t close parenthesis equals e to the power the fraction minus n squared π squared over L squared k t .")[$T_(n) ( t ) = e^(frac(− n^(2) π^(2), L^(2)) k t) .$] For #math.equation(block: false, alt: "n equals 0")[$n = 0$], we have #math.equation(block: false, alt: "T 0 ′ open parenthesis t close parenthesis equals 0")[$T_(0)^(′) ( t ) = 0$] and hence #math.equation(block: false, alt: "T sub 0 open parenthesis t close parenthesis equals 1")[$T_(0) ( t ) = 1$]. Our building-block solutions will be #math.equation(block: true, alt: "u sub n open parenthesis x , t close parenthesis equals X sub n open parenthesis x close parenthesis T sub n open parenthesis t close parenthesis equals cos open parenthesis the fraction n π over L x close parenthesis e to the power the fraction minus n squared π squared over L squared k t ,")[$u_(n) ( x , t ) = X_(n) ( x ) T_(n) ( t ) = cos ( frac(n π, L) x ) e^(frac(− n^(2) π^(2), L^(2)) k t) ,$] and #math.equation(block: true, alt: "u sub 0 open parenthesis x , t close parenthesis equals 1 .")[$u_(0) ( x , t ) = 1 .$] We note that #math.equation(block: false, alt: "u sub n open parenthesis x , 0 close parenthesis equals cos open parenthesis the fraction n π over L x close parenthesis")[$u_(n) ( x , 0 ) = cos ( frac(n π, L) x )$]. Let us write #math.equation(block: false, alt: "f")[$f$] using the cosine series #math.equation(block: true, alt: "f open parenthesis x close parenthesis equals the fraction a sub 0 over 2 plus ∑ n equals 1 infinity a sub n cos open parenthesis the fraction n π over L x close parenthesis .")[$f ( x ) = frac(a_(0), 2) + ∑_(n = 1)^(∞) a_(n) cos ( frac(n π, L) x ) .$] That is, we find the Fourier series of the even periodic extension of #math.equation(block: false, alt: "f open parenthesis x close parenthesis")[$f ( x )$]. We use superposition to write the solution as #math.equation(block: true, alt: "u open parenthesis x , t close parenthesis equals the fraction a sub 0 over 2 plus ∑ n equals 1 infinity a sub n u sub n open parenthesis x , t close parenthesis equals the fraction a sub 0 over 2 plus ∑ n equals 1 infinity a sub n cos open parenthesis the fraction n π over L x close parenthesis e to the power the fraction minus n squared π squared over L squared k t .")[$u ( x , t ) = frac(a_(0), 2) + ∑_(n = 1)^(∞) a_(n) u_(n) ( x , t ) = frac(a_(0), 2) + ∑_(n = 1)^(∞) a_(n) cos ( frac(n π, L) x ) e^(frac(− n^(2) π^(2), L^(2)) k t) .$] #examplebox("Example 3")[][ Let us try the same equation as before, but for insulated ends. We are solving the following PDE problem #math.equation(block: true, alt: "u sub t equals 0.003 u sub x x ,; u sub x open parenthesis 0 , t close parenthesis equals u sub x open parenthesis 1 , t close parenthesis equals 0 ,; u open parenthesis x , 0 close parenthesis equals 50 x open parenthesis 1 minus x close parenthesis f o r 0 less than x less than 1 .")[$u_(t) = 0.003 u_(x x) , \ u_(x) ( 0 , t ) = u_(x) ( 1 , t ) = 0 , \ u ( x , 0 ) = 50 x ( 1 − x ) " " " " " " " " upright(f) upright(o) upright(r) " " 0 < x < 1 .$] For this problem, we must find the cosine series of #math.equation(block: false, alt: "u open parenthesis x , 0 close parenthesis")[$u ( x , 0 )$]. For #math.equation(block: false, alt: "0 less than x less than 1")[$0 < x < 1$] we have #math.equation(block: true, alt: "50 x open parenthesis 1 minus x close parenthesis equals the fraction 25 over 3 plus ∑ n equals 2 n e v e n infinity open parenthesis the fraction minus 200 over π squared n squared close parenthesis cos open parenthesis n π x close parenthesis .")[$50 x ( 1 − x ) = frac(25, 3) + ∑_(limits(n = 2)_(n " " upright(e) upright(v) upright(e) upright(n)))^(∞) ( frac(− 200, π^(2) n^(2)) ) cos ( n π x ) .$] The calculation is left to the reader. Hence, the solution to the PDE problem, plotted in Figure #math.equation(block: false, alt: "5")[$5$], is given by the series #math.equation(block: true, alt: "u open parenthesis x , t close parenthesis equals the fraction 25 over 3 plus ∑ n equals 2 n e v e n infinity open parenthesis the fraction minus 200 over π squared n squared close parenthesis cos open parenthesis n π x close parenthesis e to the power minus n squared π squared 0.003 t .")[$u ( x , t ) = frac(25, 3) + ∑_(limits(n = 2)_(n " " upright(e) upright(v) upright(e) upright(n)))^(∞) ( frac(− 200, π^(2) n^(2)) ) cos ( n π x ) e^(− n^(2) π^(2) 0.003 t) .$] #figure(figph[Three-dimensional surface of temperature in the insulated wire, x from 0 to 1 and time 0 to 30. The initial arch near 12.5 collapses in about 10 time units, then settles to an almost flat plateau near 8 instead of zero, since no heat escapes.], alt: "Three-dimensional surface of temperature in the insulated wire, x from 0 to 1 and time 0 to 30. The initial arch near 12.5 collapses in about 10 time units, then settles to an almost flat plateau near 8 instead of zero, since no heat escapes.", caption: [Figure #math.equation(block: false, alt: "5")[$5$]: Plot of the temperature of the insulated wire at position #math.equation(block: false, alt: "x")[$x$] at time #math.equation(block: false, alt: "t")[$t$].]) Note in the graph that the temperature evens out across the wire. Eventually, all the terms except the constant die out, and you will be left with a uniform temperature of \\(\\frac{25}{3} \\approx{8.33}\\) along the entire length of the wire. The temperature surface u(x, t) = e^(-0.3 n^2 t) sin(n x) for one term of the series, with time running along the second axis. Drag the mode-number slider: higher modes wiggle faster in x and die out much faster in t - the n^2 in the exponent is why only the low modes survive, and why the temperature evens out. {"camera":{"fov":50,"position":\[5.2,6.8,3.4\],"projection":"perspective","target":\[1.6,2.0,0.1\]},"id":"lebl-heat-mode-surface","metadata":{"alt\_text":"A 3D surface of one heat-equation mode u(x,t) = exp(-0.3 n^2 t) sin(n x), x from 0 to pi across the wire and time t from 0 to 4 along the second axis. At n = 1 a single broad hump decays gently as t grows; raising the mode-number slider n makes the surface ripple faster in x and collapse toward zero much sooner in t, because the decay rate grows like n squared."},"objects":\[{"id":"lebl-heat-mode-surface-p-a","kind":"parameter","label":{"text":"mode number n","visible":true},"max":5,"min":1,"name":"a","step":1,"value":1,"visible":true},{"expression":"exp(-0.3\*a\*a\*y)\*sin(a\*x)","id":"lebl-heat-mode-surface-s","kind":"explicit-surface","label":{"text":"u(x,t), t along the y-axis","visible":true},"resolution":96,"style":{"colormap":"viridis","doubleSided":true,"opacity":1,"wireframe":false,"wireframeColor":"\#000000"},"visible":true,"xDomain":\[0,3.14159\],"yDomain":\[0,4\]}\],"title":"Heat equation mode: u(x,t) = e^(-0.3 n^2 t) sin(n x)","version":1} ] Let us expand on the last point. The constant term in the series is #math.equation(block: true, alt: "the fraction a sub 0 over 2 equals the fraction 1 over L ∫ 0 L f open parenthesis x close parenthesis d x .")[$frac(a_(0), 2) = frac(1, L) ∫_(0)^(L) f ( x ) d x .$] In other words, #math.equation(block: false, alt: "the fraction a sub 0 over 2")[$frac(a_(0), 2)$] is the average value of #math.equation(block: false, alt: "f open parenthesis x close parenthesis")[$f ( x )$], that is, the average of the initial temperature. As the wire is insulated everywhere, no heat can get out, no heat can get in. So the temperature tries to distribute evenly over time, and the average temperature must always be the same, in particular it is always #math.equation(block: false, alt: "the fraction a sub 0 over 2")[$frac(a_(0), 2)$]. As time goes to infinity, the temperature goes to the constant #math.equation(block: false, alt: "the fraction a sub 0 over 2")[$frac(a_(0), 2)$] everywhere.