This is question of differential equation
The ladder will form a right triangle with the wall and floor
let base of the triangle be x and perpendicular be y
so x² + y² = 15², by Pythagoras
now y=12 when x=9 (given) ,
differentiating x² + y² = 15²
2x dx/dt +2y dy/dt = 0
x dx/dt + y dy/dt = 0
given dx/dt= 4 ft/sec
9*4 + 12 dy/dt = 0
dy/dt = - 3 ft/sec