terms in trigonometric functions must be dimensionless, so x, a have same dimensions. on left hand side(LHS) if we take root of the dimension we will have same units as that of dx so now LHS is dimensionless RHS must be dimensionless. so power 'n' of 'a' must be zero.