There is a similar post: How to specify the domain of a variable?, but it doesn't work well for me.
I want to evaluate the integral below, with a parameter $\gamma$. The result is obviously different depending on $\gamma>1/2$ or $\gamma<1/2$. I tried the "AddAssumption" method in that post, but it doesn't work out. It gives the result for $\gamma<1/2$ either way.
$Assumptions = True AddAssumption[assumption_] := $Assumptions = DeleteDuplicates[$Assumptions && assumption] AddAssumption[\[Gamma] > 1/2] Integrate[1/(\[Gamma] + 1/2 Cos[2 \[Phi]]), \[Phi]]
Integrate[1/(\[Gamma] + 1/2 Cos[2 \[Phi]]), \[Phi]]which produces a generic answer $$-\frac{2 \tanh ^{-1}\left(\frac{(2 \gamma -1) \tan (\phi )}{\sqrt{1-4 \gamma ^2}}\right)}{\sqrt{1-4 \gamma ^2}}$$ $\endgroup$Simplify[D[-((2 ArcTanh[((-1 + 2 \[Gamma]) Tan[\[Phi]])/ Sqrt[1 - 4 \[Gamma]^2]])/Sqrt[1 - 4 \[Gamma]^2]), \[Phi]]]results in2/(2 \[Gamma] + Cos[2 \[Phi]]). $\endgroup$