In a projectile motion problem, the height of the object from the ground is given by $y=ut-1/2gt^2$, where $u$ is vertical component of initial velocity and $g$ is gravitational acceleration. The maximum value of $y$ is reached at a time given by?
MY ANSWER
$$\frac{dy}{dt}=u-gt$$
To find maxima $$u-gt=0$$ $$u=gt$$ $$t=\frac{u}{g}$$
Applying the values in original equation
$$y=\frac{u^2}{g}-\frac{u^2}{2g}$$ $$y=\frac{u^2}{2g}$$
The correct answer is $\frac{u}{g}$. What is the issue with my answer?