Question: Replacing placeholder names in nested RootOfs

Is there an easier or shorter way to do the following? Any handy package command?

RootOf(-(Int(1/sqrt(2*cos(_a)+RootOf(-(Int(1/sqrt(2*cos(_a)+_Z), _a = 0 .. Pi))+_a+c__2)), _a = 0 .. _Z))+x+c__2)

RootOf(-(Int(1/(2*cos(_a)+RootOf(-(Int(1/(2*cos(_a)+_Z)^(1/2), _a = 0 .. Pi))+_a+c__2))^(1/2), _a = 0 .. _Z))+x+c__2)

(1)

indets(RootOf(-(Int(1/(2*cos(_a)+RootOf(-(Int(1/(2*cos(_a)+_Z)^(1/2), _a = 0 .. Pi))+_a+c__2))^(1/2), _a = 0 .. _Z))+x+c__2), 'specfunc(anything, RootOf)')

{RootOf(-(Int(1/(2*cos(_a)+_Z)^(1/2), _a = 0 .. Pi))+_a+c__2), RootOf(-(Int(1/(2*cos(_a)+RootOf(-(Int(1/(2*cos(_a)+_Z)^(1/2), _a = 0 .. Pi))+_a+c__2))^(1/2), _a = 0 .. _Z))+x+c__2)}

(2)

subs(_a = _b, {RootOf(-(Int(1/(2*cos(_a)+_Z)^(1/2), _a = 0 .. Pi))+_a+c__2), RootOf(-(Int(1/(2*cos(_a)+RootOf(-(Int(1/(2*cos(_a)+_Z)^(1/2), _a = 0 .. Pi))+_a+c__2))^(1/2), _a = 0 .. _Z))+x+c__2)}[1])

RootOf(-(Int(1/(2*cos(_b)+_Z)^(1/2), _b = 0 .. Pi))+_b+c__2)

(3)

subs({RootOf(-(Int(1/(2*cos(_a)+_Z)^(1/2), _a = 0 .. Pi))+_a+c__2), RootOf(-(Int(1/(2*cos(_a)+RootOf(-(Int(1/(2*cos(_a)+_Z)^(1/2), _a = 0 .. Pi))+_a+c__2))^(1/2), _a = 0 .. _Z))+x+c__2)}[1] = RootOf(-(Int(1/(2*cos(_b)+_Z)^(1/2), _b = 0 .. Pi))+_b+c__2), RootOf(-(Int(1/(2*cos(_a)+RootOf(-(Int(1/(2*cos(_a)+_Z)^(1/2), _a = 0 .. Pi))+_a+c__2))^(1/2), _a = 0 .. _Z))+x+c__2))

RootOf(-(Int(1/(2*cos(_a)+RootOf(-(Int(1/(2*cos(_b)+_Z)^(1/2), _b = 0 .. Pi))+_b+c__2))^(1/2), _a = 0 .. _Z))+x+c__2)

(4)

NULL

Related question: Is that substitution mathematically correct or does the _a belong to the outermost RootOf?

Download parameters_in_nested_RootOf.mw

Please Wait...