For the triangle APB, the base length is distance AB and the height you get using the perp dist eqn using P and x-y+6=0.
Using area=bh/2, you can get an equation for the area in terms of p, which you can differentiate and find the max value of.
Evaluate the given integral and show that the max...