# Thread: 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 $\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 \dfrac{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 \dfrac{d}{dt}(e^{kt}u) = e^{kt}k(T_0 + T_1\cos{wt})$

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

$\displaystyle \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 $\displaystyle k$.

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

However, the given answer is: $\displaystyle 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 $\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)$
This step is incorrect. The exponential multiplies the trig function integral as well.

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

However, the given answer is: $\displaystyle 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.

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

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

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

Therefore $\displaystyle (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 $\displaystyle k$.

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

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

8. Originally Posted by scherz0
$\displaystyle \Rightarrow (e^{kt}u)=k\left(\int T_0e^{kt} dt + \int T_1\cos{wt} dt \right)$
$\displaystyle \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 $\displaystyle e^{kt}$ into your second integrand. Carry that correction through and see what happens.