Energy gain of electron beams in bubble regime of the laser wakefield accelerator can be optimized by improving the acceleration length, radial accelerating and focusing force, number of monoenergetic electrons trapped inside the bubble, and increasing dephasing length. In order to enlarge the dephasing length, the phase velocity of the plasma wave can be increased by optimizing the plasma density profile. We report the estimation of dephasing length using plasma density distribution with the flat and linear-upward profile using two-dimensional particle-in-cell simulations. The size of wakefield bubble depends on the plasma density. With a positive plasma density gradient, the size of bubble decreases. The front and trail part of wake bubble will have different phase velocity in plasma density gradient region. After density transition in constant density region, the bubble elongates and the velocity of the back part of the bubble increases so that the accelerated electron phase synchronizes with the phase of the plasma wave. In a result, the electron acceleration length enhances to improve the beam quality.