If you throw a projectile from the ground at a certain angle, it's not hard to see that, assuming we're in a vacuum, throwing it at 45º from the ground will always make it go farthest before it hits the ground again. I wanted to find out what's the optimal angle if we take into account air resistance.
Before I go on, let me say that there's really no point to this question. I'm not trying to solve a practical problem. I just thought it would be fun to try to solve the equations.
This is the model I'll use: We'll assume that air resistance is roughly proportional to velocity (aka. Stokes drag; this fails for high speeds/Reynolds numbers, so let's not go there); in symbols, $$\mathbf{F} = -k\mathbf{v}.$$ We'll throw the projectile with mass $m$ from $(0,0)$ with initial speed $v_0$, forming an angle $\alpha$ with the ground, and let's say $\gamma = k/m$ because it will turn up frequently.
The differential equations are:
$$\begin{align} \ddot{x} + \gamma \dot{x} &= 0 \\ \ddot{y} + \gamma \dot{y} &= -g \end{align}$$
with initial conditions $(x(0), y(0)) = (0,0)$ and $(\dot{x}(0), \dot{y}(0) )= v_0(\cos \alpha, \sin \alpha)$. Solving (assuming I haven't made any mistakes), we get:
$$ \begin{align} x &= \frac{v_0}{\gamma}\cos \alpha (1- e^{-\gamma t}) \\ y &= (\frac{v_0}{\gamma} \sin \alpha + \frac{g}{\gamma^2})(1-e^{-\gamma t}) - \frac{g}{\gamma}t. \end{align} $$
Now the thing to do would be to solve $y(t) = 0$, substitute that into $x$, differentiate with respect to $\alpha$ and set it equal to $0$. However, that gets messy quickly, because the solution involves the Lambert-W function and it's all a mess. I haven't even tried to substitute into $x(t)$.
So finally, my question is: is there a simpler or numerical way to solve this? Is there even a single angle which will always work, or does it depend on the conditions? Can we find that out without actually solving?