How to find the minimum of $abcd+\sqrt{(a^2+1)(b^2+1)(c^2+1)(d^2+1)}$ when $ab+bc+cd+da+ac+bd=6$ If $a,b,c,d\geq0$ are such that $ab+bc+cd+da+ac+bd=6$, then what is the minimum value of $$f(a,b,c,d)=abcd+\sqrt{(a^2+1)(b^2+1)(c^2+1)(d^2+1)}$$ ?
My attempts: I think the minimum $5$ is obtained at $a=b=c=d=1$. I tried the Hölder inequality: $$f(a,b,c,d)\geq abcd + (1+\sqrt{a b c d})^2,$$ but the last term is $1<5$ for $d=0$.
Also, direct AM-GM on the two terms of $f$ did not work either. What to do?
Remark: This problem is from AoPS. There, it is also asked what happens for $ab+bc+cd+da+ac+bd=7$, which seems even harder.

Preliminary remark. I just noticed that we can use the square root algorithm for polynomials to show in general that $$(a^2 + 1) (b^2 + 1) (c^2 + 1) (d^2 + 1) - (a b + b c + c d + d a + 
    a c + b d - a b c d - 1)^2=(a + b + c +d- a b c - a b d - a c d - b c d)^2\geq0$$
which immediately implies that $f(a,b,c,d)+1\geq a b + b c + c d + d a + 
    a c + b d$ for all $a,b,c,d\geq0$ with equality if and only if $$d=\frac{a+b+c-abc}{a b+a c+b c-1}.$$
But I noticed this too late, so here is some tedious manual work for you, which basically executes the above idea for the special cases $a b + b c + c d + d a + 
    a c + b d=6$ and $7$.

Tedious calculations:
Indeed the minimum is achieved at $5$. We need to prove $$\sqrt{(a^2+1)(b^2+1)(c^2+1)(d^2+1)}\geq 5-abcd.$$ By direct AM-GM, we get $6=ab+bc+cd+da+ac+bd\geq 6\sqrt{abcd}$ so that $abcd\le1<5$. So we can square both sides of the inequality to prove and we now have to prove $$(a^2+1)(b^2+1)(c^2+1)(d^2+1)\geq(5-abcd)^2.$$ Since $6=ab+bc+cd+da+ac+bd$, we get $d=\frac{6-a b-a c-b c}{a+b+c}$ and so we have to prove $$\left(a^2+1\right) \left(b^2+1\right) \left(c^2+1\right) \left(\frac{(-a b-a c-b
   c+6)^2}{(a+b+c)^2}+1\right)-\left(5-\frac{a b c (-a b-a c-b
   c+6)}{a+b+c}\right)^2\geq0$$
which is true because the left-hand side (amazingly!) equals $$\frac{\left(6 + a^2 - 5 a b + b^2 + a^2 b^2 - 5 a c - 5 b c + a^2 b c + 
 a b^2 c + c^2 + a^2 c^2 + a b c^2 + b^2 c^2\right)^2}{(a+b+c)^2}.$$

If we replace the condition by $7=ab+bc+cd+da+ac+bd$, a very similar approach works: Indeed I claim that the minimum of $f(a,b,c,d)$ is $6$ with that side constraint. Again by direct AM-GM, $a b c d \le \left(\frac{ab+bc+cd+da+ac+bd}6\right)^2=\frac{49}{36}<6$ so we can subtract $abcd$, square both sides, and need to prove $$(1 + a^2) (1 + b^2) (1 + c^2) (1 + d^2)-(6 - a b c d)^2\geq 0.$$
By the side constraint we have $d=\frac{7-a b-a c-b c}{a+b+c}$. Substituting this we need to prove $$\left(a^2+1\right) \left(b^2+1\right) \left(c^2+1\right) \left(\frac{(-a b-a c-b
   c+7)^2}{(a+b+c)^2}+1\right)-\left(6-\frac{a b c (-a b-a c-b
   c+7)}{a+b+c}\right)^2\geq 0.$$
But very nicely, the left-hand side can again be written as $$\frac{\left(7 + a^2 - 6 a b + b^2 + a^2 b^2 - 6 a c - 6 b c + a^2 b c + 
 a b^2 c + c^2 + a^2 c^2 + a b c^2 + b^2 c^2\right)^2}{(a+b+c)^2}.$$
We have equality if and only if the side constraint is fulfilled and $$7 + a^2 - 6 a b + b^2 + a^2 b^2 - 6 a c - 6 b c + a^2 b c + 
 a b^2 c + c^2 + a^2 c^2 + a b c^2 + b^2 c^2=0.$$
Note that this is a quadratic polynomial in each variable if the other variables are fixed. So for given $a$ and given $b$, we can solve for $c$. As an example, $a=1,b=1,c=\frac12$ leads to $d=2$ and indeed equality as $$f\left(1,1,\frac12,2\right)=6.$$

