<s>[INST] Calculating point 2P on an elliptic curve The equation for the curve is $$y^2=x^3+ax+b$$ and the point in question is $P(x,y)$. We have to verify that the $x$ coordinate of $2P$ is $(x^4-2ax^2-8bx+a^2)/4y^2$. However, the value I get is $(9x^4+6ax^2-8xy^2+a^2)/4y^2$. I derived the algebraic formula for $2P$ ($x(2P)=m^2-2x)$ and used it to calculate the answer.How do I arrive at the actual answer?
 [/INST] We have:
$$\tag 1 y^2 = x^3 + ax + b$$
To add a point, we have:


*

*$\lambda = \dfrac{3x_1^2 + a}{2 y_1} = \dfrac{3x^2 + a}{2y}$

*$v = y_1 - \lambda x_1 = y-\dfrac{3x^2 + a}{2y}x$

*$x_3 = \lambda^2-x-x = \left(\dfrac{3x^2 + a}{2y}\right)^2-2x = \dfrac{9x^4+6ax^2-8xy^2+a^2}{4y^2}$

*$y_3 = -(\lambda x + v)$ (Calculate this out)


Next, we can substitute $(1)$ into the numerator of $x_3$, yielding:
$$\dfrac{9x^4+6ax^2-8xy^2+a^2}{4y^2} = \dfrac{9x^4+6ax^2-8x(x^3+ax+b)+a^2}{4y^2} = \dfrac{x^4-2ax^2-8bx+a^2}{4y^2}$$
Of course, you could have also done the same substitution in the denominator, but they chose not to.
</s>