tAnimate = 0.012396694214876063 (slider from 0 to (tmax * 1.1), step 0.01)
tmax = 8
f(x) = ((0.5 * ℯ^(x / 2)) * sin(((5.012 * π / 8) * x))) + 1
t = Min(tAnimate, tmax)
cardy = 3
g = Integral(f, x)
c_1 = 0
cardx = 3
A: (cardy / 2, g(t))
text1 = RotateText("Velocity f(t)", 1.5708)
D: A + (cardx, (-cardy))
E: A + (cardx, ((-cardy)) / 3)
F: A + ((cardx * 1.5), ((-cardy)) / 3)
G: A + ((cardx * 1.5), cardy / 3)
H: A + (cardx, cardy / 3)
I: A + (cardx, cardy)
B: A + (0, cardy)
C: A + (0, (-cardy))
poly1, b, c, d, e, f_1, g_1, h, i = Polygon(B, C, D, E, F, G, H, I)
p = Circle(A + (((-cardy)) / 4, ((-cardy) * 0.6)), cardy / 4)
k = Circle(A + (((-cardy)) / 4, (cardy * 0.6)), cardy / 4)
text2: "t=" + t + ""
a = Segment((t, 0), (t, f(t)))
fshow(t, x) = If[0 ≤ x ≤ tmax, f(x)]
text4 = RotateText("Position x(t)", 1.5707963267948966)
P_sub = (0.012396694214876063, 4.307493540051679)
threshold = 0.1
zeropoints: {Roots[f, 0, tmax]}
zeros: x(zeropoints)
xPclose = If(x(P_sub) < 0, 0, If[x(P_sub) > tmax, tmax, If[abs(x(P_sub) - Element[zeros, 1]) < threshold, Element[zeros, 1], If[abs(x(P_sub) - Element[zeros, 2]) < threshold, Element[zeros, 2], If[abs(x(P_sub) - Element[zeros, 3]) < threshold, Element[zeros, 3], If[abs(x(P_sub) - Element[zeros, 4]) < threshold, Element[zeros, 4], If[abs(x(P_sub) - Element[zeros, 5]) < threshold, Element[zeros, 5], -1]]]]]])
P = DynamicCoordinates(P_sub, If[xPclose ≥ 0, xPclose, x(P_sub)], If[xPclose ≥ 0, f(xPclose), f(x(P_sub))])
xmax = 9
xmin = -1
ymin = -19
ymax = 25
xmin2 = -7
xmax2 = 10
ymin2 = -11
ymax2 = 27
c_2 = 0
text3: "" + (LaTeX[If[abs(f(t)) < 0.1, "stopped", If[f(t) > 0, "forward", "backward"]]]) + ""