Answer
See below
Work Step by Step
According to Nonlinear Law of Cooling, we have: $\frac{dT}{dt}=k(T-T_m)^2\\\rightarrow \frac{dT}{(T-T_m)^2}=kdt$
Integrate both sides: $\int \frac{dT}{(T-T_m)^2}=\int kdt\\
\rightarrow \frac{-1}{T-T_m}=kt+c\\
\rightarrow T(t)=T_m-\frac{1}{kt+c}$
Use the initial-value condition $T(0)=T_0$ to find: $T_0=T_m-\frac{1}{c}\\\rightarrow c=\frac{1}{T_m-T}$
Thus, the solution is: $T(t)=T_m-\frac{1}{kt+\frac{1}{T_m-T}}\\=\frac{T_m kt(T_m-T)+T_m-T_m+T}{kt(T_m-T)+1}\\=\frac{T_mkt(T_m-T)+T}{kt(T_m-T)+1}\\=T_m-\frac{T_m-T}{T_mkt(T_m-T)+T_m-T}$
We can notice that: $T(t) \rightarrow T_m\\
t\rightarrow \infty$