@allamraju - You can't use calculus here as it's based on dimension analysis, though your method is correct.
the quantity dx/sqrt(2ax - x^2)
Dimension of dx = L, dimensions of a,x = L
So the quantity dx/sqrt(2ax - x^2) is dimensionless.
So, the RHS has to be dimensionless. As arc sin is always dimensionless, its coefficient must be dimensionless, hence, n = 0. (If n = 1, the dimension on RHS = L, and if n=2, dimension on RHS = L^2 and so on, which is not dimensionally homogenous)