Please, see better this question, since it displays the problem better, i.e., more specifically.
I have complicated function:
F[s2_, Ss_, t1_, m_, m2_] := Evaluate[-6 ((s2^6 + (Ss - 7 t1) s2^5 + (-4 Ss^2 + 13 t1 Ss + 16 t1^2) s2^4 + 2 (Ss^3 - 13 t1 Ss^2 - 10 t1^2 Ss - 8 t1^3) s2^3 + t1 (18 Ss^3 + 6 t1 Ss^2 - 4 t1^2 Ss + 7 t1^3) s2^2 + t1^2 (18 Ss^3 + 22 t1 Ss^2 + 11 t1^2 Ss - t1^3) s2 + Ss t1^3 (2 Ss^2 + 2 t1 Ss - t1^2)) m^6 - Ss (s2 - t1) ((11 t1 - 2 Ss) s2^4 + 2 (Ss^2 - 16 t1 Ss - 7 t1^2) s2^3 + 6 (4 Ss^2 t1 - t1^3) s2^2 + 2 t1^2 (15 Ss^2 + 16 t1 Ss + 5 t1^2) s2 + t1^3 (4 Ss^2 + 2 t1 Ss - t1^2)) m^4 + Ss^2 (s2 - t1)^2 (s2^4 - (Ss + 9 t1) s2^3 + 3 (3 Ss - t1) t1 s2^2 + t1^2 (15 Ss + 11 t1) s2 + Ss t1^3) m^2 + Ss^3 (s2 - t1)^3 t1 (s2^2 - 4 t1 s2 + t1^2)) Log[((-m^2 + m2^2 + s2 - Sqrt[m^4 - 2 (m2^2 + s2) m^2 + (m2^2 - s2)^2]) (s2 - t1))/(2 s2)] s2^3 + 6 ((s2^6 + (Ss - 7 t1) s2^5 + (-4 Ss^2 + 13 t1 Ss + 16 t1^2) s2^4 + 2 (Ss^3 - 13 t1 Ss^2 - 10 t1^2 Ss - 8 t1^3) s2^3 + t1 (18 Ss^3 + 6 t1 Ss^2 - 4 t1^2 Ss + 7 t1^3) s2^2 + t1^2 (18 Ss^3 + 22 t1 Ss^2 + 11 t1^2 Ss - t1^3) s2 + Ss t1^3 (2 Ss^2 + 2 t1 Ss - t1^2)) m^6 - Ss (s2 - t1) ((11 t1 - 2 Ss) s2^4 + 2 (Ss^2 - 16 t1 Ss - 7 t1^2) s2^3 + 6 (4 Ss^2 t1 - t1^3) s2^2 + 2 t1^2 (15 Ss^2 + 16 t1 Ss + 5 t1^2) s2 + t1^3 (4 Ss^2 + 2 t1 Ss - t1^2)) m^4 + Ss^2 (s2 - t1)^2 (s2^4 - (Ss + 9 t1) s2^3 + 3 (3 Ss - t1) t1 s2^2 + t1^2 (15 Ss + 11 t1) s2 + Ss t1^3) m^2 + Ss^3 (s2 - t1)^3 t1 (s2^2 - 4 t1 s2 + t1^2)) Log[((-m^2 + m2^2 + s2 + Sqrt[m^4 - 2 (m2^2 + s2) m^2 + (m2^2 - s2)^2]) (s2 - t1))/(2 s2)] s2^3] The factors in the front of two logarithms are the same, so it can be written in more compact form, i.e. in the form ...Log[.../...]. I tried to implement this by using
Collect[F[s2,Ss,t1,m,m2],_Log] or by writing exact function
collectLog = {a_*Log[x_] + a_*Log[y_] :> a*Log[x y], b_*Log[x_] - b_*Log[y_] :> b*Log[x/y]}; and then
F[s2,Ss,t1,m,m2] //. collectLog but these don't work.
How to force Mathematica to collect the logs for the given function?
Simplifygive you what you want? $\endgroup$SimplifyandFullSimplifyseem to work fine for me (givingbigfactor * (Log[stuff] + Log[morestuff]). Is it a version thing? I'm on MMA 10.4. $\endgroup$Simplify[...long expression...] /. -Log[x_] + Log[y_] -> Log[y/x]works for me $\endgroup$