Suppose I have solved a system of equations, resulting in a solution of the form:
sol = {{f[a1] -> SomeComplicatedFunction[x, a1]}, {f[a2] -> SomeComplicatedFunction[x, a2]}, {f[a3] -> SomeComplicatedFunction[x, a3]}}
I want to use the list of substitutions sol
later on, but first I want to apply some method myFunction
to the rhs of the substitution. I.e., the desired output is
sol = {{f[a1] -> myFunction[SomeComplicatedFunction[x, a1]]}, {f[a2] -> myFunction[SomeComplicatedFunction[x, a2]]}, {f[a3] -> myFunction[SomeComplicatedFunction[x, a3]]}}
I have tried extracting all the RHSs from sol
, applying myFunction
to the list, then setting this back to the original f[]
s, but this seems to be very inefficient. Is there some canonical Mathematica way of applying rules to solutions while keeping the solutions intact?