1.4. DERIVATION OF THE EQUATION 25

1.4 Derivation of the 1.4.1 Goal The derivation of the heat equation is based on a more general principle called the conservation law. It is also based on several other experimental laws of . We will derive the equation which corresponds to the conservation law. Then, we will state and explain the various relevant experimental laws of physics. Finally, we will derive the one dimensional heat equation.

1.4.2 Derivation of the Conservation Law Many PDE models involve the study of how a certain quantity changes with and space. This change follows a basic law called the conservation law. Simply put, this law says that the rate at which a quantity changes in a given domain must equal the rate at which the quantity flows across the boundary of that domain plus the rate at which the quantity is created or destroyed, inside the domain. For example, consider the study of the population of a certain animal species within a fixed geographic area (our domain). The population in this geographic area will be determined by how many animals are born, how many die, how many migrate in and out. The conservation law applied to this example says that the rate of change of the animal population is equal to the rate at which animals migrate in the region minus the rate at which they migrate out plus the birth rate minus the death rate. Similar statements can be made about many other quantities such as heat , the of a chemical, the number of automobiles on a freeway, ... Now, we transform such a statement into equations, that is we quantify it. For this, let u (x, t) denote the density of a certain quantity (mass, energy, species, ...). Recall that density is measured in amount of quantity per unit volume or per unit length. So that if we know the density of the quantity and the volume of the region where it is contained, then we also know the amount of the quantity. Let us assume for now that any variation in the density be restricted to one spatial we will call x. That is, we assume a one- dimensional domain, each cross section being labeled by the spatial variable x. Figure 1.3 illustrates this idea in the case of a tube as our domain. It’s cross- sectional area is called A. We assume that the lateral sides are insulated so that the quantity being studied only varies in the x-direction and in time. For each value of x, u (x, t) does not vary within the cross section at x. Remark 40 Let us make some remarks and introduce further notation: 1. The domain described here has a constant cross-sectional area A. In a more complex domain, the cross-sectional area might depend on x (see problems). 2. The amount of the quantity at time t in a small section of width dx will be u (x, t) Adx for each x. It follows that the amount of the quantity in an arbitrary section a x b will be b u (x, t) Adx. ≤ ≤ a R 26CHAPTER 1. INTRODUCTION TO PDES: NOTATION, TERMINOLOGY AND KEY CONCEPTS

Figure 1.3: Tube with cross-sectional area A

3. Let φ = φ (x, t) denote the fluxof the quantity at x, at time t. It measures the amount of the quantity crossing the section at x, at time t. Its units are amount of quantity per unit area, per unit time. So, the actual amount of the quantity crossing the section at x, at time t is given by Aφ (x, t). By convention, flux is positive if the flow is to the right, and negative if the flow is to the left. 4. Let f (x, t) be the given rate at which the quantity is created or destroyed per unit volume within the section at x, at time t. It is measured in amount of quantity per unit volume, per unit time. f is called a source if it is positive and a sink if it is negative. So, the amount of the quantity being created in a small section of width dx for each x is f (x, t) Adx per unit time. It follows that the amount of the quantity being created in an arbitrary section a x b will be b f (x, t) Adx. ≤ ≤ a We are now ready to formulate the conservationR law in a small section of the tube, of area A for each x such that a x b. The conservation law says that the rate of change of the amount of the≤ quantity≤ in that section must be equal to the rate at which the quantity flows in at x = a minus the rate at which it flows out at b plus the rate at which it is created within the section a x b. Using the remarks and notation above, the law becomes ≤ ≤

d b b u (x, t) Adx = Aφ (a, t) Aφ (b, t) + f (x, t) Adx (1.12) dt − Za Za Let us first notice that since A is a constant, it can be taken out of the integrals and canceled from the formula to obtain

d b b u (x, t) dx = φ (a, t) φ (b, t) + f (x, t) dx (1.13) dt − Za Za This equation is the fundamental conservation law. It simply indicates a balance between how much goes in, how much goes out and how much is changed. 1.4. DERIVATION OF THE HEAT EQUATION 27

Equation 1.12 is an integral equation. We can reformulate it as a PDE if we make further assumptions. We begin by reminding the reader of a theorem known as Leibniz rule, also known as "differentiating under the integral".

Theorem 41 (Leibniz Rule) If a (t), b (t), and F (x, t) are continuously dif- ferentiable then

d b(t) b(t) F (y, t) dy = Ft (y, t) dy + F (b (t) , t) b0 (t) F (a (t) , t) a0 (t) dt − Za(t) Za(t) (1.14) This is often known as "taking the inside the integral".

