# Math Help - Model with First Order Differential Equation

1. ## Model with First Order Differential Equation

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 $u(t)$. According to Newton's law of cooling, $u$ satisfies the differential equation

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

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

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

My solution:

The above ODE is a linear equation. Rearrangement gives:
$\dfrac{du}{dt} + ku = k(T_0 + T_1\cos{wt})$.

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

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

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

$\Rightarrow (e^{kt}u)=k\left(T_0\frac{e^{kt}}{k} + T_1\frac{\sin{wt}}{w} \right)$ + C, where C has absorbed the product of integration constants from both integrals with $k$.

$\Rightarrow u = T_0 - T_1\dfrac{k\sin{wt}}{we^{kt}} + Ce^{-kt}$.

However, the given answer is: $u(t) = ce^{-kt} + T_0 + \frac{kT_1}{k^2 + w^2}(k\cos{wt} + w\sin{wt})$

2. 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 $u(t)$. According to Newton's law of cooling, $u$ satisfies the differential equation

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

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

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

My solution:

The above ODE is a linear equation. Rearrangement gives:
$\cfrac{du}{dt} + ku = k(T_0 + T_1\cos{wt})$.
This linear ODE has integrating factor $e^{\int k dt} = e^{kt}$.
Therefore, $\frac{d}{dt}(e^{kt}u) = e^{kt}k(T_0 + T_1\cos{wt})$
$\Rightarrow (e^{kt}u)=k(\int T_0e^{kt} dt + \int T_1\cos{wt} dt)$
This step is incorrect. The exponential multiplies the trig function integral as well.

$\Rightarrow u = T_0e^{kt} - T_1\frac{\sin{wt}}{wk}$.

However, the given answer is: $u(t) = ce^{-kt} + T_0 + \frac{kT_1}{k^2 + w^2}(k\cos{wt} + w\sin{wt})$

3. Thanks for your reply, ackbeet. I've since corrected my solution, but it still differs from the given answer.

5. Thanks for your reply, ackbeet. I've shown my integral evaluations. But I still don't understand the difference between my solution and the given answer.

6. Originally Posted by scherz0
Thanks for your reply, ackbeet. I've shown my integral evaluations. But I still don't understand the difference between my solution and the given answer.
If you edited the OP as "showing your integral evaluations", I still don't buy your calculations. You're still not doing what I suggested in Post # 2. Please do NOT edit your OP again. Post your workings in a new post in this thread.

You earlier requested that I show how I evaluate the integrals. Here it is below.

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

$\Rightarrow (e^{kt}u)=k\left(T_0 \int e^{kt} dt + T_1 \int \cos{wt} dt \right)$, where $T_0, T_1$ are constants.

Since $\int e^{kt} dt = \frac{e^{kt}}{k}$ and $\int \cos{wt} dt = \frac{sin {wt}}{w}$

Therefore $(e^{kt}u)=k\left(T_0\frac{e^{kt}}{k} + T_1\frac{\sin{wt}}{w} \right)$ + C, where C has absorbed the product of integration constants from both integrals with $k$.

$\Rightarrow u = T_0 - T_1\dfrac{k\sin{wt}}{we^{kt}} + Ce^{-kt}$.

However, the given answer is: $u(t) = ce^{-kt} + T_0 + \frac{kT_1}{k^2 + w^2}(k\cos{wt} + w\sin{wt})$

8. Originally Posted by scherz0
$\Rightarrow (e^{kt}u)=k\left(\int T_0e^{kt} dt + \int T_1\cos{wt} dt \right)$
$\Rightarrow (e^{kt}u)=k\left(\int T_0 e^{kt}\,dt + \int T_1 e^{kt}\cos(wt)\, dt \right).$
You failed to distribute the exponential $e^{kt}$ into your second integrand. Carry that correction through and see what happens.