ClearAll["Global`*"]
y[t_] = (x[t])^2;
T[t_] = 1/2 * ((x'[t])^2 +(y'[t])^2) * m;
h[t_] = y[t];
U[t_] = -(m * g * h[t]);
L = T[t] - U[t];
equation[t] = D[#1, #2] - D[D[#1, #3], t] & [L, x[t], x'[t]];
xSolved[t] = DSolve[{equation[t] == 0, x[0] == -5, x'[0]==10}, x[t], t]
I just don't see it. The equation is properly calculated, the initial conditions are also correct. I don't know what's going on
Quit[]and then run OP's code, I get some other messages, starting with: Inverse functions are being used by Solve, so some solutions may not be found... – user293787 Oct 15 '22 at 19:22Falsein the first argument. So it seems you do not have that problem at all. Can you post code that produces the problem? – Michael E2 Oct 16 '22 at 00:21