I'm trying to automatically generate the Christoffel Symbol in Mathematica. I'm starting with the formulas:
X[r_, theta_] := r*Cos[theta];
Y[r_, theta_] := r*Sin[theta];
R[x_, y_] := Sqrt[x^2 + y^2];
Theta[x_, y_] := ArcTan[x, y];
Now, without trying to analyze the equations, I'm trying to implement this in Mathematica. So far I have:
D[D[X[r, theta], r], r]*D[R[x, y], x] + D[D[Y[r, theta], r], r]*D[R[x, y], y]
D[D[X[r, theta], r], theta]*D[R[x, y], x] + D[D[Y[r, theta], r], theta]*D[R[x, y], y]
Which results in this:
0
(y Cos[theta])/Sqrt[x^2 + y^2] - (x Sin[theta])/Sqrt[x^2 + y^2]
Now I know that I can reduce the second result using the fact that $y=r\space Sin[theta]$ and $x=r\space Cos[theta]$ and $r=\sqrt{x^2+y^2}$, but I want Mathematica to make the reduction for me. How do I go about telling Mathematica to reduce this equation (hint: the result should be 0)?
xandy:expr /. {y -> Y[r, theta], x -> X[r, theta]}. – Alx Dec 20 '19 at 23:55