I'm having problemes using the chain rule in the 2-variables case. I know that the first derivative of a function $f=f\left(t,u(t)\right)$ is
$$\frac{df}{dt}=\frac{df}{dt}+\frac{df}{du}\frac{du}{dt}$$
Then, if I apply the chain rule in this expression I get:
$$\frac{d^2f}{d^2t}=\left[\frac{df}{dtdu}\frac{du}{dt}+\frac{d^2f}{d^2t}\right]+\left[\frac{d^2u}{d^2t}\frac{df}{du}+\frac{du}{dt}\left(\frac{d^2f}{d^2u}\frac{du}{dt}+\frac{df}{dudt}\right)\right]$$
where the first group comes from derivating the first term of $\frac{df}{dt}$ and the second group from derivating the second one.
However, shouldn't this derivative look like the following?
$$\frac{d^2f}{d^2t}=\frac{d^2f}{d^2t}+2\frac{du}{dt}\frac{df}{dudt}+\frac{d^2f}{d^2u}\left(\frac{du}{dt}\right)^2$$
I'd appreciate if someone could explain me a little bit what I am doing wrong.