I'll use D instead of d to avoid confusing with derivatives. From the 1st equation you get t = DcosФ/(vcosӨ). PLug that into the second, giving:

-DsinФ = (vsinӨ)(DcosФ/(vcosӨ)) - (1/2)g(DcosФ/(vcosӨ))^2 = D cosФ tanӨ - (g/(2v^2)) D^2 (cosФ)^2 (secӨ)^2, so can cancel a D (D not 0):

-sinФ = cosФ tanӨ - (g/(2v^2)) D (cosФ)^2 (secӨ)^2, and then solve for D:

D = ( sinФ + cosФ tanӨ ) / { (g/(2v^2)) (cosФ)^2 (secӨ)^2 } = ( sinФ + cosФ tanӨ ) ( (cosӨ)^2 ) ( 2v^2/g ) (secФ)^2

D = ( sinФ(cosӨ) + cosФ sinӨ ) (cosӨ) ( 2v^2(secФ)^2 /g ) = sin ( Ф + Ө ) cos(Ө) ( 2v^2(secФ)^2 /g ) (used sine angle sum formula).

Now evaluate dD/dӨ, and then set dD/dӨ = 0, and solve for Ө. For simplicity, let A = ( 2v^2(secФ)^2 /g ), since it is just a constant when thinking of D as a function of Ө.

Have D(Ө) = A sin ( Ф + Ө ) cos(Ө). So dD/dӨ = A cos ( Ф + Ө ) cos(Ө) - A sin ( Ф + Ө ) sin(Ө) = A cos ( Ф + 2Ө ) (used cosine angle sum formula).

Since dD/dӨ = A cos ( Ф + 2Ө ), dD/dӨ = 0 when cos ( Ф + 2Ө ) = 0 when Ф + 2Ө = pi/2 + kpi for any integer k.

Note d^2D/dӨ^2 = -2A sin ( Ф + 2Ө ), so when Ф + 2Ө = pi/2 + kpi, have d^2D/dӨ^2 = -2A sin ( pi/2 + kpi ) = -2A(-1)^k = 2A(-1)^(k+1), and since A positive, have that

d^2D/dӨ^2 is negative when k even, and positive when k is odd. Thus D(Ө) has local maximums occur when k is even, so k=2m for any integer m, so Ф + 2Ө = pi/2 + (2m)pi.

Thus D(Ө) has local maximums at Ө = pi/4 - Ф/2 + mpi for any integer m.