How can I find the appropiate launching angle given different heights? The problem states the following:

A soccer player $\textrm{20.0 m}$ from the goal stands ready to score.
  In the way stands a goalkeeper, $\textrm{1.70 m}$ tall and
  $\textrm{5.0 m}$ out from the goal, whose crossbar is at 
  $\textrm{2.44 m}$ high. The stricker kicks the ball toward the goal at 18
  $\frac{m}{s}$. For what range of angles does the player score a goal
  meaning the ball passes above the goalkeeper but below the crossbar?

What I tried to do is to follow the equations of parabolic motion and I defined them as:
$\textrm{For y:}$
$\textrm{Launching angle:}\,\omega$
$$y=y_{0}+v_{0y}\sin\omega\times t-\frac{1}{2}\times g t^{2}$$
Since what it is being asked is related to the maximum height this is found by knowing the vertex of the parabola or the maximum of the function which I found below:
$$v_{0y}\sin\omega-gt=0$$
$$t=\frac{v_{0y}\sin\omega}{g}$$
Replacing this in the original function would render the maximum $\textrm{y}$:
$$y=y_{0}+v_{0y}\sin\omega\times (\frac{v_{0y}\sin\omega}{g})-\frac{1}{2}\times g (\frac{v_{0y}\sin\omega}{g})^{2}$$
Simplifying:
$$y=y_{0}+\frac{v^{2}_{0y}\sin^{2}\omega}{2g}$$
I used the coordinates origin as $\textrm{(0,0)}$ So when the ball is at the ground being kicked by the soccer player would be:
$$y=0+\frac{v^{2}_{0y}\sin^{2}\omega}{2g}$$
Therefore by replacing the known values $g=9.8\,\frac{m}{s^{2}},\,v=18\,\frac{m}{s}\,\textrm{crossbar height = 2.44 m}$ I calculated the value of omega as follows:
$$\sin^{2}\omega=\frac{2\times9.8\times 2.44}{18^{2}}$$
$$\sin\omega=\sqrt{\frac{2\times9.8 \times 2.44}{18^{2}}}=0.3842$$
$$\omega=\sin^{-1}0.3842\approx 0.3943\,\textrm{rad or}\,22.5940^{\circ}$$
Therefore that would be the maximum angle or the upper boundary of the launch angle from which the ball would be kicked so that it does not fly higher than the crossbar thus to ensure it will score the goal.
The other angle I thought would take into account the height of the goalkeeper, from the data is known as $\textrm{1.7 m}$. By reusing the previous formula I got to:
$$\sin\omega=\sqrt{\frac{2\times9.8 \times 1.7}{18^{2}}}=0.3207$$
$$\omega=\sin^{-1}0.3207\approx 0.3265\,\textrm{rad or}\,18.7044^{\circ}$$
However I dismissed the last result as if such angle is used the goalkeeper would catch the ball.
The other part is the horizontal component. I defined the equation as:
$$x=x_{0}+v_{0x}\cos\omega \times t$$
I figured to use the earlier $\textrm{t}$ and to find the range would meant that it would be twice tha time that was used to achieve the maximum height and that range must be the goal.
Therefore the earlier equation would become into:
$$x=x_{0}+v_{0x}\cos\omega \times 2t$$
$$x=x_{0}+v_{0x}\cos\omega \times (\frac{2v_{0y}\sin\omega}{g})$$
$$x=x_{0}+\frac{2v^{2}_{0y}\sin\omega\cos\omega}{g}$$
$$x=x_{0}+\frac{2v^{2}_{0y}\sin2\omega}{g}$$
By using the data $\textrm{20 m}$ and using $\textrm{coordinates origin at (0,0)}$:
$$x=0+\frac{v^{2}_{0y}\sin2\omega}{g}$$
$$\sin2\omega=\frac{20\times 9.8}{18^{2}}=0.6049$$
$$\omega=\sin^{-1}\frac{0.6049}{2}=0.3073\,\textrm{rad or}\,17.6060^{\circ}$$
Therefore these range of angles would be the ones to score a goal. But none of these are right according to my book. Since it says that the range of angles would be between $20.4^{\circ}$ and $26.57^{\circ}$
What is it the step or the interpretation which I did it wrong?. Can someone show a better method or put me in the right track?.
 A: The error that you’ve made is to cap the peak of the ball’s arc at the crossbar height when computing the range of angles that will send the ball into the goal. The ball can in fact travel higher than the top of the goal posts as long as it’s dropped to below 2.44m by the time it reaches them. Similarly, the ball might need to be higher than the goalie at its peak in order to pass over her by the time it gets to her location. Since we’re not considering bounces in this problem, you also need to ensure that the ball doesn’t fall short of the goal, i.e., that $y$ is positive at $x=20$.  
