Originally Posted by

**scherz0** Dear all,

I'm having some trouble with the following question involving modelling with a first-order differential equation. My solution is below but it differs from the given answer. I also can't see where I might have erred.

Thank you.

----

18. Consider an insulated box (a building, perhaps) with internal temperature $\displaystyle u(t)$. According to Newton's law of cooling, $\displaystyle u$ satisfies the differential equation

$\displaystyle \cfrac{du}{dt} = -k[u - T(t)]$,

where $\displaystyle T(t)$ is the external temperature. Suppose that $\displaystyle T(t)$ varies sinusoidally; assume that $\displaystyle T(t) = T_0 + T_1cos(wt)$

a) Solve the differential equation above and express $\displaystyle u(t)$ in terms of $\displaystyle t,k,T_0,T_1, w$.

__My solution:__

The above ODE is a linear equation. Rearrangement gives:

$\displaystyle \cfrac{du}{dt} + ku = k(T_0 + T_1\cos{wt})$.

This linear ODE has integrating factor $\displaystyle e^{\int k dt} = e^{kt} $.

Therefore, $\displaystyle \frac{d}{dt}(e^{kt}u) = e^{kt}k(T_0 + T_1\cos{wt}) $

$\displaystyle \Rightarrow (e^{kt}u)=k(\int T_0e^{kt} dt + \int T_1\cos{wt} dt) $