3

I want to find the rational numbers $a$, $b$, $c$ satisfying the condition

$$\displaystyle \int _ { 5 } ^ { 21 } \frac { \mathrm { d } x } { x \cdot \sqrt { x + 4 } } = a \ln 3 + b \ln 5 + c \ln 7.$$ I solve by hand.

Integrate[1/(x Sqrt[x + 4]), {x, 5, 21}]

1/2 Log[15/7]

From here, I got, $ a = \dfrac{1}{2} $, $ b = \dfrac{1}{2} $, $ c = -\dfrac{1}{2} .$

How can I tell Mathematica to do that?

With Maple, I got the answer directly enter image description here

enter image description here

minhthien_2016
  • 3,347
  • 14
  • 22
  • 3
    You're just calculating the integral rather than solving the equation in Maple. If such results are desired for you, simply Integrate[1/(x Sqrt[x + 4]), {x, 5, 21}] // PowerExpand // Expand. – xzczd Feb 12 '19 at 08:46
  • Thank you very much. – minhthien_2016 Feb 12 '19 at 08:52

3 Answers3

5
{a/d, b/e, c/f} /. 
 FindInstance[Integrate[1/(x Sqrt[x + 4]), {x, 5, 21}] == 
   a Log[3]/d + b Log[5]/e + c Log[7]/f, {a, b, c, d, e, f}, Integers]

{{1/2, 1/2, -(1/2)}}

kglr
  • 394,356
  • 18
  • 477
  • 896
  • How about equation? I don't get the result? Clear[a, b, c, d, e, f] {a/d, b/e} /. FindInstance[ Integrate[1/(x Sqrt[x + 16]), {x, 9, 33}] == a Log[3]/d + b Log[11]/e, {a, d, b, e}, Integers] – minhthien_2016 Feb 12 '19 at 08:01
  • 3
    @minhthien_2016, as the message says, The methods available to FindInstance are insufficient to find the requested instances or prove they do not exist. You can try Reduce: for example, Reduce[{Integrate[1/(x Sqrt[x + 16]), {x, 9, 33}] == a Log[3]/d + b Log[11]/e, And @@ Thread[-5 <= {a, d, b, e} <= 5]}, {a, d, b, e}, Integers] gives a solution. – kglr Feb 12 '19 at 08:23
  • 1/4 Log[27/11] can be written 3/4 Log[3] - 1/4 Log[11] – minhthien_2016 Feb 12 '19 at 08:32
2

Not as automated as kglr's solution, but the following works:

eq = Integrate[1/(x Sqrt[x + 4]), {x, 5, 21}] == a Log@3 + b Log@5 + c Log@7
(* 1/2 Log[15/7] == a Log[3] + b Log[5] + c Log[7] *)

PowerExpand@eq
(* 1/2 (Log[3] + Log[5] - Log[7]) == a Log[3] + b Log[5] + c Log[7] *)

Collect[Subtract @@ %, Log[_]] == 0
(* (1/2 - a) Log[3] + (1/2 - b) Log[5] + (-(1/2) - c) Log[7] == 0 *)

Cases[%, coe_ Log[_] :> Solve[coe == 0], Infinity] // Flatten
(* {a -> 1/2, b -> 1/2, c -> -(1/2)} *)

This method also handles the new added example Integrate[1/(x Sqrt[x + 16]), {x, 9, 33}] == a Log[3] + b Log[11].

xzczd
  • 65,995
  • 9
  • 163
  • 468
0

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}
J. M.'s missing motivation
  • 124,525
  • 11
  • 401
  • 574