If the upright tree broke x feet from its base then the part that fell has a length 18-x. The triangle formed by the fallen tree obeys Pythagoras: x^2+12^2=(18-x)^2, x^2+144=324-36x+x^2, so 144=324-36x, x=(324-144)/36=180/36=5. So the tree broke 5 feet from its base.