2 solution using FindIntegerNullVector edited Feb 18 at 1:44 J. M. will be back soon♦ 101k1010 gold badges317317 silver badges477477 bronze badges I am interpreting your question to mean that you want logarithms of rational numbers to be expressed purely in terms of logarithms of primes. If so, one can use a replacement rule: {Integrate[1/(x Sqrt[x + 4]), {x, 5, 21}], Integrate[1/(x Sqrt[x + 16]), {x, 9, 33}]} // Simplify {1/2 Log[15/7], 1/4 Log[27/11]} % /. Log[r_Rational] :> (Total[#2 Log[#1] & @@@ FactorInteger[Numerator[r]]] - Total[#2 Log[#1] & @@@ FactorInteger[Denominator[r]]]) // Expand {Log[3]/2 + Log[5]/2 - Log[7]/2, 3 Log[3]/4 - Log[11]/4}  Alternatively, one can use FindIntegerNullVector[], similar to what was done in this answer: -Rest[#]/First[#] &[FindIntegerNullVector[{1/2 Log[15/7], Log[3], Log[5], Log[7]}]] {1/2, 1/2, -1/2} -Rest[#]/First[#] &[FindIntegerNullVector[{1/4 Log[27/11], Log[3], Log[11]}]] {3/4, -1/4}  I am interpreting your question to mean that you want logarithms of rational numbers to be expressed purely in terms of logarithms of primes. If so, one can use a replacement rule: {Integrate[1/(x Sqrt[x + 4]), {x, 5, 21}], Integrate[1/(x Sqrt[x + 16]), {x, 9, 33}]} // Simplify {1/2 Log[15/7], 1/4 Log[27/11]} % /. Log[r_Rational] :> (Total[#2 Log[#1] & @@@ FactorInteger[Numerator[r]]] - Total[#2 Log[#1] & @@@ FactorInteger[Denominator[r]]]) // Expand {Log[3]/2 + Log[5]/2 - Log[7]/2, 3 Log[3]/4 - Log[11]/4}  I am interpreting your question to mean that you want logarithms of rational numbers to be expressed purely in terms of logarithms of primes. If so, one can use a replacement rule: {Integrate[1/(x Sqrt[x + 4]), {x, 5, 21}], Integrate[1/(x Sqrt[x + 16]), {x, 9, 33}]} // Simplify {1/2 Log[15/7], 1/4 Log[27/11]} % /. Log[r_Rational] :> (Total[#2 Log[#1] & @@@ FactorInteger[Numerator[r]]] - Total[#2 Log[#1] & @@@ FactorInteger[Denominator[r]]]) // Expand {Log[3]/2 + Log[5]/2 - Log[7]/2, 3 Log[3]/4 - Log[11]/4}  Alternatively, one can use FindIntegerNullVector[], similar to what was done in this answer: -Rest[#]/First[#] &[FindIntegerNullVector[{1/2 Log[15/7], Log[3], Log[5], Log[7]}]] {1/2, 1/2, -1/2} -Rest[#]/First[#] &[FindIntegerNullVector[{1/4 Log[27/11], Log[3], Log[11]}]] {3/4, -1/4}  1 answered Feb 18 at 1:26 J. M. will be back soon♦ 101k1010 gold badges317317 silver badges477477 bronze badges I am interpreting your question to mean that you want logarithms of rational numbers to be expressed purely in terms of logarithms of primes. If so, one can use a replacement rule: {Integrate[1/(x Sqrt[x + 4]), {x, 5, 21}], Integrate[1/(x Sqrt[x + 16]), {x, 9, 33}]} // Simplify {1/2 Log[15/7], 1/4 Log[27/11]} % /. Log[r_Rational] :> (Total[#2 Log[#1] & @@@ FactorInteger[Numerator[r]]] - Total[#2 Log[#1] & @@@ FactorInteger[Denominator[r]]]) // Expand {Log[3]/2 + Log[5]/2 - Log[7]/2, 3 Log[3]/4 - Log[11]/4}