A rectangle PQRS is inscribed in the region between the x-axis and the part of the graph y= cos 4x specified by -pi/8 < x< pi/8. ( the < sign is less than or equal to). Determine the coordinates of P for which the perimeter of PQRS is a maximum.

Im not even sure where to begin... :(