# Nested Derivative

These two expressions are mathematically the same, but when substituting with the same rule, yield different results. What is happening?

Derivative[1][Derivative[1][x][t]][t] == 5 t + 3 x[t] /.
{x -> Function[{t}, 1/3 (-5 t + Derivative[1][Derivative[1][x][t]][t])]}

D[x[t], t, t] == 5 t + 3 x[t] /.
{x -> Function[{t}, 1/3 (-5 t + Derivative[1][Derivative[1][x][t]][t])]}

-

The correct notation for a double derivative is Derivative[1][ Derivative[1][x] ][t], not Derivative[1][ Derivative[1][x][t] ][t]. Note the difference between a function f and its value at t: f[t]. Derivative[1][x] represents a function. Derivative[1][x][t] represents its value at t.
Derivative needs to be used like this: Derivative[k][f] where k is a number and f is a function. In place of f you had Derivative[1][x][t] which is not a function, but a value of the function at t.
The simpler notation for the second derivative is Derivative[2][x].