7.5. Variation of parameters#
Example: Steady heat diffusion with internal source
We are solving the steady-state heat diffusion equation with an internal source:
where \(\alpha\) is thermal diffusivity, and \(qx \sin x\) is the heat source. The boundary conditions are:
In standard form,
Find homogeneous solution:
(7.8)#\[\begin{align} \alpha T_{\rm h}'' &= 0 \\ \alpha \lambda^2 &= 0 \\ \lambda &= 0 \end{align}\]so,
(7.9)#\[\begin{equation} T_{\rm h} = c_1 + c_2 x \end{equation}\]Find particular solution using variation of parameters:
(7.10)#\[\begin{align} y_1 &= 1, \quad y_2 = x \\ y_1' &= 0, \quad y_2' = 1 \end{align}\]so the Wronskian is \(W = 1 \cdot 1 - 0 \cdot x = 1\). The right-hand side function is
(7.11)#\[\begin{equation} r = -\frac{qx \sin x}{\alpha} \end{equation}\]so the particular solution is:
(7.12)#\[\begin{align} T_{\rm p} &= -1 \int x \left( \frac{-q x \sin x}{\alpha} \right) \, \d{x} + x \int \left( \frac{-q x \sin x}{\alpha} \right) \, \d{x} \\ &= \frac{q}{\alpha} \int x^2 \sin x \, \d{x} - \frac{q}{\alpha} x \int x \sin x \, \d{x} \end{align}\]These integrals can both be evaluated by parts. For the first integral, use the tabular method:
sign
\(u\)
\(\d{v}\)
\(\sin x\)
\(+\)
\(x^2\)
\(-\cos x\)
\(-\)
\(2x\)
\(-\sin x\)
\(+\)
\(2\)
\(\cos x\)
\(0\)
so
(7.13)#\[\begin{equation} \int x^2 \sin x \, \d{x} = -x^2 \cos x + 2x \sin x + 2 \cos x \end{equation}\]For the second integral, use
(7.14)#\[\begin{align} u &= x & \d{v} &= \sin x \d{x} \\ \d{u} &= 1 \d{x} & v &= -\cos{x} \end{align}\]so
(7.15)#\[\begin{equation} \int x \sin x \d{x} = -x \cos x + \int \cos x \d{x} = -x \cos x + \sin x \end{equation}\]Substitute everything back:
(7.16)#\[\begin{align} T_{\rm p} &= \frac{q}{\alpha} \left[ -x^2 \cos x + 2x \sin x + 2 \cos x \right] - \frac{q}{\alpha} x \left[ -x \cos x + \sin x \right] \\ &= \frac{q}{\alpha} [2 \cos x + x \sin x] \end{align}\]Combine and apply boundary conditions.
The general solution is
(7.17)#\[\begin{equation} T = c_1 + c_2 x + \frac{q}{\alpha}(2\cos x + x \sin x) \end{equation}\]The boundary conditions are:
(7.18)#\[\begin{align} T(-1) &= c_1 - c_2 + \frac{q}{\alpha}[2\cos(-1) - \sin(-1)] = 1\\ &= c_1 - c_2 + \frac{q}{\alpha}[2\cos 1 + \sin 1] \\ T(1) &= c_1 + c_2 + \frac{q}{\alpha}[2\cos 1 + \sin 1] = 1 \end{align}\]This is a system of linear equations that can be solved for \(c_1\) and \(c_2\). Subtracting the two equations gives:
(7.19)#\[\begin{equation} 0 = 2 c_2 \end{equation}\]so \(c_2 = 0\). Plugging back in and solving for \(c_1\):
(7.20)#\[\begin{align} 1 &= c_1 + \frac{q}{\alpha}(2\cos 1 + \sin 1) \\ c_1 &= 1 - \frac{q}{\alpha}(2\cos 1 + \sin 1) \end{align}\]
The final result is: