Help solving a limit
First note that $a>0$.
If $a<0$, then $$\lim_{x \rightarrow a} \frac{x^2-\sqrt{a^3x}}{\sqrt{ax}-a} = \frac{a^2 - a^2}{-a-a} = 0$$
If $a=0$, then $\lim_{x \rightarrow a} \frac{x^2-\sqrt{a^3x}}{\sqrt{ax}-a}$ doesn't exist.
Hence, $a>0$.
Let $\sqrt{ax}=y$ i.e. $x = \frac{y^2}{a}$. Note that as $x \rightarrow a$, $y \rightarrow a$.
Hence, $$\lim_{x \rightarrow a} \frac{x^2-\sqrt{a^3x}}{\sqrt{ax}-a} = \lim_{y \rightarrow a} \frac{y}{a^2} \frac{y^3-a^3}{y-a} = \frac{3a^2}{a} = 3a$$
Hence, $a=4$
Besides L'Hopital one can simply rationalize the denominator, after discarding case $\rm\:a \le 0\:,\:$ viz:
$$\rm \frac{x^2-a\sqrt{ax}}{\sqrt{ax}-a}\ =\ \frac{x^2-a\sqrt{ax}}{\sqrt{ax}-a} \ \frac{\sqrt{ax}+a}{\sqrt{ax}+a}\ =\ \frac{ax\:(x-a)+\sqrt{ax}\ (x^2-a^2) }{a\:(x-a) }\ =\ x+(x+a)\sqrt{\frac{x}{a}}$$
Since the above $\rm\to 3\ a\ $ as $\rm\ x\to a\ $ the problem reduces to solving $\rm\ 3\ a = 12\:$.