A stream of water

a stream of water exits from the nozzle of a hose at a speed of 16m/s. the vertical wall of a burning building is a horizontal distance D=4.0 m away from the nozzle. I understand and got the correct answers for the first two questions, but i need help on the third question.

1.) if the nozzle is pointing at an angle of 40 Degrees above horizontal, how long does it take for the water to travel from the nozzle to the wall? 0.33s (it's correct, no need to check)

2.) At what height above the nozzle does the water hit the wall? 2.8 m ( this is also correct)

ok, i'm stuck on the third question....

3.) If the angle of the nozzle is changed to maximize the height of the water of the wall, what height above the nozzle does the water hit the wall?

The thing i dont understand is finding the angle of the nozzle when it's changed to the maximize height of the water. can someone help me?
 Blog Entries: 9 Recognitions: Homework Help Science Advisor Do you know calculus...?If so,then compute the function height on the wall vs.angle, then maximize this function and then compute the maximal value... Daniel.
 i do know calculus, but i dont know what you just said. please explain with details. the answer is 12.8m, but i dont know how to get that answer. i'm trying to study for a test, so any help is appreciated. maybe if you explain it in a non-math/less math term, i would be able to understand. "compute the function height on the wall vs.angle" how would i do that?

Blog Entries: 9
Recognitions:
Homework Help

A stream of water

The equations of motion are simple to get,by applying the second law of Newton for constant gravity field.
$$x(t)=v_{0}\cos \theta \ t$$
$$y(t)=v_{0}\sin \theta \ t-\frac{1}{2}gt^{2}$$

Put the condition that the water flow reaches the wall at the height "h" and then eliminate "t' between the 2 equations.You'll end up with an equation h=h(\theta).

Daniel.
 $$h = \frac{v(0)^2*sin(theta)^2}{2g}$$ this one?
 Blog Entries: 9 Recognitions: Homework Help Science Advisor Nope,that's 2 simple...Another one,please... Daniel. HINT:It contains tangent & secant squared.
 h = tan(theta)*D-1/2*g(D/vo*cos(theta))^2
 Blog Entries: 9 Recognitions: Homework Help Science Advisor Perfect,now maximize & extract maximum value (don't bother computing the 2-nd derivative to convince yourself of the maximum value)... Daniel.
 "maximize & extract maximum value" <--- what do you mean? do you just want me to plug in the values and find h? if so, h = 3.17
 Recognitions: Gold Member Science Advisor Staff Emeritus No, find $dh/d\theta$, and set this to zero. That will give you the optimal $\theta$. Plug this in to find h. Besides, how did you get that number without knowing the optimal angle ?
 i got $dh/d\theta$ = $$d(sec^2(\theta)+ \frac{d*g*cos(\theta)*sin(\theta)}{v_0^2})$$ so i'm trying to solve for theta right? is this correct so far?
 Blog Entries: 9 Recognitions: Homework Help Science Advisor It is incorrect.Pay attention with the differentiation of $-\frac{1}{\cos^{2}\theta}$ Daniel.
 Recognitions: Gold Member Science Advisor Staff Emeritus Also, you seem to have squared the velocity in the denominator.
 Blog Entries: 9 Recognitions: Homework Help Science Advisor It was supposed to be squared,Gokul. Daniel.
 Recognitions: Gold Member Science Advisor Staff Emeritus Oops sorry...ignore that.