I prefer to work with the Cartesian equation of the family of parabolas that represents the various trajectories as the travel time is irrelevant here. Eliminating $t$ from the equations of motion $$x = v_0 t \cos\omega \\ y = v_0 t \sin\omega - \frac12gt^2$$ produces $$y = x \tan\omega - {g\over 2v_0^2\cos^2\omega}x^2$$ and substituting the known values of $v_0$ and $g$ gives the one-parameter family of parabolas $$y = x\tan\omega - 0.01512 x^2\sec^2\omega.\tag 1$$ Ignoring the size of the ball, for it to enter the goal you must have $0\lt y\lt 2.44$ when $x=20$ and for the ball to clear the stationary goalie you must have $y>1.70$ at $x=15$. Substituting these $x$ values into equation (1) yields the inequalities $$0 \lt 20.0 \tan\omega-6.04938 \sec^2\omega \lt 2.44 \\ 15.0\tan\omega - 3.40278\sec^2\omega > 1.70.$$ In addition, you also need $0\le\omega\le\frac\pi2$. Substituting $1+\tan^2\omega$ for $\sec^2\omega$ gives you quadratics in $\tan\omega$, which you can then solve algebraically. Doing so for the first inequality gives two ranges of angles: $0.3248 \lt \omega \lt 0.4637$ and $1.2285 \lt \omega \lt 1.2460$. The latter range corresponds to a high lob that sails far over the goalie and enters the goal at a steep angle, which apparently wasn’t considered by whoever posed this problem. The second inequality produces $0.3557 \lt \omega \lt 1.3280$. The solution is then the intersection of this interval with the two that represent hitting the goal: $$0.3557 \lt \omega \lt 0.4637 \text{ or } 1.2285 \lt \omega \lt 1.2460.$$ Converted to degrees, the first interval is $20.3796° \lt \omega \lt 26.5707°$, in agreement with the given solution, and the second interval converts to $70.385° \lt \omega \lt 71.3878°$. The trajectories that correspond to the endpoints of these intervals are illustrated below.

A: The initial speed is given as $v_0=18m/s$, 
$$y=y_0+(v_0\sin\omega)t-\frac{1}{2}gt^2$$
for $x$,
$$x=x_0+(v_0\cos\omega)t$$
(note both equations contain $v_0$, not $v_{0x}$ and not $v_{0y}$)
Let's put the player at $x=0m$, so $x_0=0m$, the goal at $x=20m$, and the goalkeeper at $x=15m$.
When does the ball pass by the goalkeeper? When
$$x=(v_0\cos\omega)t=15m$$
$$t=\frac{15m}{v_0\cos\omega}$$
How high is the ball at that time?
$$y=(v_0\sin\omega)\frac{15m}{v_0\cos\omega}-\frac{1}{2}g\left(\frac{15m}{v_0\cos\omega}\right)^2$$
To pass by the goalkeeper,
$$(v_0\sin\omega)\frac{15m}{v_0\cos\omega}-\frac{1}{2}g\left(\frac{15m}{v_0\cos\omega}\right)^2>1.7m$$
When does the ball pass by the goal? When
$$x=(v_0\cos\omega)t=20m$$
$$t=\frac{20m}{v_0\cos\omega}$$
How high is the ball at that time?
$$y=(v_0\sin\omega)\frac{20m}{v_0\cos\omega}-\frac{1}{2}g\left(\frac{20m}{v_0\cos\omega}\right)^2$$
To pass into the goal,
$$(v_0\sin\omega)\frac{20m}{v_0\cos\omega}-\frac{1}{2}g\left(\frac{20m}{v_0\cos\omega}\right)^2<2.44m$$
You can just plot this and you will see that the ball passes over the goalkeeper for angles above 20.4 degrees, but misses the goal for angles above 26.6 degrees:

