Solution (source code)

= Solution

Use the <two-descent on an elliptic curve> map associated with the three rational roots $0,-1,-4$,
$$
\delta:E(\mathbb Q)/2E(\mathbb Q)longrightarrow
(\mathbb Q^\times/\mathbb Q^{\times2})^2,
\qquad
(x,y)\longmapsto(x,x+1),
$$
with the standard limiting values at the <2-torsion>. Only the square classes of $-1$, $2$ and $3$ can occur, because all other numerator and denominator valuations in the three factors $x,x+1,x+4$ are even. Checking solubility over $\mathbb R$, $\mathbb Q_2$ and $\mathbb Q_3$ leaves exactly
$$
\operatorname{im}\delta
=\{(1,1),(-1,-3),(-2,-1),(2,3)\}.
$$
These four classes are represented respectively by $O$, $P_1$, $P_2$ and $P_1+P_2$. Thus $|E(\mathbb Q)/2E(\mathbb Q)|=4$. Since part (b) gives
$$
E(\mathbb Q)\cong\mathbb Z^r\oplus\mathbb Z/4\mathbb Z\oplus\mathbb Z/2\mathbb Z,
$$
the quotient by doubling has order $2^{r+2}$. Therefore
$$
\boxed{\operatorname{rank}E(\mathbb Q)=0.}
$$