Solution (source code)

= Solution

\b[First method: substitute the trajectory.] Along the <parametric curve>, the <temperature> is $T(t)=20e^{-\cos^2t}-(1+\sin t)^3$. The <chain rule> gives
$$
\boxed{\frac{dT}{dt}
=40\sin t\cos t\,e^{-\cos^2t}-3(1+\sin t)^2\cos t.}
$$
\b[Second method: use the spatial derivatives.] The <partial derivatives> of the <scalar field> are $T_x=-40xe^{-x^2}$ and $T_z=-3(z+1)^2$, while the <velocity> components are $\dot x=-\sin t$ and $\dot z=\cos t$. The <multivariable chain rule> therefore gives
$$
\frac{dT}{dt}=T_x\dot x+T_z\dot z
=(-40\cos t\,e^{-\cos^2t})(-\sin t)-3(1+\sin t)^2\cos t,
$$
which agrees with the first calculation. This is the <gradient> dotted with the <velocity>, rather than a <partial derivative> at a fixed position.