Subsection 7.3.1 One Dimensional Equation of Heat Flow
The one-dimensional heat equation describes the flow of heat in a medium along a single spatial dimension. It is a partial differential equation that relates the rate of change of temperature with respect to time to the second derivative of temperature with respect to the spatial coordinate. The general form of the one-dimensional heat equation is given in (7.3.8). where \(u(x, t)\) represents the temperature at position x and time t, \(h^2\) is the thermal diffusivity (a material-specific constant), and \(\frac{\partial}{\partial t} \) and \(\frac{\partial^2}{\partial x^2}\) denote the partial derivatives with respect to time and space, respectively. This equation describes how the temperature at a given point changes over time due to the heat flow and diffusion within the medium. The second derivative term on the right-hand side accounts for the spatial variations in temperature, while the left-hand side represents the rate of change of temperature with respect to time.
Solving the one-dimensional heat equation involves finding the temperature distribution \(u(x, t)\) as a function of both position and time, given the initial condition \(u(x, 0)\) and appropriate boundary conditions that specify the temperature at the boundaries of the medium. The solution to the one-dimensional heat equation can be obtained using various analytical or numerical methods, such as separation of variables, finite difference methods, or Fourier series expansion, depending on the specific problem and boundary conditions.
Subsubsection 7.3.1.1 If ends of a bar are at temperature zero
Consider a bar of uniform cross section of length \(\lambda\) whose both ends are maintained at temperature zero, and the initial temperature to be given as \(f(x)\) as shown in figure Figure 7.3.2. If one end of the bar is fixed at the origin and distances along the bar are denoted by \(x\text{,}\) then we have
\begin{equation}
\frac{\partial u}{\partial t} =h^{2}\frac{\partial^{2}u}{\partial x^{2}} \tag{7.3.10}
\end{equation}

