Print["Definitions:"]
CS=L*(L+hd)
CS2=CS-(hd+1)
Ms=CS CS2 (hd^2)-2 hd (1+hd) CS2 (r^2) (ω^2)+(((1+hd))^2) (r^4) (ω^4)
α=L+hd/2
Print["Bessel functions to next-to-next-to-leading-order"]
besselj[x_]=Simplify[1-((x^2)/(2*(2α+2)))+((x^4)/(4*2*(2α+2)(2α+4)))]
BesselAssump={j''[x]->FullSimplify[-(((2 α+1)/x)j'[x]+j[x])]}
BesselSub={j[ω r]->besselj[ω r],j'[ω r]->besselj'[ω r]}

Print["Ttt:"]
(Subscript[Ttt, Lω])=(1/(Nld*Omd))∫ (Subscript[N, L])[Om](Subscript[Ttt, ω])[r]\[DifferentialD]Om;
(Subscript[J, SLω])=(Subscript[Ttt, Lω]);
pref=((Nld*Omd (hd+1)(r^(L+hd+3)))/(2 CS));
(Subscript[𝒯, SLω])=Simplify[pref((hd/r)(∂_r)(Subscript[J, SLω])+(ω^2)(Subscript[J, SLω])-((hd(CS-2(hd+1)))/((hd+1)(r^2)))(Subscript[J, SLω]))];
(Subscript[IntegrandQ, SLω])=(Subscript[𝒯, SLω])j[ω r];
FullDerivate=FullSimplify[(∂_r)(pref*(hd/r)* j[ω r] (Subscript[J, SLω]))];
(Subscript[Integrand2Q, SLω])=FullSimplify[(Subscript[IntegrandQ, SLω])-FullDerivate]
(Subscript[Qtt, SLω])=FullSimplify[(Subscript[Integrand2Q, SLω])/.BesselSub]

QLO=Simplify[(Subscript[Qtt, SLω])/.{ω->0}];
QNLO=(ω^2)*Simplify[FullSimplify[(((Subscript[Qtt, SLω])-QLO)/(ω^2))/.{(Subscript[Ttt, ω])[r]->(Subscript[Ttt, 0])[r]}]/.{ω->0}];
QNNLO=(ω^4)*Simplify[FullSimplify[(((Subscript[Qtt, SLω])-QLO-QNLO)/(ω^4))/.{(Subscript[Ttt, ω])[r]->(Subscript[Ttt, 0])[r]}]/.{ω->0}];
CommonFactor=(r^(1+hd+L)) (∫(Subscript[N, L])[Om]\[DifferentialD]Om) (Subscript[Ttt, 0])[r];
LOFactor=QLO/CommonFactor
NLOFactor=QNLO/((ω^2)(r^2)CommonFactor)
NNLOFactor=QNNLO/((ω^4)(r^4)CommonFactor)
LOFactor4d=Simplify[QLO/CommonFactor/.{hd->1}]
NLOFactor4d=Simplify[QNLO/((ω^2)(r^2)CommonFactor)/.{hd->1}]
NNLOFactor4d=Simplify[QNNLO/((ω^4)(r^4)CommonFactor)/.{hd->1}]

Print["Original 4d paper:"]
D4Q=(1/((L+1)(L+2)))(r^(2+L)) (∫(Subscript[N, L])[Om]\[DifferentialD]Om) (Subscript[Ttt, 0])[r]((r^(-L))D[(r^(L+2))besselj[ω r],{r,2}]+(ω^2) (r^2)besselj[ω r]);
D4QLO=Simplify[D4Q/.{ω->0}];
D4QNLO=(ω^2)*Simplify[FullSimplify[((D4Q-D4QLO)/(ω^2))/.{(Subscript[Ttt, ω])[r]->(Subscript[Ttt, 0])[r]}]/.{ω->0}];
D4QNNLO=(ω^4)*Simplify[FullSimplify[((D4Q-D4QLO-D4QNLO)/(ω^4))/.{(Subscript[Ttt, ω])[r]->(Subscript[Ttt, 0])[r]}]/.{ω->0}];
D4LOFactor=D4QLO/Simplify[CommonFactor/.{hd->1}]
D4NLOFactor=D4QNLO/((ω^2)(r^2)Simplify[CommonFactor/.{hd->1}])
D4NNLOFactor=D4QNNLO/((ω^4)(r^4)Simplify[CommonFactor/.{hd->1}])
FullSimplify[D4LOFactor/LOFactor4d]
FullSimplify[D4LOFactor/LOFactor4d]
FullSimplify[D4LOFactor/LOFactor4d]

Print["Ttr:"]
(Subscript[Ttr, Lω])=(1/(Nld*Omd))∫ (Subscript[N, a])[Om](Subscript[N, L])[Om](Subscript[Tta, ω])[r]\[DifferentialD]Om;
(Subscript[Jtr, SLω])=((2I (((hd+1))^2)(ω^3)(r^3))/Ms) (Subscript[Ttr, Lω])+((2I ω)/(r^(hd+1)))(∂_r)((((hd+1)(-hd CS2+(hd+1)(ω^2)(r^2))(r^(hd+3)))/Ms)(Subscript[Ttr, Lω]));
(Subscript[𝒯tr, SLω])=Simplify[pref((hd/r)(∂_r)(Subscript[Jtr, SLω])+(ω^2)(Subscript[Jtr, SLω])-((hd(CS-2(hd+1)))/((hd+1)(r^2)))(Subscript[Jtr, SLω]))];
(Subscript[IntegrandQtr, SLω])=(Subscript[𝒯tr, SLω])j[ω r];
FullDerivatetr1=FullSimplify[(∂_r)(pref*(hd/r)* j[ω r] (Subscript[Jtr, SLω]))];
(Subscript[Integrand2Qtr, SLω])=FullSimplify[(Subscript[IntegrandQtr, SLω])-FullDerivatetr1]
(Subscript[Qtr, SLω])=FullSimplify[Simplify[(Subscript[Integrand2Qtr, SLω])/.{(Subscript[Tta, ω])[r]->(Subscript[Tta, 0])[r]}]/.BesselSub]

CommonFactortr=I ω (r^(1+hd+L)) (∫(Subscript[N, a])[Om](Subscript[N, L])[Om]\[DifferentialD]Om) (Subscript[Tta, 0])[r];
QLOtr=CommonFactortr*Simplify[((Subscript[Qtr, SLω])/CommonFactortr)/.{ω->0}]
QNLOtr=CommonFactortr *(ω^2)*FullSimplify[FullSimplify[(((Subscript[Qtr, SLω])-QLOtr)/(CommonFactortr *(ω^2)))]/.{ω->0}]
QNNLOtr=CommonFactortr *(ω^4)*Simplify[FullSimplify[(((Subscript[Qtr, SLω])-QLOtr-QNLOtr)/(CommonFactortr *(ω^4)))]/.{ω->0}]
LOFactortr=Simplify[(QLOtr/CommonFactortr)]
NLOFactortr=Simplify[(QNLOtr/(CommonFactortr *(ω^2)))]
NNLOFactortr=Simplify[FullSimplify[(QNNLOtr/(CommonFactortr *(ω^4)))]]
LOFactortr4d=Simplify[LOFactortr/.{hd->1}]
NLOFactortr4d=Simplify[NLOFactortr/.{hd->1}]
NNLOFactortr4d=Simplify[NNLOFactortr/.{hd->1}]

Print["Original 4d paper:"]
D4Qtr=(1/((L+1)(L+2)))(r^(2+L)) (∫(Subscript[N, a])[Om](Subscript[N, L])[Om]\[DifferentialD]Om) (Subscript[Tta, 0])[r](-4(r^(-L))D[(r^(L+2))besselj[ω r],r]*I ω )
D4QtrLO=I ω*Simplify[(D4Qtr/(I ω))/.{ω->0}]
D4QtrNLO=I ω*(ω^2)*Simplify[FullSimplify[((D4Qtr-D4QtrLO)/(I ω*(ω^2)))/.{(Subscript[Tta, ω])[r]->(Subscript[Tta, 0])[r]}]/.{ω->0}]
D4QtrNNLO=I ω*(ω^4)*Simplify[FullSimplify[((D4Qtr-D4QtrLO-D4QtrNLO)/(I ω*(ω^4)))/.{(Subscript[Tta, ω])[r]->(Subscript[Tta, 0])[r]}]/.{ω->0}]
D4trLOFactor=D4QtrLO/(Simplify[CommonFactortr/.{hd->1}])
D4trNLOFactor=D4QtrNLO/((ω^2)(r^2)Simplify[CommonFactortr/.{hd->1}])
D4trNNLOFactor=D4QtrNNLO/((ω^4)(r^4)Simplify[CommonFactortr/.{hd->1}])
FullSimplify[D4trLOFactor/LOFactortr4d]
FullSimplify[D4trLOFactor/LOFactortr4d]
FullSimplify[D4trLOFactor/LOFactortr4d]