Projectile motion with linear drag (source code)

= Projectile motion with linear drag
{title2=$\ddot{\mathbf r}=-\gamma\dot{\mathbf r}+\mathbf g$}

For constant <acceleration> vector $\mathbf g$ and $\gamma>0$, a projectile initially at $\mathbf r_0$ with <velocity> $\mathbf v_0$ has
$$
\mathbf v(t)=\frac{\mathbf g}{\gamma}+\left(\mathbf v_0-\frac{\mathbf g}{\gamma}\right)e^{-\gamma t},\qquad
\mathbf r(t)=\mathbf r_0+\frac{\mathbf g}{\gamma}t+
\frac{\mathbf v_0-\mathbf g/\gamma}{\gamma}(1-e^{-\gamma t}).
$$
The <integrating factor> $e^{\gamma t}$ solves the first-order <linear ordinary differential equation> for the <velocity>; one more integration proves the position formula. The terminal <velocity> is $\mathbf g/\gamma$, and $1/\gamma$ is the relaxation <time>. For $\mathbf g=(0,-g)$ and $\mathbf r_0=0$, eliminating time when $V_{0x}\ne0$ gives
$$
z(x)=\left(\frac{V_{0z}}{V_{0x}}+\frac{g}{\gamma V_{0x}}\right)x
+\frac{g}{\gamma^2}\ln\left(1-\frac{\gamma x}{V_{0x}}\right).
$$
For finite $t\geq0$, the physical domain is $0\leq\gamma x/V_{0x}<1$. If $V_{0x}=0$, the path is vertical and cannot generally be represented as a single-valued graph $z(x)$. Expanding at fixed $x$ as $\gamma\to0$ recovers $z=(V_{0z}/V_{0x})x-gx^2/(2V_{0x}^2)$.