# ReplaceAll Not Working Correctly

I'm trying to use replaceall to redefine my expression in terms of a separate variable..

a1GA = -Coefficient[detJGA, l,6] /. {((1 + \[Gamma])*ga*Daa^(1/(2*ga + ba)) - ga) -> \[Zeta]}


This prints out 7 - ga + Daa^(1/(ba + 2 ga)) ga (1 + \[Gamma]) when it should give 7 + \[Zeta]

Is there anything I can do to help replaceall recognize that this expression is equivalent to what I want in terms of the variable zeta? Thank you!

Here is some more context regarding detJGA. The replaceall does work to introduce phi..:

detJGA = Collect[Det[JGA], l ,Simplify] /. {Dab*(Daa^(-1/(2*ga + ba)) - \[Gamma])^(2*gb + bb) -> x}


detJGA = detJGA /. {x -> 1 - \[Phi]}

This outputs my detJGA: 

l^7 + l^6 (-7 + ga - Daa^(1/(ba + 2 ga)) ga (1 + \[Gamma])) +
l^5 (-21 - (6 + Daa (Daa^(-(1/(ba + 2 ga))))^(ba + 2 ga)) ga (-1 +
Daa^(1/(ba + 2 ga)) (1 + \[Gamma]))) +
l^4 (-34 + 15 ga +
Daa (Daa^(-(1/(ba + 2 ga))))^(ba + 2 ga) (1 + 6 ga) -
15 Daa^(1/(ba + 2 ga)) ga (1 + \[Gamma]) -
6 Daa^(1 + 1/(ba + 2 ga)) (Daa^(-(1/(ba + 2 ga))))^(ba + 2 ga)
ga (1 + \[Gamma]) - \[Phi]) - (1 - ga -
Daa (Daa^(-(1/(ba + 2 ga))))^(ba + 2 ga) (1 + ba + ga) +
Daa^(1/(ba + 2 ga)) ga (1 + \[Gamma]) +
Daa^(1 + 1/(ba + 2 ga)) (Daa^(-(1/(ba + 2 ga))))^(
ba + 2 ga) (ba + ga) (1 + \[Gamma])) \[Phi] +
l^3 (-35 +
Daa (Daa^(-(1/(ba + 2 ga))))^(ba + 2 ga) (4 + ba + 13 ga) -
Daa^(1 + 1/(ba + 2 ga)) (Daa^(-(1/(ba + 2 ga))))^(
ba + 2 ga) (ba + 13 ga) (1 + \[Gamma]) +
Daa^(1/(ba + 2 ga)) ga (1 + \[Gamma]) (-19 - \[Phi]) +
4 (1 - \[Phi]) + ga (19 + \[Phi])) +
l (-7 + ga (6 - 3 (1 - \[Phi])) +
3 Daa^(1/(ba + 2 ga)) ga (1 + \[Gamma]) (-1 - \[Phi]) +
4 (1 - \[Phi]) +
Daa (Daa^(-(1/(ba + 2 ga))))^(
ba + 2 ga) (3 + 3 ba + ga (6 - 3 (1 - \[Phi])) + \[Phi]) -
3 Daa^(1 + 1/(ba + 2 ga)) (Daa^(-(1/(ba + 2 ga))))^(
ba + 2 ga) (1 + \[Gamma]) (ba + ga (1 + \[Phi]))) +
l^2 (-3 (7 + ga (-4 - \[Phi]) - 2 (1 - \[Phi])) +
3 Daa^(1/(ba + 2 ga)) ga (1 + \[Gamma]) (-4 - \[Phi]) -
Daa^(1 + 1/(ba + 2 ga)) (Daa^(-(1/(ba + 2 ga))))^(
ba + 2 ga) (1 + \[Gamma]) (3 ba + ga (12 + \[Phi])) +
Daa (Daa^(-(1/(ba + 2 ga))))^(
ba + 2 ga) (6 + 3 ba + ga (12 + \[Phi])))

• Welcome! What is detJGA? Please, give complete example so that people can reproduce your issue and think about solution. – Alx Nov 12 '19 at 1:28
• I tried your first replacement and have obtained 7 + \[Zeta]` as you expect. My assumption is that Mma remembered some assignments that you have done earlier. If yes, it helps if you clear all variables prior to evaluating detJGA. – Alexei Boulbitch Nov 12 '19 at 10:00