If we assume that u has continuous partial , then using Leibniz rule, the left side of equation 1.13 becomes

d b b u (x, t) dx = u (x, t) dx dt t Za Za If we also assume that φ has continuous partial derivatives, then using the fundamental theorem of calculus, we can write

b φ (a, t) φ (b, t) = φ (x, t) dx − − x Za Therefore, equation 1.13 can be rewritten

b [ut (x, t) + φ (x, t) f (x, t)] dx = 0 x − Za It is possible for an integral to be 0 without the integrand being equal to 0. However, in our case, the interval of integration was arbitrary. In other words, we are saying that no matter what a and b are, this integral must be 0. Since the integrand is continuous, it follows (see problems at the end of the section) that it must be 0 in other words

ut (x, t) + φ (x, t) f (x, t) = 0 x − or ut (x, t) + φx (x, t) = f (x, t) (1.15) It is important to remember that this equation was obtained under the assump- tion that u and φ are continuously differentiable. Equation 1.15 will be called the fundamental conservation law.

Summary 42 We study how a certain quantity changes with time in a given region. We make the following assumptions:

1. u (x, t) denotes the density of the quantity being studied. u is assumed to be continuously differentiable. 28CHAPTER 1. INTRODUCTION TO PDES: NOTATION, TERMINOLOGY AND KEY CONCEPTS

2. φ (x, t) is the flux of the quantity at time t at x. It measures the amount of the quantity crossing a cross section of our region at x. φ is assumed to be continuously differentiable. 3. f (x, t) is the rate at which the quantity is created or destroyed within our region. f is assumed to be continuous. 4. We assume the quantity being studied only varies in the x direction. 5. Then, the equation describing how our quantity changes with time in the given region is ut (x, t) + φx (x, t) = f (x, t)

Remark 43 Let us make a few remarks before looking a specific examples.

1. Equation 1.15 is often written as

ut + φx = f

for simplicity. 2. The functions φ and f are functions of x and t. That dependence may be through the u. For example, we may have f = f (u). Similarly, we may have φ = φ (u). These dependencies may lead to a nonlinear model. We will see one in the examples. 3. Equation 1.15 involves two unknown functions: u and φ, usually the source f is assumed to be given. This means that another equation relating u and φ is needed. Such an equation usually arises from physical assumptions on the medium. We will see various examples below. 4. Equation 1.15 is in its most general form. As we look at specific models, it will take on different forms. For example, when we talked about flow in this section, we did not specify how the quantity traveled. In the next sections we will consider various possibilities including advection and diffusion. Also, the source term can take on different forms.

We now look at specific examples. Here, we will simply write down the equation corresponding to the model. We will discuss how to solve them a little later.

1.4.3 Advection Equation Advection refers to transport of a certain substance in a fluid(water, any liquid, air, ...). An example of advection is transport of a pollutant in a river. The flow of the river carries the pollutant. A model where the fluxis proportional to the density is called an advection model. It is easy to understand why. Thinking of the example of the river carrying a pollutant, the amount of pollutant which crosses the boundary of a 1.4. DERIVATION OF THE HEAT EQUATION 29 given region in the river clearly depends on the density of the pollutant. In this case, we have for some constant c:

φ = cu

The constant c is the speed of the fluid. In our example above, it will be how fast the river flows. Equation 1.15 becomes:

ut + cux = f (x, t)

We look at specific examples.

Advection When f (x, t) = 0 (No Source) In the absence of sources, Equation 1.15 becomes:

ut + cux = 0 (1.16)

Equation 1.16 is called the advection equation. Note that c must have a velocity units (length per time). As noted above, c is the speed at which the fluid is flowing.

Example: Advection and Decay Recall from elementary differential equations that decay is modeled by the law

du = λu dt − where λ is the decay rate. For example, a substance advecting through a tube at velocity c, and decaying at a rate of decay λ would be modeled by the advection- decay equation ut + cux = λu (1.17) − Here, λu corresponds to the source term (the function f in equation 1.15). − General Advection equation In its most general form, the advection equation is

ut + cux + au = f (x, t) (1.18) where:

a and c are constants. •

cux is the term which corresponds to the flux. Recall, in the advection • model, the flux φ is φ = cu, c being the speed of the flow of the fluid in the advection model. 30CHAPTER 1. INTRODUCTION TO PDES: NOTATION, TERMINOLOGY AND KEY CONCEPTS

