# SECTION 3.4# Example 1de := m*diff(v(t),t) = m*g-b*v(t);dsolve({de,v(0)=v0});Int(rhs(%),t);value(%);sol := x = %+c;subs({t=0,x=0},sol);solve(%,c);subs(c=%,sol);# Example 2# Using the result from Example 1,x := m/b*g*t-(v0-m/b*g)/b*m*exp(-b/m*t)+(-m*g+b*v0)*m/b^2;x1 := subs({v0=0,m=3,b=3,g=9.81},x);fsolve(x1 = 500,t);fsolve(9.81*t-9.81 = 500,t); # Ignore exponential termplot({x1,500},t=0..60);# Example 3#Using x from above,x;x1 := subs({v0=0,m=75,b=15,g=9.81},x);v1 := diff(x1,t);v1_60 := subs(t=60,v1);evalf(%);x1_60 := subs(t=60,x1);evalf(%);v1_60 := 49.05; x1_60 := 2697.75;x2 := subs({t=T,b=105,m=75,v0=v1_60,g=9.81},x);fsolve(x2 = 4000-x1_60,T);t := 60 + %;# Find velocity at impact:v2 := diff(x2,T);subs(T=181.56,v2);evalf(%);# Example 4de := m*diff(v(t),t) = m*g - b*v(t)^r;de2 := subs(r=2,de); %/m;subs(g=v0^2*b/m,%); # Solution by separation of variables:LHS := Int(1/(v0^2-v^2),v);value(%); LHS := %;RHS := Int(b/m,t);value(%);RHS := % + c1; sol := LHS = RHS; # Solution by dsolve:de2;dsolve(de2);