Solution (source code)

= Solution

On $y^2=x^3+5x^2+4x$, the slope through $P_1=(-1,0)$ and $P_2=(-2,2)$ is $-2$. The <elliptic-curve addition formula> gives
$$
x(P_1+P_2)=(-2)^2-5-(-1)-(-2)=2,
\qquad y(P_1+P_2)=(-2)(-1-2)=6.
$$
For doubling $P_2$, the tangent slope is
$$
\lambda=\frac{3x^2+10x+4}{2y}\bigg|_{(-2,2)}=-1,
$$
and hence
$$
\boxed{P_1+P_2=(2,6),\qquad 2P_2=(0,0).}
$$