Problem 3.
The same functions x[t] and y[t] still give the trajectory of our cannonball, but now we need a more complex solution procedure.
Our solution will now consist of a launch angle and a setback distance. The distance to be optimized, the distance beyond the wall, is the total distance travelled less the setback distance. The total distance travelled is still x[t2], where t2 is the time the cannonball hits the ground. The setback distance is the distance travelled before the cannonball first achieves a height of 10 meters.
Now we want to set the derivative of the walldistance[theta] equal to zero to find the maximum distance beyond the wall.
Thus we should launch some 9.82558 ft in front of the wall at an angle of 0.878922 radians for a maximum distance beyond the wall of 52.8375 ft.