Underdamped Motion 

> assume(`<`(d, 0)); -1
 

> dsolve({deq2, init}, x(t))
 

x(t) = `+`(`/`(`*`(`/`(1, 2), `*`(x[0], `*`(`+`(`*`(`^`(`+`(`-`(d)), `/`(1, 2))), `*`(I, `*`(r))), `*`(exp(`+`(`/`(`*`(2, `*`(`+`(`*`(I, `*`(`^`(`+`(`-`(d)), `/`(1, 2)))), r), `*`(k, `*`(t)))), `*`(`+...
 

> subs(eq, %)
 

x(t) = `+`(`/`(`*`(`/`(1, 2), `*`(x[0], `*`(`+`(`*`(`^`(`+`(`*`(4, `*`(k, `*`(m))), `-`(`*`(`^`(r, 2)))), `/`(1, 2))), `*`(I, `*`(r))), `*`(exp(`+`(`-`(`/`(`*`(`/`(1, 2), `*`(`+`(`*`(I, `*`(`^`(`+`(`*...
 

> xu := unapply(rhs(%), m, r, k, x[0], t); -1
 

> plt3 := plot([xu(1, `/`(1, 2), 1, 2, t), xu(1, `/`(1, 5), 1, 2, t)], t = 0 .. 20, legend = [typeset(r = `/`(1, 2)), typeset(r = `/`(1, 5))], labels = [t, x(t)], labelfont = [TIMES, BOLD, 12]); -1; %
plt3 := plot([xu(1, `/`(1, 2), 1, 2, t), xu(1, `/`(1, 5), 1, 2, t)], t = 0 .. 20, legend = [typeset(r = `/`(1, 2)), typeset(r = `/`(1, 5))], labels = [t, x(t)], labelfont = [TIMES, BOLD, 12]); -1; %
plt3 := plot([xu(1, `/`(1, 2), 1, 2, t), xu(1, `/`(1, 5), 1, 2, t)], t = 0 .. 20, legend = [typeset(r = `/`(1, 2)), typeset(r = `/`(1, 5))], labels = [t, x(t)], labelfont = [TIMES, BOLD, 12]); -1; %
 

Plot_2d
 

> mass_spring(1, `/`(1, 2), 1, 0, 5, 2, 0, 20, 0, 60, scaling = constrained)
 

 

 

`+`(diff(diff(x(t), t), t), `*`(`/`(1, 2), `*`(diff(x(t), t))), x(t)) = 0
x(t) = `+`(`*`(`/`(2, 15), `*`(`^`(15, `/`(1, 2)), `*`(exp(`+`(`-`(`*`(`/`(1, 4), `*`(t))))), `*`(sin(`+`(`*`(`/`(1, 4), `*`(`^`(15, `/`(1, 2)), `*`(t))))))))), `*`(2, `*`(exp(`+`(`-`(`*`(`/`(1, 4), `...
Plot_2d
 

r = `/`(1, 2) 

> mass_spring(1, `/`(1, 5), 1, 0, 5, 2, 0, 20, 0, 60, scaling = constrained)
 

 

 

`+`(diff(diff(x(t), t), t), `*`(`/`(1, 5), `*`(diff(x(t), t))), x(t)) = 0
x(t) = `+`(`*`(`/`(2, 33), `*`(`^`(11, `/`(1, 2)), `*`(exp(`+`(`-`(`*`(`/`(1, 10), `*`(t))))), `*`(sin(`+`(`*`(`/`(3, 10), `*`(`^`(11, `/`(1, 2)), `*`(t))))))))), `*`(2, `*`(exp(`+`(`-`(`*`(`/`(1, 10)...
Plot_2d
 

r = `/`(1, 5)