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.

We will use the fact: If a bunch of circular chords can be packed to "fit" a half-circle, so do any rearrangement of them.

Let $\mathcal{E} = a^2+b^2+c^2+d^2 + bc(a+d)$ be the expression at hand.
Choose points $P, Q, R$ on the half-circle such that
$AP = b$, $PQ = c$, $QR = a$, $RE = d$.
Let $u = AQ$, $v = QE$ and $\angle QEA = \theta$. When either $u$ or $v$ vanishes,  $bc(a+d)$ also vanishes. It is easy to see $\mathcal{E}$ trivially reduces to $4$. This means we only need to consider the case $u, v \ne 0$.
Since $AE$ is a diameter of the half circle, $\angle AQE = \frac{\pi}{2}$. This leads to $u^2 + v^2 = 4$ and $v = 2\cos\theta$. The condition $v \ne 0$ implies $u \ne 2$.
Since $\angle APQ$ and $\angle QEA$ are opposite angles of cyclic quadrilateral $APQE$, these two angles sum to $\pi$. Apply cosine rule to triangle $APQ$, we find
$$\frac{b^2 + c^2 - u^2}{2bc} = \cos(\pi - \theta) = -\cos\theta = -\frac{v}{2}$$
This leads to
$$b^2 + c^2 + vbc = u^2\tag{*1a}$$
By a similar argument, we have
$$a^2 + d^2 + uad = v^2\tag{*1b}$$
Use these, we can rewrite the expression at hand as
$$\begin{align}
\mathcal{E} &=  (a^2+ d^2) + (b^2+c^2) + bc(a+d)\\
&= (v^2 - uad) + (u^2-vbc) + bc(a+d)\\
&= 4 + bc(a+d-v) - uad\tag{*2}
\end{align}$$
To bound $\mathcal{E}$ from below and above, we look at two sub-problems.
We fix $a, d$ and then either minimize or maximize $\mathcal{E}$ by varying $b,c$ alone. When $a, d$ are fixed, so do $u, v$. Apply triangle inequality to triangle $QRE$, we have $a + d - v \ge 0$. 
The sub-problem of minimizing $\mathcal{E}$ becomes easy, we just set either $b$ or $c$ to $0$ and get $$4 - uad \le \mathcal{E}$$
For non-degenerate configurations, $bc(a+d-v) > 0$ and above inequality becomes strict. It is easy to show $uad \le 1$ using the concavity of $\log\sin x$. In general, we have:
$$3 \le \mathcal{E}$$
and the inequality becomes strict for non-degenerate configurations.
For the sub-problem of maximizing $\mathcal{E}$, we need $bc$ as large as possible. Introduce variables $p, q$ such that $b+c = p$, $b-c = q$, condition $(*1a)$ becomes
$$\frac{p^2+q^2}{2} + v\frac{p^2-q^2}{4} = u^2
\quad\iff\quad (2+v)p^2 + (2-v)q^2 = 4u^2
$$
Notice
$$bc = \frac{p^2-q^2}{4}
= \frac{1}{4(2+v)}((2+v)p^2-(2+v)q^2) = 
\frac{1}{2+v}(u^2 - q^2)$$
For this sub problem, $\mathcal{E}$ is maximized when $q = 0$. 
When $q = 0$, $b = c$ and their common value satisfies:
$$b^2(2+v) = c^2(2+v) = u^2 \implies b^2 = c^2 = \frac{u^2}{2+v} = 2 - v$$
As a result, we find
$$\mathcal{E} \le 4 + (2-v)(a+d - v) - uad$$
Introduce variables $a + d = r, a - d = s$, condition $(*1b)$ becomes
$$\frac{r^2+s^2}{2} + u\frac{r^2-s^2}{4} = v^2
\quad\iff\quad (2+u)r^2 + (2-u)s^2 = 4v^2$$
We find
$$ad = \frac{r^2-s^2}{4} = \frac{1}{4(2-u)}((2-u)r^2 - (2-u)s^2)
= \frac{1}{2-u}(r^2-v^2)
$$
and the inequality becomes
$$\mathcal{E} \le 4 + (2-v)(r-v) - \frac{u}{2-u}(r^2-v^2)
= 4 + \frac{r-v}{2-u}\left[(2-u)(2-v) - u(r+v)\right]\\
= 4 - \frac{r-v}{2-u}\left[2(u+v-2) + ur\right]
$$
Apply triangle inequality to triangle $AQE$, we have $u + v - 2 \ge 0$.
Together with $r - v = a + d - v \ge 0$, this leads to
$$\frac{r-v}{2-u}\left[2(u+v-2)+ur\right] \ge 0 \quad\implies\quad \mathcal{E} \le 4
$$
If one look at last inequality carefully, we find it is strict unless
$$(r - v = 0) \lor ( u+v-2 = 0 \land ( u = 0 \lor r = 0 ))$$
The case $r = 0$ can be ruled out because it contradict with our assumption $v \ne 0 $. We can simplify last condition to
$$a + d = v \lor u = 0$$
In both cases, the configuration is degenerate (i.e at least one of $a,b,c,d$ vanishes). 
Combine these two bounds, we can conclude
$$3 \le \mathcal{E} \le 4$$
For non-degenerate configurations, we can strengthen this to $3 < \mathcal{E} < 4$.
So the answer to the original question "What is the maximum possible integral value of $\mathcal{E}$?" is $4$ for generate configurations and doesn't exist for non-degenerate configurations.
