The area of a parallelogram is "height times base". Since you are told that the base (the length of AD which is the same as the length of BC) is 4 and that the area of the parallelogram is 40, the height, the perpendicular distance from BC to AD, is 10.
The area of a triangle is "(1/2) heigth times base" and the base of triangle APD is also 4 so you need to find the perpendicular distance from P to AD. That will be 10 plus the perpendicular distance from P to BC. The two right triangles having hypotenuses CP and DC are similar triangles but, since you do not know CD, I see no way of using that to get the perpendicular distance you need.