au and f (x, t) correspond to the source. au says that the rate of change of • the quantity within the domain is proportional to the quantity. Examples include radioactive decay, population growth. f (x, t) says that the rate of change of the quantity within the domain is some given function. An example of this would be pollutants flowing in a river, some pollutants being dumped within the domain. f (x, t) would give the rate at which the pollutant is being dumped.

Example 44 If the equation is ut +cux +au = f (x, t), then it means that there is advection (cux), decay or growth (au) as well as quantity being added at a rate given by f (x, y).

Example 45 If the equation is ut + cux + au = 0, then it means that there is advection and growth or decay.

Example 46 If the equation is ut + cux = 0, then then it means that there is only advection.

1.4.4 Diffusion In the previous model, advection, the flow of the quantity being studied was caused by the motion of the supporting medium. In the example of a pollutant in a river, the flow of the pollutant is caused by the current of the water in the river. may be the result of other physical phenomena. In this section, we consider another model, diffusion. Diffusion is the transport of a material or chemical by molecular motion. Molecules of a substance exhibit microscopic erratic motions due to being randomly struck by other molecules of that substance, or other substances also present. As a result, individual particles or molecules will follow paths sometimes known as "random walks". This is possible because whether a substance is in the gas state, the fluid state or the solid state, its molecules can have some motion with respect to one another. In the case of a gas, individual molecules can move freely with respect to one another. In the case of a liquid, the bonds between molecules are weak and molecules can have a wide range of motion with respect to one another. For solids, the bonds between molecules are stronger, but they can still vibrate with respect to one another. The important point is that molecules can exhibit some motion with respect to one another. If the substance is in a steady state, all the molecules move or vibrate at the same rate, there is equilibrium. If for some reason, some molecules of a substance move at a higher speed, then they will strike other molecules and cause them to move faster. These molecules will in turn strike other molecules and cause them to move faster. This will create a flow. The flow is always from the molecules which move at higher speed to the ones which move at lower speed. This phenomenon can be observed in the following experiment. Consider a box separated in two halves with a membrane. Both halves contain the same gas. In one half, the molecules are much more agitated than in the other half. If we remove the membrane, the more agitated molecules will strike the less agitated 1.4. DERIVATION OF THE HEAT EQUATION 31 ones and cause them to move faster. After a while, an equilibrium will be reached. To model this random motion, we make two observations. The first one was already mentioned above: flow is always from more agitated molecules (higher kinetic energy) to less agitated molecules. Since the agitation of molecules is related to the temperature of the substance as well as the density of the substance, the greater the temperature or density, the greater the agitation. This leads to the second observation. The steeper the density gradient of the substance being studied, the greater the flow. In other words, the flux, which measures the speed of the flow, will be proportional to the gradient of the concentration of the substance being studied. In one dimension, where there is only one spatial variable, the gradient is simply the first derivative with respect to the spatial variable. Thus we can write

φ (x, t) = Dux − Where D > 0 is a constant of proportionality. It is called the diffusion con- stant. u is the density of the quantity being studied. We see that if ux > 0, that is the density increases from left to right, the the flow should be from right to left, that is will be negative. If ux < 0, that is the density decreases from right to left, then the flux will be from left to right, thus will be positive. If we use this expression for φ in equation 1.15, then we get

ut Duxx = f (x, t) − For now, we will focus on the diffusion process only and assume there is no sources, that is f (x, t) = 0. Thus, we obtain the general diffusion equation

ut Duxx = 0 (1.19) − Equation 1.19 is known as Fick’slaw.

1.4.5 Diffusion and Other Models Again, we start with the conservation law

ut + φx = f (x, t) 1. If both diffusion and advection are present and there are no sources, then the flux is given by φ = cu Dux − Thus, the conservation law becomes

ut + cux Duxx = 0 (1.20) − This is the advection-diffusion equation. This equation could govern the density of a pollutant in a river. Advection would be caused by the flow of the river with speed c. As the pollutant is flowing, it would also diffuse according to Fick’slaw. 32CHAPTER 1. INTRODUCTION TO PDES: NOTATION, TERMINOLOGY AND KEY CONCEPTS

2. In the above example, if the pollutant also decays at rate λ > 0, then f (x, t) = λu and the equation governing this model becomes − ut + cux Duxx = λu (1.21) − − This is the advection-diffusion-decay equation.

