<s>[INST] Minimum of $\newcommand{\b}[1]{\bigl(#1\bigr)} \newcommand{\f}{\frac} \b{\f3a-1}^2+\b{\f ab-1}^2+\b{\f bc-1}^2+(3c-1)^2$ The minimum of :
$$\newcommand{\b}[1]{\left(#1\right)}
\newcommand{\f}{\frac}
\b{\f3a-1}^2+\b{\f ab-1}^2+\b{\f bc-1}^2+(3c-1)^2$$ where $0<a,b,c\le9$, is $p-q\sqrt{r}$; $p,q,r\in\mathbb Z$ and $q,r$ are co-primes, then $(p+q+r)$ is equal to?

I tried expand and AM-GM but what to do about negative terms?

 [/INST] USe Cauchy-Schwarz inequality we have
$$x^2+y^2+z^2+w^2\ge\dfrac{1}{4}(x+y+z+w)^2$$
so
$$LHS\ge \dfrac{1}{4}\left(\dfrac{3}{a}+\dfrac{a}{b}+\dfrac{b}{c}+3c-4\right)^2$$
and Use AM-GM inequality we have
$$\dfrac{3}{a}+\dfrac{a}{b}+\dfrac{b}{c}+3c\ge 4\sqrt[4]{\dfrac{3}{a}\cdot\dfrac{a}{b}\cdot\dfrac{b}{c}\cdot 3c}= 4\sqrt[4]{9}=4\sqrt{3}$$
so
$$LHS\ge 4(\sqrt{3}-1)^2=16-8\sqrt{3}$$
if and only if
$$\dfrac{3}{a}=\dfrac{a}{b}=\dfrac{b}{c}=3c=\sqrt{3}\Longrightarrow a=\sqrt{3},b=1,c=\dfrac{\sqrt{3}}{3}$$
</s>