if a ball is thrown directly upward into the air with a velocity of 40 ft/sec, it's height (in feet) after t seconds is given by a the formula y=20+40t-16t^2. What is the maximum height attained by the ball?
The ball will reach its maximum height when the ball's velocity is equal to 0 (slowed down due to the force of gravity). So, using some kinematics:
where a is the acceleration due to gravity in feet/sec^2
Solve for t and plug into your original equation.
Or if you know your mechanics and a bit of calculus, differentiate both sides and solve for t when (i.e. when velocity is equal to 0)