1.4.6 Heat Equation With Only Diffusion Present We now apply equation 1.19 to the study of heat flow. Heat can flow according to the diffusion model. The warmer a substance is, the more agitated its molecules are. If we consider a rod and assume that one part of the rod is warmer, then the molecules of that warmer part will be more agitated. As they strike surrounding molecules, they will cause these molecules to be more agitated thus the heat will spread. This is diffusion. Let us introduce some notation. Consider a thin rod having a constant density ρ and specific heat C. The specific heat of a substance is the amount of energy needed to raise the temperature of a unit mass of the substance by one degree. Both ρ and C are known for known substances, they can be found in and physics handbooks. If u (x, t) is the energy density and θ the temperature, then u (x, t) = ρCθ (x, t) If we apply the conservation law with no sources (equation 1.15), we obtain

ρCθt + φx = 0 Because of heat flow follows a diffusion model,

φ = Kθx − where K is the , another constant which can be found for each known substance in engineering and physics handbooks. This is known as Fourier’sheat law. This, combining these two equations gives

ρCθt Kθxx = 0 (1.22) − or θt kθxx = 0 (1.23) − K where k = , it is called the diffusivity or thermal diffusivity. This is ρC known as the heat equation. It is the same equation you were given earlier. Now, we have derived it using the conservation law. Remark 47 In deriving this equation, we made some assumptions about the rod. These assumptions lead us to assume that ρ and C and K were constants. If the rod is not homogeneous, K will also depend on x. In addition, if we consider wide ranges of temperatures, K may also depend on θ. So, equation 1.22 would become ρCθt (K (x, θ) θx) = 0 (1.24) − x This is a non-linear model. 1.4. DERIVATION OF THE HEAT EQUATION 33

1.4.7 Steady State Solution Many PDE models, in particular diffusion problems, have the property that after a long time, they approach a steady state, that is a solution which is no longer evolving with time. In other words, for large t, u (x, t) becomes a function of x only and ut = 0. Even if we do not yet know how to solve PDEs, we can, in most cases, find the steady state solution. To do so, we set ut = 0 in the diffusion equation. The resulting equation is a second-order linear ODE, which we know how to solve. Remember that the solution should be a function of x only. The examples below illustrate how.

PDE ut = cuxx 0 < x < L 0 < t < ∞ BC1 u (0, t) = T1 0 < t < Example 48 Find the steady state solution for the problem  ∞ .  BC2 u (L, t) = T2 0 < t <  IC u (x, 0) = f (x) 0 x ∞L ≤ ≤ The steady state solution is reached when ut = 0. Thus, we solve  uxx = 0

The steady state solution is u (x) = ax + b for some constant a and b which can be determined from the boundary conditions. We know that u (0, t) = T1 and u (L, t) = T2 for all t > 0, then it follows for the steady state solution that

u (0, t) = a (0) + b = T1

So, b = T1 And

u (L, t) = aL + b

= aL + T1

= T2

So aL + T1 = T2 Thus T2 T1 a = − L Therefore, the steady state solution is

T2 T1 u (x) = − x + T L 1 1.4.8 Problems 1. How does the conservation law in equation 1.15 change if the tube has variable cross-sectional area A = A (x) instead of a constant one? 34CHAPTER 1. INTRODUCTION TO PDES: NOTATION, TERMINOLOGY AND KEY CONCEPTS

2. Show that the diffusion-advection-decay equation

ut Duxx + cux = λu − − can be transformed into the diffusion equation by the transformation c c2 u (x, t) = w (x, t) eαx βt where α = and β = λ + . − 2D 4D 3. Let u = u (x, t) satisfy the PDE model

ut = kuxx 0 < x < L, t > 0 u (0, t) = u (L, t) = 0 t > 0  u (x, 0) = u0 (x) 0 x L  ≤ ≤ (a) Find the steady-state solution. L 2 L 2 L 2 (b) Show that u (x, t) dx u0 (x) dx.(hint: Let E (t) = u (x, t) dx 0 ≤ 0 0 and show that E0 (t) 0). What can be said of u (x, t) if u0 (x) = 0? R ≤ R R 4. Consider an initial value problem for the diffusion-decay equation

ut Duxx + ru = 0 0 < x < L, t > 0 − u (0, t) = 0, Dux (L, t) = 1 t > 0  − −  u (x, 0) = g (x) 0 < x < L Find the steady-state solution. 5. Heat flow in a metal rod with an internal heat source is given by

ut kuxx = 1 0 < x < 1, t > 0 u (0, t)− = 0, u (1, t) = 1 t > 0  Find the steady state. Does it matter that no initial condition is given? 6. In the derivation of the conservation law equation, we used the fact that b if f is a continuous function and if a f (x) dx = 0 for any a and b then we must have f (x) = 0 for any x. Prove this result. Hint: do it by contradiction. Assume that for someR number c, f (c) = 0 and use the properties of continuous functions as well as integrals. 6