For $a>1$, let $f(x)=\int_{x}^{ax} \sqrt{1-t^2} \,dt\ \left(0\leq x\leq \frac{1}{a}\right).$

(1) Evaluate $f\left(\frac 1{a\right)}+\int_0^{\frac{1}{a}} \sqrt{1-t^2}\ dt.$

(2) Find the value of $M$ such that $f(x)$ has maximum value $M$ at $x=\frac{\sqrt{3}}{2a}.$