Answer
See below
Work Step by Step
Given: $T_m=80e^{-\frac{t}{20}}\\k=\frac{1}{40}$
Apply Newton's cooling law, we have:
$\frac{dT}{dt}=-k_1(T-A+B\cos \omega t)+A_0\\
\frac{dT}{dt}+k_1T=A_0+k_1A-k_1B\cos \omega t$
Since this is a linear equation whose solution can be given by:
$T=e^{-\int k_1dt}(c_1+\int e^{-\int k_1dt}(A_0+k_1A-k_1B\cos \omega t)dt)\\
T=c_1e^{-k_1t}+e^{-k_1t}\int e^{k_1t}(A_0+k_1A-k_1B\cos \omega t)dt\\
T=c_1e^{-k_1t}+\frac{A_0}{k_1}+\frac{Bk_1(k_1\cos(t\omega)+\omega\sin(t\omega))}{k_1^2+\omega^2}$
We are given $T(0)=T_0$, then
$T(0)=\frac{A_0}{k_1}+A+\frac{B\omega^2}{k_1^2+\omega^2}-B+c_1=0\\
\rightarrow c_1=-\frac{A_0}{k_1}+A-\frac{B\omega^2}{k_1^2+\omega^2}+B+T_0$
Hence, the complete solution is:
$T(t)=(-\frac{A_0}{k_1}+A-\frac{B\omega^2}{k_1^2+\omega^2}+B+T_0)e^{-k_1t}+\frac{A_0}{k_1}+A-\frac{Bk_1(k_1\cos(t\omega)+\omega\sin(t\omega))}{k_1^2+\omega^2}$