First, if the question does not already have one, draw a diagram.

Area of a rectangle is base * height and area of a triangle is 1/2 * base * height. As the two areas are the same, you know you can set the two formulas for areas equal to one another, so:

base_{rectangle}*height_{rectangle} = 0.5 * base_{triangle} * height_{triangle}

Substitute in the given dimensions, being sure to keep the brackets, so: 3 * (4+x) = 0.5 * 2x * 4

Multiply out the brackets on the left hand side and simplfy the right hand side to get: 12+3x = 4x

Rearrange the formula to get all the x terms on one side (minus 3x from both sides), so that x=12.