As Ey=Ez=0 so only faces along x-axis will contribute the flux through the cube.
Entering flux through the face at x=a is ϕin=Ex.a2=b√x.a2=b√a.a2=ba5/2
Outgoing flux through the face at x=2a is ϕout=Ex.a2=b√2a.a2=b√2a.a2=ba5/2√2
Thus , net flux through the cube is ϕ=ϕout−ϕin=ba5/2√2−ba5/2=ba5/2(√2−1)