3
$\begingroup$

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

$\endgroup$
  • 3
    $\begingroup$ 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. $\endgroup$ – xzczd Feb 12 at 8:46
  • $\begingroup$ Thank you very much. $\endgroup$ – minhthien_2016 Feb 12 at 8:52
5
$\begingroup$
{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)}}

$\endgroup$
  • $\begingroup$ 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] $\endgroup$ – minhthien_2016 Feb 12 at 8:01
  • 3
    $\begingroup$ @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. $\endgroup$ – kglr Feb 12 at 8:23
  • $\begingroup$ 1/4 Log[27/11] can be written 3/4 Log[3] - 1/4 Log[11] $\endgroup$ – minhthien_2016 Feb 12 at 8:32
2
$\begingroup$

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].

$\endgroup$
  • $\begingroup$ When I tried eq1 = Integrate[1/(x Sqrt[x + 16]), {x, 9, 33}] == a Log@3 + b Log@5; PowerExpand@eq1; Collect[Subtract @@ %, Log[_]] == 0; Cases[%, coe_ Log[_] :> Solve[coe == 0], Infinity] // Flatten I got {a -> 3/4, b -> 0}. I think, It is wrong. $\endgroup$ – minhthien_2016 Feb 12 at 9:02
  • $\begingroup$ @minhthien_2016 The equation itself is wrong. The Log@5 should be Log@11. $\endgroup$ – xzczd Feb 12 at 9:08
  • $\begingroup$ Yes. I think, the answer, It can not be found. $\endgroup$ – minhthien_2016 Feb 12 at 9:09
  • $\begingroup$ As already mentioned, this solution is not a fully automated solution, error handling should be done manually. $\endgroup$ – xzczd Feb 12 at 9:13
  • $\begingroup$ I am looking forward to a genenral method. $\endgroup$ – minhthien_2016 Feb 12 at 9:14
0
$\begingroup$

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}
$\endgroup$

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.