Let x=distance of foot of ladder from the wall, then
x+2=height of top of ladder up the wall.
length of ladder = 16 feet.
Using Pythagoras theorem,
x^2+(x+2)^2=16^2, expand and simplify
2x^2+4x+4 = 256 again simplify
x^2+2x-126=0 [fail to factor]
apply quadratic equation:
x=(-2+/-sqrt(4+504))/2
=-1+/-sqrt(127)
x=-12.3 (rejected) or
x=10.27 feet from wall.