How to using the method of undetermined coefficients in this equation?












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










share|improve this question











$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
















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










share|improve this question











$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














3












3








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










share|improve this question











$endgroup$




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







equation-solving coefficients






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 12 at 8:40







minhthien_2016

















asked Feb 12 at 7:23









minhthien_2016minhthien_2016

573311




573311








  • 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














  • 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








3




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$
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




$begingroup$
Thank you very much.
$endgroup$
– minhthien_2016
Feb 12 at 8:52










3 Answers
3






active

oldest

votes


















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)}}







share|improve this answer









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






share|improve this answer









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





share|improve this answer











$endgroup$














    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "387"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f191367%2fhow-to-using-the-method-of-undetermined-coefficients-in-this-equation%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    3 Answers
    3






    active

    oldest

    votes








    3 Answers
    3






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    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)}}







    share|improve this answer









    $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
















    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)}}







    share|improve this answer









    $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














    5












    5








    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)}}







    share|improve this answer









    $endgroup$



    {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)}}








    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Feb 12 at 7:32









    kglrkglr

    190k10206424




    190k10206424












    • $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


















    • $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
















    $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




    $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




    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$
    @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




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






    share|improve this answer









    $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


















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






    share|improve this answer









    $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
















    2












    2








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






    share|improve this answer









    $endgroup$



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







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Feb 12 at 8:29









    xzczdxzczd

    27.7k574257




    27.7k574257












    • $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




















    • $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


















    $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$
    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$
    @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$
    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$
    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






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





    share|improve this answer











    $endgroup$


















      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}





      share|improve this answer











      $endgroup$
















        0












        0








        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}





        share|improve this answer











        $endgroup$



        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}






        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Feb 18 at 1:44

























        answered Feb 18 at 1:26









        J. M. is awayJ. M. is away

        98.9k10311467




        98.9k10311467






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Mathematica Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            Use MathJax to format equations. MathJax reference.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f191367%2fhow-to-using-the-method-of-undetermined-coefficients-in-this-equation%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Human spaceflight

            Can not write log (Is /dev/pts mounted?) - openpty in Ubuntu-on-Windows?

            張江高科駅