The boundary conditions are \(u(0,t)=0=u(\lambda,t) \) for \(t\geq 0 \) and the initial condition \(u(x,0) =f(x)\) for \(0 \lt x \lt \lambda\text{.}\) Let us assume that
\begin{equation}
u(x,t) = X(x)T(t)\tag{7.3.11}
\end{equation}
\begin{equation}
\frac{1}{X}\frac{\partial^{2}X}{\partial x^{2}} =\frac{1}{h^{2}T}\frac{\partial T}{\partial t} =-\lambda^{2} \quad \text{(say)}\tag{7.3.12}
\end{equation}
or,
\begin{equation*}
\frac{1}{h^{2}T}\frac{\partial T}{\partial t}= -\lambda^{2} \Rightarrow T =Ce^{-\lambda^{2}h^{2}t}
\end{equation*}
and
\begin{equation*}
\frac{1}{X}\frac{\partial^{2}X}{\partial x^{2}} = -\lambda^{2} \Rightarrow X=A\cos\lambda x+B\sin\lambda x
\end{equation*}
Therefore, solution (7.3.11) becomes
\begin{equation}
u(x,t) = (A\cos\lambda x+B\sin\lambda x)Ce^{-\lambda^{2}h^{2}t}\tag{7.3.13}
\end{equation}
But,
\begin{equation*}
u(0,t)=0=A\cdot Ce^{-\lambda^{2}h^{2}t} \Rightarrow A=0 \quad \because C \neq 0
\end{equation*}
again,
\begin{equation*}
u(\lambda,t) =0= B\sin\lambda \lambda)Ce^{-\lambda^{2}h^{2}t}
\end{equation*}
As \(B\) should not be zero, \(\sin\lambda \lambda =0 =\sin n\pi\text{.}\) Or,
\begin{equation*}
\lambda = \frac{n\pi}{\lambda}, \quad n=1,2,3,\cdots
\end{equation*}
\begin{equation*}
u(x,t)=B\sin\frac{n\pi x}{\lambda} Ce^{-n^{2}\pi^{2}h^{2}t/\lambda^{2}} = A_{n}\sin\frac{n\pi x}{\lambda}e^{-n^{2}\pi^{2}h^{2}t/\lambda^{2}}
\end{equation*}
put \([BC=A_{n}].\)
summing over for all values of \(n\text{,}\) this eqn. becomes
\begin{equation}
u(x,t) = \sum\limits_{n=1}^{\infty} A_{n}\sin\frac{n\pi x}{\lambda}e^{-n^{2}\pi^{2}h^{2}t/\lambda^{2}} \tag{7.3.14}
\end{equation}
also, \(u(x,0) =f(x),\) we have
\begin{equation}
f(x) = \sum\limits_{n=1}^{\infty} A_{n}\sin\frac{n\pi x}{\lambda}\tag{7.3.15}
\end{equation}
which is Fourier sine series with
\begin{equation}
A_{n} = \frac{2}{\lambda}\int\limits_{0}^{\lambda}f(x)\sin\frac{n\pi x}{l}\,dx \tag{7.3.16}
\end{equation}
Subsubsection 7.3.1.2 If ends of the bar are insulated
The boundary conditions of the problem are \(\frac{\partial u}{\partial x}=0 \) at \(x=0\) and \(\lambda\) [for \(t\geq 0 \)]. and \(u=f(x)\) at \(t=0\) [for \(0 \lt x \lt \lambda\)]. Then solution of equation (7.3.10) becomes
\begin{equation}
u=(A\cos\lambda x+B\sin\lambda x)Ce^{-\lambda^{2}h^{2}t}\tag{7.3.17}
\end{equation}
or,
\begin{equation}
\frac{\partial u}{\partial x}=\left(-A\lambda\sin\lambda x+ B\lambda\cos\lambda x\right)Ce^{-\lambda^{2}h^{2}t} \tag{7.3.18}
\end{equation}
\begin{equation*}
0=B\lambda Ce^{-\lambda^{2}h^{2}t}
\end{equation*}
or, \(B=0 \text{,}\) since, \(C\neq 0{,} \lambda \neq 0\text{.}\) Therefore, equation (7.3.17) becomes
\begin{equation}
u=A\cos\lambda x\cdot Ce^{-\lambda^{2}h^{2}t}\tag{7.3.19}
\end{equation}
or,
\begin{equation}
\frac{\partial u}{\partial x}=-A\lambda\sin\lambda x\cdot Ce^{-\lambda^{2}h^{2}t} \tag{7.3.20}
\end{equation}
\begin{equation*}
0=-AC\lambda\sin\lambda\lambda e^{-\lambda^{2}h^{2}t}
\end{equation*}
or,
\begin{equation*}
\sin\lambda\lambda =0 =\sin n\pi \quad [\text{since,}\quad A, C \neq 0 ]
\end{equation*}
or,
\begin{equation*}
\lambda = \frac{n\pi}{\lambda},
\end{equation*}
where \(n=1,2,3,\cdots\text{.}\) Hence the general solution of equation (7.3.10) becomes -
\begin{equation*}
u=AC\cos\frac{n\pi x}{\lambda}e^{-n^{2}\pi^{2}h^{2}t/\lambda^{2}} =B_{n}e^{-n^{2}\pi^{2}h^{2}t/\lambda^{2}} \cos\frac{n\pi x}{\lambda}
\end{equation*}
put \(AC= B_{n} \text{.}\)] However, for the given boundary conditions the above solution satisfies all the values of \(n\) including zero. Hence the solution of equation (7.3.10) is given by
\begin{equation}
u=B_{o}+\sum\limits_{n=1}^{\infty}B_{n}e^{-n^{2}\pi^{2}h^{2}t/\lambda^{2}} \cos\frac{n\pi x}{\lambda}\tag{7.3.21}
\end{equation}
Now,
\begin{equation}
f(x) = u(x,0) = B_{o}+\sum\limits_{n=1}^{\infty} B_{n} \cos\frac{n\pi x}{\lambda}\tag{7.3.22}
\end{equation}
from which we can find,
\begin{equation}
B_{n}=\frac{2}{\lambda}\int\limits_{0}^{\lambda}f(x)\cos\frac{n\pi x}{\lambda}\,dx\tag{7.3.23}
\end{equation}
and
\begin{equation}
B_{o}=\frac{1}{\lambda}\int\limits_{0}^{\lambda}f(x)\,dx\tag{7.3.24}
\end{equation}
Subsubsection 7.3.1.3 If one end of a bar at temperature \(u_{o}\) and the other at temperature zero
Suppose the bar is given the constant temperature \(f(x)\) initially and face \(x=0\) is kept at temperature zero, while the face \(x=\lambda\) is kept at constatn temperature \(u_{o}\) for \(t \gt 0\text{,}\) then the boundary conditions of the problem becomes
\begin{equation}
\left.\begin{aligned}
u(0,t) = 0\\
u(\lambda,t) = u_{o}
\end{aligned}\right\} \text{for all}\quad t\tag{7.3.25}
\end{equation}
and
\begin{equation}
u(x,0)=f(x) \quad (say)\tag{7.3.26}
\end{equation}
The equation of heat flow is given by
\begin{equation}
\frac{\partial u}{\partial t} =h^{2}\frac{\partial^{2}u}{\partial x^{2}} \tag{7.3.27}
\end{equation}
Let the solution of equation (7.3.27) be
\begin{equation}
u(x,t) = X(x)T(t)\tag{7.3.28}
\end{equation}
or,
\begin{equation*}
\frac{\partial u}{\partial t} =X\frac{\partial T}{\partial t}
\end{equation*}
and
\begin{equation*}
\frac{\partial^{2}u}{\partial x^{2}}=T\frac{\partial^{2}X}{\partial x^{2}}
\end{equation*}
Substituting these in equation (7.3.27), we get -
\begin{equation}
\frac{1}{X}\frac{\partial^{2}X}{\partial x^{2}} =\frac{1}{h^{2}T}\frac{\partial T}{\partial t} =-\alpha^{2} \quad (say)\tag{7.3.29}
\end{equation}
Hence,
\begin{equation}
\frac{\partial T}{\partial t} =-\alpha^{2}h^{2}T \quad \Rightarrow T =Ae^{-\alpha^{2}h^{2}t} \tag{7.3.30}
\end{equation}
and
\begin{equation}
\frac{\partial^{2}X}{\partial x^{2}} = -\alpha^{2}X\tag{7.3.31}
\end{equation}
or,
\begin{equation}
\frac{\partial^{2}X}{\partial x^{2}} + \alpha^{2}X = 0 \quad \Rightarrow X=B\cos\alpha x+C\sin\alpha x\tag{7.3.32}
\end{equation}
Hence,
\begin{equation}
u(x,t)=(a\cos\alpha x+b\sin\alpha x)e^{-\alpha^{2}h^{2}t}\tag{7.3.33}
\end{equation}
This solution shows \(u(x,t) \to 0 \) at \(t \to \infty\) for all \(x\) but the boundary condition shows that \(u(x,t) = u_{o} \) at \(x=\lambda\text{,}\) a non - zero constant. Therefore, the solution (7.3.33) though satisfies the boundary condition at \(x=0\) does not satisfy it at \(x=\lambda\text{.}\) Hence we should add one more solution to this solution so that \(u(x,t) \to u_{o} \) at \(x=\lambda\) when \(t \to \infty\) and at the same time it becomes zero at \(x=0\text{.}\) Such solution may be obtained by choosing the constant \(\alpha^{2}\) equal to zero. Then equation (7.3.31) becomes \(T=A\) and equation (7.3.32) reduces to
\begin{equation*}
\frac{\partial^{2}X}{\partial x^{2}}=0 \Rightarrow X=Bx+C.
\end{equation*}
Hence, solution of equation (7.3.27) in this case is given by
\begin{equation}
u(x,t) =A(Bx+C)=a' x+b'\tag{7.3.34}
\end{equation}
The complete solution of equation (7.3.27) is thus -
\begin{equation}
u(x,t)=(a' x+b')+(a\cos\alpha x+b\sin\alpha x)e^{-\alpha^{2}h^{2}t}\tag{7.3.35}
\end{equation}
or,
\begin{equation}
u(x,t)=u_{s}(x)+u_{T}(x,t)\tag{7.3.36}
\end{equation}
where \(u_{s}(x)\) is the temperature distribution after a long interval of time when there exists steady state of temperature and \(u_{T}(x,t)\) is the transient temperature which tends to zero as \(t\) increases. Now, for \(t \to \infty\text{,}\) \(u(0,t)= 0\text{,}\) and \(u(\lambda,t)=u_{o}\) and from equation (7.3.35), we have -
\begin{equation*}
0=b'+0 \quad \therefore b' =0
\end{equation*}
and
\begin{equation*}
u_{o}=a' \lambda
\end{equation*}
\begin{equation}
\therefore a'=u_{o}/\lambda\tag{7.3.37}
\end{equation}
so that \(u_{s}(x)=(u_{o}/\lambda)x \text{.}\) Thus solution (7.3.35) (7.2.1.12) reduces to
\begin{equation}
u(x,t)=\frac{u_{o}x}{\lambda}+(a\cos\alpha x+b\sin\alpha x)e^{-\alpha^{2}h^{2}t}\tag{7.3.38}
\end{equation}
which must be zero at \(x=0\) for every value of \(t\text{.}\) Thus we have \(a=0\text{.}\) and
\begin{equation}
u(x,t)=\frac{u_{o}x}{\lambda}+b\sin\alpha x \,e^{-\alpha^{2}h^{2}t}\tag{7.3.39}
\end{equation}
which must give \(u(\lambda,t)=u_{o}\) for every \(t\) and hence \(\sin\alpha\lambda =0=\sin n\pi\text{.}\)
Or, \(\alpha =\frac{n\pi}{\lambda}\text{,}\) where \(n=1,2,3,\cdots\text{.}\) Or,
\begin{equation}
u(x,t) = \frac{u_{o}x}{\lambda}+\sum\limits_{n=1}^{\infty} b_{n}\sin\frac{n\pi x}{\lambda} \,e^{-n^{2}\pi^{2}h^{2}t/\lambda}\tag{7.3.40}
\end{equation}
Constant \(b_{n}\) may be calculated by using the initial condition \(u(x,0)=f(x)\text{.}\) Hence,
\begin{equation}
f(x)-\frac{u_{o}x}{\lambda}=\sum\limits_{n=1}^{\infty} b_{n}\sin\frac{n\pi x}{\lambda}\tag{7.3.41}
\end{equation}
and
\begin{equation}
b_{n}=\frac{2}{\lambda}\int\limits_{0}^{\lambda}\left[f(x)-\frac{u_{o}x}{\lambda}\right]\sin\frac{n\pi x}{\lambda}\,dx\tag{7.3.42}
\end{equation}
Subsubsection 7.3.1.4 Temperature in an infinite bar
Let us consider an infinite bar of insulated surfaces. The initial temperature on the bar is given as
\begin{equation}
u(x,0)=f(x), \quad \text{for} \quad -\infty \lt x \lt \infty\tag{7.3.43}
\end{equation}
The solution of one dimensional heat equaiton is given as
\begin{equation}
u(x,t) =X(x)T(t)=(a\cos\alpha x+b\sin \alpha x)e^{-\alpha^{2}h^{2}t}\tag{7.3.44}
\end{equation}
This solution is periodic in \(x\) at \(t=0\text{.}\) But \(f(x)\) is not taken as periodic function, we shall therefore, use Fourier integral instead of Fourier series for the determination of constants \(a\) and \(b\text{.}\) Let us assume the arbitrary coefficients \(a\) and \(b\) to be the functions of \(\alpha\) i.e., \(a=a(\alpha)\) and \(b=b(\alpha)\text{.}\) Then
\begin{equation*}
u(x,t)=\int\limits_{0}^{\infty}u(x,t,\alpha)\,d\alpha
\end{equation*}
\begin{equation}
=\int\limits_{0}^{\infty}\{a(\alpha)\cos\alpha x+b(\alpha)\sin\alpha x\}e^{-\alpha^{2}h^{2}t}\,d\alpha\tag{7.3.45}
\end{equation}
using initial condition, we have -
\begin{equation}
u(x,0) =\int\limits_{0}^{\infty}\{a(\alpha)\cos\alpha x+b(\alpha)\sin\alpha x\}\,d\alpha =f(x)\tag{7.3.46}
\end{equation}
from this equation, we get -
\begin{equation*}
a(\alpha) = \frac{1}{\pi}\int\limits_{-\infty}^{\infty}f(x)\cos\alpha x\,dx=\frac{1}{\pi}\int\limits_{-\infty}^{\infty}f(\mu)\cos\alpha \mu\,d\mu
\end{equation*}
and
\begin{equation*}
b(\alpha) = \frac{1}{\pi}\int\limits_{-\infty}^{\infty}f(x)\sin\alpha x\,dx=\frac{1}{\pi}\int\limits_{-\infty}^{\infty}f(\mu)\sin\alpha \mu\,d\mu
\end{equation*}
so that
\begin{equation*}
u(x,0) = \frac{1}{\pi}\int\limits_{0}^{\infty}\left[\int\limits_{-\infty}^{\infty}f(\mu)\cos\alpha (x-\mu)\,d\mu\right]\,d\alpha
\end{equation*}
as such the equation (7.3.45) takes the form,
\begin{equation*}
u(x,t) = \frac{1}{\pi}\int\limits_{0}^{\infty}\left[\int\limits_{-\infty}^{\infty}f(\mu)\cos\alpha (x-\mu)e^{-\alpha^{2}h^{2}t}\,d\mu\right]\,d\alpha
\end{equation*}
\begin{equation}
=\frac{1}{\pi}\int\limits_{-\infty}^{\infty}f(\mu)\left[\cos\alpha(x-\mu)e^{-\alpha^{2}h^{2}t}\,d\alpha\right]\,d\mu\tag{7.3.47}
\end{equation}
which gives the required temperature at any point at any time.