Step 1

First situation

when a ladder is leaning against a wall

Let

x——-> the distance of the bottom of the ladder from the wall

L——-> the length of the ladder

Find the length of the ladder

Applying the Pythagorean Theorem

L^{2} =x^{2}+ 9^{2} ——> equation 1

Step 2

Second situation

when the ladder will be lying flat on the ground

Find the length of the ladder

In this situation the length of the ladder is equal to

L=x+3

square both sides

L^{2}=(x+3)^{2} ——> equation 2

Step 3

equate equation 1 and equation 2

x^{2}+ 9^{2}=(x+3)^{2}\x^{2}+81=x^{2} +6x+9\ 6x=81-9\6x=72\x=12 ft

therefore

the answer is

the length of the ladder is 12 ft

see the attached figure to better understand the problem