Off[InverseFunction::"ifun"]
Off[Solve::"ifun" ]
Off[FindRoot::"lstol"]
Off[General::"spell1"]

Solutions for position x(t) and y(t)

The horizontal and vetical velocity functions are obtained by solving linear differential equations with constant coefficients:

Clear[u,  A,  r,  g, h,  v,  w,  x,  y]
soln1  =  
        DSolve[{v'[t]  ==  - r v[t],  
            v[0]  ==  u Cos[A]},  v[t],  t];
\(\(\(v[t_]\  = \((v[t] /. soln1[\([1]\)])\)\)\(
\)
    \)\)

\(\(\(soln2\  = \ 
        DSolve[{\(w'\)[t]\  == \ \(-g\)\  - \ r\ w[t], \ 
            w[0]\  == \ u\ Sin[A]}, \ w[t], \ t];\)\(
\)
    \)\)
w[t_]  = Expand[(w[t] /. soln2[[1]])]

The position functions are obtained by integrating the velocity functions.

x[
        t_]   =  (∫_0^t) v[
            s] \[DifferentialD]s

y[t_]   =  
      Expand[ h  +  (∫_0^t) w[s] \[DifferentialD]s]

r  =   .2; 

    h  =  3; 

    g  =  32;

Trajectories

Clear[u,  
        A];

    u  =  125;

    A  =  Pi/4;

    ParametricPlot[{x[t],  y[t]},  {t,  0, 
        7} ]

Clear[u,  
        A];

    u  =  125;

    A  =  Pi/5;

    ParametricPlot[{x[t],  y[t]},  {t,  0, 
        7} ]

Clear[u,  
        A];

    u  =  125;

    A  =  Pi/6;

    ParametricPlot[{x[t],  y[t]},  {t,  0, 
        7} ]

Range versus angle for various fixed initial speeds.

Clear[A];

    Clear[Angle]

    range[Angle_]  :=  
      Module[{t0}, 
A  =  
          Angle; 
t0  =   t /. NSolve[
                y[t]  ==  0,  t][[2]]; 
x[
          t0]

]

u  =  125;
Plot[range[Angle],  {Angle,   .4,  1}]

u  =  1000;
Plot[range[Angle],  {Angle,   .1,  1}]

u  =  150;
Plot[range[Angle],  {Angle,   .4,  1}]

Numerical solution to the problem!

We want to find the minimal initial speed and the corresponding angle which makes the ball clear a fence 10 feet high 350 feet away from the origin.

We know from our range versus angle plots that one gets a range over 350 feet with an initial speed around 150 and the optimal angle is around .6.

So now for each angle near .6,  let's find the initial speed which makes the ball hit the top of the fence (at some time t).   

First an experiment with an assigned angle A:

Clear[ Angle, u,  A];
A  =   .8;
soln  =  
      FindRoot[{x[t]  ==  350,  y[t]  ==  10},  {t,  
          10},  {u,  125}]
u /.  soln

Check  the solution:

{x[t],  y[t]} /.  soln

Now we define a function which, for input A. gives as output the initial speed u which makes the ball hit the top of the fence.  I explained in Mathematica Tutorial 6 how to turn the 3 lines of code above into a program for such a function.

Clear[f,  Angle, u,  A];
f[Angle_]  :=  
      Module[{soln}, 

A  =  
          Angle; 
soln  =  
          FindRoot[{x[t]  ==  350,  y[t]  ==  10},  {t,  
              5},  {u,  150}]; 
u /. 
          soln
]

Test the function:

f[Pi/4]
f[ .4]

Plot the function:

Plot[f[Angle],  {Angle,  .6,   .7}]

Plot[f[Angle],  {Angle,  .62,   .66}]

Plot[f[Angle],  {Angle,  .64,   .65}]

Plot[
      f[Angle],  {Angle,  .643,   .645}]

The optimal angle is about .644
Let's do a final solution for the minimal initial speed

f[ .644]