I have the problem $\frac{d}{dt}[p(x(t),t)] = \frac{\partial p}{\partial x}\frac{dx}{dt}+\frac{\partial p}{\partial t}$
Could someone please help me understand why this equality is the case? I imagine it has to do with the chain rule or something but I am having a hard time understanding this idea.
For a function P(x,y) where x and y are functions of t we have
$$ \frac {d}{dt} P(x,y) = \frac {\partial p }{ \partial x} \frac {dx }{dt}+ \frac {\partial p }{ \partial y} \frac {dy}{dt}$$
your problem is a special case where y=t and as a result you have
$$ \frac {d}{dt} P(x,t) = \frac {\partial p }{ \partial x} \frac {dx }{dt}+ \frac {\partial p }{ \partial t} \frac {dt}{dt}=\frac {\partial p }{ \partial x} \frac {dx }{dt}+ \frac {\partial p }{ \partial t} $$