Based on Newtonβs Law of Cooling, we know that the temperature satisfies the differential equation
\begin{equation*}
\frac{dT}{dt} = -k(T - T_s) = -k(T - 20)
\end{equation*}
with initial condition \(T(0) = 50\text{,}\) but we do not know the value of \(k\text{.}\) In order to work this out, we should solve the differential equation with unknown constant \(k\text{,}\) then figure out which value of \(k\) gives us the appropriate temperature after 10 minutes. This is a first order linear equation, which can be rewritten as
\begin{equation*}
T' + kT = 20k.
\end{equation*}
The integrating factor we need is \(e^{kt}\text{,}\) which turns the equation into
\begin{equation*}
(e^{kt}T)' = 20ke^{kt}.
\end{equation*}
Integrating both sides and solving for \(T\) gives
\begin{equation*}
T(t) = 20 + Ce^{-kt}.
\end{equation*}
To satisfy the initial condition, we need that \(T(0) = 50\text{,}\) or \(C = 30\text{.}\) Thus, our solution, still with an unknown constant \(k\text{,}\) is
\begin{equation*}
T(t) = 20 + 30e^{-kt}.
\end{equation*}
To determine the value of \(k\text{,}\) we need to utilize the other given piece of information: that \(T(10) = 40\text{.}\) Plugging this in gives that
\begin{equation*}
40 = 20 + 30e^{-10k}
\end{equation*}
which we can solve for \(k\) using logarithms. This will give that
\begin{equation*}
\frac{2}{3} = e^{-10k} \qquad \Rightarrow \qquad k = -\frac{1}{10} \ln{ \frac{2}{3}}.
\end{equation*}
Finally, we can plug that constant into our equation to get the solution for the temperature at any time value,
\begin{equation*}
T(t) = 20+30e^{\frac{t}{10}\ln{\frac{2}{3}}}.
\end{equation*}