Just use the Pythagorean theorem.
a^2 + b^2 = c^2
4^2 + x^2 = (2x-1)^2
16+x^2=(2x-1)(2x-1)
16+x^2=4x^2-4x+1
0=3x^2-4x-15
0=(3x+5)(x-3)
3x+5=0 x-3=0
3x= -5 x=3
x= -5/3 x=3
Since x can't be a negative number when it comes to distance or the length of a triangle, the answer must be x=3.