Dear student,
Here, do not assume x and a to be displacement or acceleration, respectively. Had this been the case, 1(dimensionless) could not be subtracted from the term

on the right hand side.
All we can know from this term is that the dimensions of x and a are the same. Also, rightly said, the term inside

must be dimensionless. Hence the dimensions of the right hand side is that of

.
The denominator of the integral term has dimensions of that of x or a. The numerator has that of

or

, making the overall term have dimensions of x or a.
Since the dimensions of RHS and LHS must be same, the dimensions of

is equal to that of a. Hence n=1.