Locus equation of a projectile in terms of $\tan\theta$ This is the locus equation of a projectile projected from the ground at an angle $\theta$, with an initial velocity $u$ : 
$$
y = x\tan\theta - \frac{gx^2}{2u^2\cos^2\theta}
\tag{1}
$$
I just read that this quadratic equation can be expressed in terms of $\tan\theta$ too. 
Rewriting equation $\left(1\right) :$ 
$$
\begin{align}
y &~=~ x\tan\theta - \frac{gx^2\sec^2\theta}{2u^2}       \\[5px]
  &~=~ x\tan\theta - \frac{gx^2(1+ \tan^2\theta)}{2u^2}
\end{align}
$$
On expanding and rearranging the terms, we end up with this quadratic in terms of $\tan\theta$ 
$$
\frac{gx^2}{2u^2}\tan^2\theta - x\tan\theta + \left(\frac{gx^2}{2u^2}+y\right) = 0
\tag{2}
$$
This is what I read: If values of $u$, $x$, and $y$ are constants, then we would get two values of $\tan\theta$, i.e., two values of angle of projection $\theta :$ $\theta_1$ and $\theta_2 .$
What it means in physical terms (according to what I read) is, if we are projecting a projectile with an initial velocity $u$ and we want it to touch a particular coordinate $\left(x,y\right) ,$ then we can make it pass through the given coordinate by projecting it at two different angles $\theta_1$ and $\theta_2$ that we get from Equation $\left(2\right) ,$ and no more than these two angles (keeping magnitude of initial velocity $u$ the same). 
(I had to type everything just to make my question clear. I could’ve asked my question directly, without typing the equations. But just wanted to get it across better.)
My question is: I’m not able to figure out if discriminant of Equation $\left(2\right)$ is positive, is it? In order to get two values of $\theta$ from that equation, its discriminant must be positive. I have a doubt it’s not (I am probably wrong). But I can’t seem to figure out whether it’s positive or not. 
Secondly, is there such an equation as Equation $\left(2\right) ?$ I mean, is it a correct equation? I didn’t find it in my book, or in any other book. I came across some random study materials, and that’s where I saw this. I want to know if this equation is correct?
 A: Your math is correct. The reason it is difficult to determine the sign of the discriminant is that it depends on the values for $x$, $y$, and $u$. There are three possibilities:


*

*Discriminant is positive: There are two values of $\theta$ that will hit the target $(x,y)$.

*Discriminant is zero: There is exactly one angle that will result in hitting the target. Any other angle falls short.

*Disciminant is negative: There are no firing angles that will hit the target. The target is too far away or too high or both.


For an example of the last possibility, if your initial velocity is $u = 30\,\textrm{m/s}$ and your target is at $(x,y) = (1000\,\textrm{m}, 1000\,\textrm{m})$, then there is definitely no angle that will get the projectile to the target. The discriminant of equation (2) will be negative.
A: 
you have this two equations:
$\ddot{x}=0$
$\ddot{y}=-g$
so we get for $x$
$$x=v_x\,t\tag 1$$
and for $y$
$$y=-\frac{g\,t^2}{2}+v_y\,t\tag 2$$
where :
$v_x=v\,\cos(\theta)\quad $
and
$\quad v_y=v\,\sin(\theta)$
Calculate $t$ from equation (1) and put it in equation (2) you get your equation
$$y=-\frac{1}{2}\frac{g\,x^2}{v^2\,\cos^2(\theta)}+\tan(\theta)\,x\tag 3$$
$x_{\max}$  reach at  $y=0\quad $
we obtain with equation (3)
$$x_{\max}=\frac{2}{g}\,v^2\,\cos(\theta)\,\sin(\theta)=\frac{v^2}{g}\sin(2\,\theta)\tag 4$$
to find the angle $\theta_{\max}$ that give us the maximum distance toward x.   we differentiate equation (4) with respect to $\theta$ and put the result equal zero. 
$\frac{d}{d\theta}\,x_{\max}=\frac{2 v^2}{g}\cos(2\,\theta_{\max}))\overset{!}{=}0$
so we get for $\theta_{\max}$
$$\theta_{\max}=\frac{\pi}{4}$$
