Pythagorean thoerem we imagine the wall as a leg of a right triangle, the ladder is the hypotonuse and the distance from the bottom of the ladder to the wall is the other leg
so if we have a right triangle with leg length a and b and hypotnuse length c then a²+b²=c²
so given that one of the legs is 9ft (9 ft is the height of the triangle) and the hypotnuse is 12 ft (length of ladder) then say the last leg is x
so x²+9²=12² x²+81=144 mius 81 both sides x²=63 sqrt both sides x=√63 x=3√7
you should place it 3√7ft or about 7.9 or 8ft away