a.
draw a line from the left end of the 5 unit long line to the base of the triangle, and you will find a rectangle
8(base)=x+5(a property of rectangle)
x=3
b.
20:x+12=4:3(sides of a small triangle is proportional to the respective sides of a larger triangle)
20:x+12=20:15(multiply the same number at both sides of the ratio)
x+12=15(simplify)
x=3