Sorry, the 2 was a mistake (I had originally thought the base of the triangle was just b, not 2b, so the x axis originally went from -b/2 to b/2 and that is where the 2 cropped in), i have corrected my original solution.
I've drawn on the diagram that y = hx/b + h and y = -hx/b + h are the equations of ther lines of th sides of the triangle (using just y=mx+c). rearranging these to make them in terms of x you get:
y-h = +- hx/b
b(y-h) = +- hx
x = +- (b(y-h))/h
the + solution is the left side, the - solution is the right side.