<s>[INST] Maximizing a polynomial expression involving the sidelengths of an inscribed pentagon 
Given that $ABCDE$ is a convex pentagon and is inscribed in a circle of radius $1$ unit with $AE$ as diameter. If $AB=a,BC=b ,CD=c$ and $DE=d$, then maximum possible integral value of $a^2+b^2+c^2+d^2+abc+bcd$ is ?

What I tried
$AE =2$ , I joined points to form lines $BE,AC,CE$ and $AD$ and tried to use the fact that angle subtended by diameter would be a right angle.
However, I was unable to solve the problem. 
I was looking for some hint or an alternate approach to the problem.
 [/INST] In quadrilateral $ABCE$ By Ptolemy's theorem
$$2b+av=(\sqrt {4-a^2})u$$ 
And similarly in quadrilateral $CDEA$ 
$$2c+du=(\sqrt {4-d^2})v$$
On squaring these equations and adding them we get $$4b^2+a^2v^2+4abv+4c^2+d^2u^2+4cdu$$
$$=4u^2-a^2u^2+4v^2-v^2d^2$$
Which simplifies to 
$$4(b^2+c^2)+(a^2+d^2)(u^2+v^2)+4(abv+cdu)=4(u^2+v^2)$$
By Pythagoras theorem we get $$u^2+v^2=4$$
Hence the obtained expression simplifies to $$a^2+b^2+c^2+d^2+(abv+cdu)=4$$
In triangle $ABC$ and triangle $CDE$ , By triangle inequality we get $u\lt (a+b)$ and $v\lt (c+d)$
Using all these expressions and inequalities we get 
$$a^2+b^2+c^2+d^2+abc+bcd+ ad(b+c)\lt 4$$
Now by AM-GM we have 
$$\frac{a+b+c+d}{3}\ge.\sqrt[3] {ad(b+c)}$$
Hence 
$$ad(b+c)\le (\frac{a+b+c+d}{3})^3$$
We have triangle inequalities 
 $$u\lt (a+b)$$ $$v\lt (c+d)$$ $$u+v\gt 2$$
Using the result of AM GM and these inequalities we get 
$$a^2+b^2+c^2+d^2+abc+bcd\lt \frac{100}{27}$$
Hence the integral value is 3

</s>