syms dt0 dt1 positive
syms a s0 v0 sf vf real

v1 = v0 + dt0*a;
s1 = s0 + dt0*v0 + dt0^2/2*a;
v2 = v1 - dt1*a;
s2 = s1 + dt1*v1 - dt1^2/2*a;

[dt0, dt1] = solve([s2.sf; v2-vf], [dt0, dt1])