---
title: Heat conduction problem
tags: ODE
GA: G-77TT93X4N1
---
# Heat conduction problem
> Sec2.3 #14
Consider an insulated box with internal temperature $u(t)$. According to Newton's law of cooling, $u$ satisfies the differential equation
$$
\tag{1}
\frac{du}{dt} = -k (u-T(t)),
$$
where $T(t)$ is the ambient temperature that varies sinusoidally as
$$
\tag{2}
T(t) = T_0 + T_1\cos(\omega t).
$$
## Linearity
Assume $u_0$ and $v$ satisfy
$$
\tag{3}
\frac{du_0}{dt} +k u_0 = 1,
$$
and
$$
\tag{4}
\frac{du_1}{dt} +k u_1 = \cos(\omega t),
$$
respectively, it can be shown easily that
$$
\tag{5}
u = kT_0u_0 + kT_1 u_1
$$
solves equation (1) with $T(t)$ given by (2).
## solution 1: $u_0$
Multiply both side of (3) by integrating factor $e^{kt}$ we have
$$
\tag{6}
\frac{d}{dt} \left(e^{kt} u_0\right) = e^{kt}.
$$
Therefore,
$$
\tag{7}
u_0(t) = \frac{1}{k} + c_0 e^{-kt}.
$$
## solution 2: $u_1$
To solve (4), at first, we introduce a complex-valued function $v$ and assume it satisfies
$$
\tag{8}
\frac{dv}{dt} +k v = e^{i\omega t}.
$$
It is clear that $u_1 = \text{real}(v)$.
We again multiply both side of (8) by integrating factor $e^{kt}$ to have
$$
\tag{9}
\frac{d}{dt} \left(e^{kt} v\right) = e^{(k+i\omega)t}.
$$
Therefore,
$$
\tag{10}
v(t) = \frac{1}{k+i\omega}e^{i\omega t} + c_1 e^{-kt}.
$$
### polar representation
We further introduce polar representation
$$
\tag{11}
1 + i\frac{\omega}{k} = \sqrt{1 + \left(\frac{\omega}{k}\right)^2} \,e^{i\tau}, \quad \tau=\tan^{-1}\left(\frac{\omega}{k}\right),
$$
so that
$$
\tag{12}
v(t) = \frac{1}{k\sqrt{1 + (\omega/k)^2}}e^{i(\omega t-\tau)} + c_1 e^{-kt}.
$$
Finally, we take the real part to have
$$
\tag{13}
u_1(t) = \frac{1}{k\sqrt{1 + (\omega/k)^2}}\cos{(\omega t-\tau)} + c_1 e^{-kt}.
$$
### Cartesian representation
In (10), we can also use Cartesian representation to determine its real part.
Recall that
$$
\tag{14}
\frac{1}{k+i\omega} = \frac{1}{k}\left(\frac{1}{1+i(\omega/k)}\right)\left(\frac{1-i(\omega/k)}{1-i(\omega/k)}\right)=\frac{1}{k}\left(\frac{1-i(\omega/k)}{1 + (\omega/k)^2}\right).
$$
Plugging-in to (10) to have
$$
\tag{15}
v(t) = \frac{1}{k}\left(\frac{1-i(\omega/k)}{1 + (\omega/k)^2}\right)\left(\cos{\omega t}+i\sin{\omega t}\right) + c_1 e^{-kt}.
$$
So the real part gives
$$
\tag{16}
u_1 = \frac{1}{k}\frac{1}{1 + (\omega/k)^2}\left(\cos{\omega t} + (\omega/k)\sin{\omega t}\right).
$$
We can then recall the trigenometric identity
$$
\tag{17}
\cos{\omega t} + (\omega/k)\sin{\omega t} = \sqrt{1 + (\omega/k)^2}\cos(\omega t-\tau), \quad \tau=\tan^{-1}\left(\frac{\omega}{k}\right),
$$
so that (13) is exactly recovered.
---
Combining all the solutions we obtain
$$
\tag{18}
u(t) = T_0 + \frac{T_1}{\sqrt{1 + (\omega/k)^2}}\cos{(\omega t-\tau)} + c e^{-kt}.
$$