You just have to differentiate the

y=yinitial + x (tantheta) - [(gx^2)/(2(vinitial^2)(cos^2theta))]

with respect to theta.

Then you will arrive at the last line.

Remember that differentiating with respect to theta here means y_initial is constant, and x is constant too.

Of course the g and the V_initial are constants also.

Why not write V_initial as Vo, Y_initial as Yo?