A lighthouse is located 3km away from the nearest point P on a straight shoreline and its light makes four revolutions per minute. How fast is the beam of light moving along the shoreline when it is 1km from P?

I don't get how to maximize in this equation.

A circle of radius r, you carve out a slice from the middle that makes angle 0<X<2pi, and has perimeter P. Maximize the area of the slice.