A right triangle is formed between the ladder, the ground and the wall.
The ladder is the hypotenuse so we use Pythagoras: 15²=12²+x² where x is the distance between the foot of the ladder and the wall, so x²=15²-12²=(15-12)(15+12)=3×27=81 sq ft. Therefore x=9 feet, the answer to the question.