I'm doing calculations about elliptic curve, which involve the sum of two rational points and birational transformation. I need help regarding the symbolic substitution below, where $u,d,x,y$ are rational numbers.
Define $f$ (birational transformation) such that $$(u,d)=f(x,y)=\left(\dfrac{2(y-x)}{y-2x+12}, \dfrac{2(xy-4y-2x^2+16x)}{(y-2x+12)^2}\right),$$ it can be verified $f$ has an inverse: $$(x,y)=f^{-1}(u,d)=\left(\dfrac{6d+2u}{(u-2)^2}, \dfrac{12d(u-1)-12u^3+52u^2-52u}{(u-2)^3}\right),$$ this inverse only works for $(x,y)$ satisfying $y^2=x^3-20x^2+108x$.
Define another function $g$ (sum of rational points) such that $$g(x,y)=\left(\dfrac{-24y+6x^2-96x+648}{(x-6)^2}, \dfrac{24(y-12)(x+y-18)}{(x-6)^3}-12\right)$$
I need help to compute $f(g(f^{-1}(u,d)))$. I've tried using WolframAlpha, but it can only perform calculations up until $g\circ f^{-1}$, now the symbols are too complicated, the calculator can't understand. I don't have MATLAB because it is expensive for me, so if you can use MATLAB to perform this calculation then it is great!
Motivation: The point $(x,y)$ satisfies the elliptic curve $y^2=x^3-20x^2+108x$, one solution to the curve is $(6,12)$, the transformation $g$ is the result of binary operation: $g(x,y)=(x,y)+(6,12)$. The binary operation I'm using here is from the group of rational points of the elliptic curve, where the point at infinity is the identity.
After knowing a solution $(x,y)$ to the elliptic curve, I have a transformation $f$ to obtain $(u,d)$. If we know $(u,d)$, the inverse $f^{-1}$ can also take it back to $(x,y)$. My main goal is to find a formula so that if we know $(u,d)$ corresponding to $(x,y)$, let $(U,D)$ to be corresponding to $(x,y)+(6,12)$, then use $u,d$ to express $(U,D)$. Then I find out that $(U,D)=f(g(f^{-1}(u,d)))$.
1st Edit: For some reason, the inverse formula $f^{-1}$ only works for $(x,y)$ which satisfies the elliptic curve's equation $y^2=x^3-20x^2+108x$. It is because some $y^2$ are changed to $x^3-20x^2+108x$ which makes other points $(x,y)$ not on the elliptic curve fail the substitution of inverse.
2nd Edit: I should apologize for not being clear about the relation between $u,d$. The relation is a quadratic equation in $d$: $$3d^2+(22u-6u^2-18)d+u(u-1)(u-2)(u-3)=0.$$ Why is this relation makes sense? I'm doing research whenever there are complex solution $(a,b,c)$ such that $$a+b+c, a^2+b^2+c^2, a^3+b^3+c^3, a^4+b^4+c^4$$ forms an arithmetic sequence. I'm very curious about rational arithmetic sequence, so I define the first term as $u$, common difference as $d$, then their relation can be derived from here. Since I wanted $d$ to be rational number, it requires the discriminant to be the square of some rational number. This then becomes a question regarding elliptic curve.
Here is the sage code giving the result:
Note:
$f$ is a birational transfromation. Between curves. Between which curves? This would be very useful for checking this answer, and for understanding what and why i did. One curve is given, the points $(x,y)$ that appear on the road are constrained to satisfy $y^2=x^3-20x^2+108x$. (If there is also a known formula for the other curve, and if this is no longer kept as a secret, the code above can be adapted to deliver a simpler formula useful for both of us and the community.)