(Number of items bought)*(Cost per item) = Cost
Let c = the Cost per item:
3x articles cost $( 7x+2):
3x*c = 7x+2
c = (7x+2)/3x
4(x+1) of the same articles cost $(12x+2) (=2(6x+1)):
4(x+1)*c = 2(6x+1)
c = 2(6x+1)/4(x+1) = (6x+1)/2(x+1)
Since the cost per item, c, is the same, set the two c equations equal:
(7x+2)/3x = (6x+1)/2(x+1)
(7x+2)*2(x+1) = (6x+1)*3x
14x2 + 14x + 4x + 4 = 18x2 + 3x
0 = 4x2 - 15x - 4
0 = (4x+1)(x-4)
x = -1/4 and 4
Since you can't purchase -1/4 of an item, x = 4.