Let $a,b,c,d$ be four real numbers satisfying $$\sum a:=a+b+c+d=8,$$ $$\sum ab:=ab+ac+ad+bc+bd+cd=12.$$ What is the maximum possible value of $d$?
I tried writing $a+b+c=-d+8$ and $ab+bc+ca=12-(a+b+c)d=d^2-8d+12$ so that the cubic polynomial $$P(t):=t^3+(d-8)t^2+(d^2-8d+12)t-abc$$ has three real (not necessarily distinct) roots. This is equivalent to the fact that the discriminant of $P(t)$ is non-negative, but the discriminant is so complicated and has many terms involving $abc$, which makes it difficult to obtain conditions on $d$.
I believe that this problem is from some olympiad-style contest, so there should be an elementary solution for it. Any advice is welcome.
$$12=ab+ac+bc+d(8-d)\leq\frac{(a+b+c)^2}{3}+d(8-d)=\frac{(8-d)^2}{3}+d(8-d).$$ Thus, $$36\leq64-16d+d^2+24d-3d^2$$ or $$d^2-4d-14\leq0$$ or $$(d-2)^2\leq18,$$ which gives $$d\leq2+3\sqrt2.$$ The equality occurs for $a=b=c,$ which says that we got a maximal value.