+
Problem 1.

-
We place our cannon at the origin (0, 0) and we set up the appropriate functions x[t] and y[t] for two dimensional projectile motion.

-
Since we want to maximize the horizontal distance traveled by the cannonball, we need to find out when the cannonball hits the ground.

-
So the distance traveled by the cannonball is

-
We can find the maximum distance by solving for theta,

-
This value is theta = Pi/4 as we can see.

-
Or we could plot distance[theta] and examine it for a theta which gives a maximum value. And here too we see that at the midpoint between 0 and pi/2, i.e. Pi/4, we attain a maximum distance.

-
Let's look at distance'[theta] to see if we can ascertain a maximum directly.

-
But this is a simple problem! Setting distance'[theta] equal to zero reduces our problem to finding an angle theta so that the squares of its sine and cosine are equal. Since common sense says our angle must be between 0 and Pi/2, this angle is Pi/4.