Definite Integral: $int_0^2pifracd theta sqrt1-k^2cos( theta )$

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
-2
down vote

favorite













I need integral result for following integral:
$$int_0^2pifracd theta sqrt1-k^2cos( theta )$$




It will be useful in an electromagnetic simulator. It is obtained as the medium 1/distance from one ring to a point that is separated to the axis.
Actually due the objects where split in a 3-d mesh of 24k pieces so to solve the problem its takes 3 hours due inverse of 24k x 24k arrays (that reach the 16GB limit of RAM).



I have look for at definite integral tables but was not found
It would help an APPROXIMATE solution that reduces the 3-D problem to 2D.
It is said it is a first kind elliptic integral, but I do not know how to place in an elliptic expression and what lib can be used with C++. Boost is included in actual C++11 but I do not know if the elliptic integral lib is included in it







share|cite|improve this question






















  • This is indeed a complete elliptic integral of the first kind. Ask WA the correct parameterization.
    – Yves Daoust
    Jul 12 at 19:11










  • it is not squared sine but single cosine
    – mathengineer
    Jul 12 at 19:18










  • You very easily turn it to the canonical form. Some effort on your side might help.
    – Yves Daoust
    Jul 12 at 19:21











  • I am sorry, my effors where made to obtain the integral from electromagnetics formulas
    – mathengineer
    Jul 12 at 19:23







  • 1




    Hint: Half-angle formula.
    – gammatester
    Jul 12 at 19:23














up vote
-2
down vote

favorite













I need integral result for following integral:
$$int_0^2pifracd theta sqrt1-k^2cos( theta )$$




It will be useful in an electromagnetic simulator. It is obtained as the medium 1/distance from one ring to a point that is separated to the axis.
Actually due the objects where split in a 3-d mesh of 24k pieces so to solve the problem its takes 3 hours due inverse of 24k x 24k arrays (that reach the 16GB limit of RAM).



I have look for at definite integral tables but was not found
It would help an APPROXIMATE solution that reduces the 3-D problem to 2D.
It is said it is a first kind elliptic integral, but I do not know how to place in an elliptic expression and what lib can be used with C++. Boost is included in actual C++11 but I do not know if the elliptic integral lib is included in it







share|cite|improve this question






















  • This is indeed a complete elliptic integral of the first kind. Ask WA the correct parameterization.
    – Yves Daoust
    Jul 12 at 19:11










  • it is not squared sine but single cosine
    – mathengineer
    Jul 12 at 19:18










  • You very easily turn it to the canonical form. Some effort on your side might help.
    – Yves Daoust
    Jul 12 at 19:21











  • I am sorry, my effors where made to obtain the integral from electromagnetics formulas
    – mathengineer
    Jul 12 at 19:23







  • 1




    Hint: Half-angle formula.
    – gammatester
    Jul 12 at 19:23












up vote
-2
down vote

favorite









up vote
-2
down vote

favorite












I need integral result for following integral:
$$int_0^2pifracd theta sqrt1-k^2cos( theta )$$




It will be useful in an electromagnetic simulator. It is obtained as the medium 1/distance from one ring to a point that is separated to the axis.
Actually due the objects where split in a 3-d mesh of 24k pieces so to solve the problem its takes 3 hours due inverse of 24k x 24k arrays (that reach the 16GB limit of RAM).



I have look for at definite integral tables but was not found
It would help an APPROXIMATE solution that reduces the 3-D problem to 2D.
It is said it is a first kind elliptic integral, but I do not know how to place in an elliptic expression and what lib can be used with C++. Boost is included in actual C++11 but I do not know if the elliptic integral lib is included in it







share|cite|improve this question















I need integral result for following integral:
$$int_0^2pifracd theta sqrt1-k^2cos( theta )$$




It will be useful in an electromagnetic simulator. It is obtained as the medium 1/distance from one ring to a point that is separated to the axis.
Actually due the objects where split in a 3-d mesh of 24k pieces so to solve the problem its takes 3 hours due inverse of 24k x 24k arrays (that reach the 16GB limit of RAM).



I have look for at definite integral tables but was not found
It would help an APPROXIMATE solution that reduces the 3-D problem to 2D.
It is said it is a first kind elliptic integral, but I do not know how to place in an elliptic expression and what lib can be used with C++. Boost is included in actual C++11 but I do not know if the elliptic integral lib is included in it









share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Jul 13 at 8:15

























asked Jul 12 at 19:04









mathengineer

51




51











  • This is indeed a complete elliptic integral of the first kind. Ask WA the correct parameterization.
    – Yves Daoust
    Jul 12 at 19:11










  • it is not squared sine but single cosine
    – mathengineer
    Jul 12 at 19:18










  • You very easily turn it to the canonical form. Some effort on your side might help.
    – Yves Daoust
    Jul 12 at 19:21











  • I am sorry, my effors where made to obtain the integral from electromagnetics formulas
    – mathengineer
    Jul 12 at 19:23







  • 1




    Hint: Half-angle formula.
    – gammatester
    Jul 12 at 19:23
















  • This is indeed a complete elliptic integral of the first kind. Ask WA the correct parameterization.
    – Yves Daoust
    Jul 12 at 19:11










  • it is not squared sine but single cosine
    – mathengineer
    Jul 12 at 19:18










  • You very easily turn it to the canonical form. Some effort on your side might help.
    – Yves Daoust
    Jul 12 at 19:21











  • I am sorry, my effors where made to obtain the integral from electromagnetics formulas
    – mathengineer
    Jul 12 at 19:23







  • 1




    Hint: Half-angle formula.
    – gammatester
    Jul 12 at 19:23















This is indeed a complete elliptic integral of the first kind. Ask WA the correct parameterization.
– Yves Daoust
Jul 12 at 19:11




This is indeed a complete elliptic integral of the first kind. Ask WA the correct parameterization.
– Yves Daoust
Jul 12 at 19:11












it is not squared sine but single cosine
– mathengineer
Jul 12 at 19:18




it is not squared sine but single cosine
– mathengineer
Jul 12 at 19:18












You very easily turn it to the canonical form. Some effort on your side might help.
– Yves Daoust
Jul 12 at 19:21





You very easily turn it to the canonical form. Some effort on your side might help.
– Yves Daoust
Jul 12 at 19:21













I am sorry, my effors where made to obtain the integral from electromagnetics formulas
– mathengineer
Jul 12 at 19:23





I am sorry, my effors where made to obtain the integral from electromagnetics formulas
– mathengineer
Jul 12 at 19:23





1




1




Hint: Half-angle formula.
– gammatester
Jul 12 at 19:23




Hint: Half-angle formula.
– gammatester
Jul 12 at 19:23










2 Answers
2






active

oldest

votes

















up vote
0
down vote













In the notation here, we get a complete elliptic integral of the first kind viz. $$int_0^2pifracdthetasqrt1-k^2costheta=2int_0^pifracdthetasqrt1-k^2costheta=frac4sqrt1-k^2int_0^pi/2fracdphisqrt1-frac2k^2k^2-1sin^2phi=frac4sqrt1-k^2Kleft(sqrtfrac2k^2k^2-1right).$$As discussed therein, the easiest fast accurate calculation for a given $k$ uses the aithmetic-geometric mean.






share|cite|improve this answer



























    up vote
    0
    down vote













    The response is:
    $$displaystyleint_0^2pifracd theta sqrt1-k^2cos( theta )=2displaystyleint_0^pifracd theta sqrt1-k^2cos( theta )$$



    $$displaystyleint_0^pi/2fracdt sqrt1-k^2cos(2t)=4displaystyleint_0^pi/2fracdt sqrt1-k^2(1-2sin^2(t))=4displaystyleint_0^pi/2fracdt sqrt(1-k^2)+2k^2sin^2(t)$$
    That is an elliptic integral of the first order.



    Result can be found here:
    Forum math



    Where
    $$theta=2t$$



    I used boost and worked. Elliptic integrals are included in in C++17, so it is not needed install boost:



    #include<iostream>
    #include <cmath>


    const double PI = 3.1415926535897932384626433832795;
    const double PI2 = 2.0 * PI;

    using namespace std;


    int main()

    double flimit = PI, k = 0.25, f;
    f = ellint_1(k, flimit);
    double expected = 1.596242222131783510149;
    cout << "Ellint error for k,F=" << k << " & " << flimit << " = " << fabs(f - expected) << endl;

    cout << endl << "=== END ===" << endl; getchar();
    return 1;






    share|cite|improve this answer






















      Your Answer




      StackExchange.ifUsing("editor", function ()
      return StackExchange.using("mathjaxEditing", function ()
      StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
      StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
      );
      );
      , "mathjax-editing");

      StackExchange.ready(function()
      var channelOptions =
      tags: "".split(" "),
      id: "69"
      ;
      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',
      convertImagesToLinks: true,
      noModals: false,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      noCode: true, onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      );



      );








       

      draft saved


      draft discarded


















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2848979%2fdefinite-integral-int-02-pi-fracd-theta-sqrt1-k2-cos-theta%23new-answer', 'question_page');

      );

      Post as a guest






























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes








      up vote
      0
      down vote













      In the notation here, we get a complete elliptic integral of the first kind viz. $$int_0^2pifracdthetasqrt1-k^2costheta=2int_0^pifracdthetasqrt1-k^2costheta=frac4sqrt1-k^2int_0^pi/2fracdphisqrt1-frac2k^2k^2-1sin^2phi=frac4sqrt1-k^2Kleft(sqrtfrac2k^2k^2-1right).$$As discussed therein, the easiest fast accurate calculation for a given $k$ uses the aithmetic-geometric mean.






      share|cite|improve this answer
























        up vote
        0
        down vote













        In the notation here, we get a complete elliptic integral of the first kind viz. $$int_0^2pifracdthetasqrt1-k^2costheta=2int_0^pifracdthetasqrt1-k^2costheta=frac4sqrt1-k^2int_0^pi/2fracdphisqrt1-frac2k^2k^2-1sin^2phi=frac4sqrt1-k^2Kleft(sqrtfrac2k^2k^2-1right).$$As discussed therein, the easiest fast accurate calculation for a given $k$ uses the aithmetic-geometric mean.






        share|cite|improve this answer






















          up vote
          0
          down vote










          up vote
          0
          down vote









          In the notation here, we get a complete elliptic integral of the first kind viz. $$int_0^2pifracdthetasqrt1-k^2costheta=2int_0^pifracdthetasqrt1-k^2costheta=frac4sqrt1-k^2int_0^pi/2fracdphisqrt1-frac2k^2k^2-1sin^2phi=frac4sqrt1-k^2Kleft(sqrtfrac2k^2k^2-1right).$$As discussed therein, the easiest fast accurate calculation for a given $k$ uses the aithmetic-geometric mean.






          share|cite|improve this answer












          In the notation here, we get a complete elliptic integral of the first kind viz. $$int_0^2pifracdthetasqrt1-k^2costheta=2int_0^pifracdthetasqrt1-k^2costheta=frac4sqrt1-k^2int_0^pi/2fracdphisqrt1-frac2k^2k^2-1sin^2phi=frac4sqrt1-k^2Kleft(sqrtfrac2k^2k^2-1right).$$As discussed therein, the easiest fast accurate calculation for a given $k$ uses the aithmetic-geometric mean.







          share|cite|improve this answer












          share|cite|improve this answer



          share|cite|improve this answer










          answered Aug 3 at 10:24









          J.G.

          13.7k11424




          13.7k11424




















              up vote
              0
              down vote













              The response is:
              $$displaystyleint_0^2pifracd theta sqrt1-k^2cos( theta )=2displaystyleint_0^pifracd theta sqrt1-k^2cos( theta )$$



              $$displaystyleint_0^pi/2fracdt sqrt1-k^2cos(2t)=4displaystyleint_0^pi/2fracdt sqrt1-k^2(1-2sin^2(t))=4displaystyleint_0^pi/2fracdt sqrt(1-k^2)+2k^2sin^2(t)$$
              That is an elliptic integral of the first order.



              Result can be found here:
              Forum math



              Where
              $$theta=2t$$



              I used boost and worked. Elliptic integrals are included in in C++17, so it is not needed install boost:



              #include<iostream>
              #include <cmath>


              const double PI = 3.1415926535897932384626433832795;
              const double PI2 = 2.0 * PI;

              using namespace std;


              int main()

              double flimit = PI, k = 0.25, f;
              f = ellint_1(k, flimit);
              double expected = 1.596242222131783510149;
              cout << "Ellint error for k,F=" << k << " & " << flimit << " = " << fabs(f - expected) << endl;

              cout << endl << "=== END ===" << endl; getchar();
              return 1;






              share|cite|improve this answer


























                up vote
                0
                down vote













                The response is:
                $$displaystyleint_0^2pifracd theta sqrt1-k^2cos( theta )=2displaystyleint_0^pifracd theta sqrt1-k^2cos( theta )$$



                $$displaystyleint_0^pi/2fracdt sqrt1-k^2cos(2t)=4displaystyleint_0^pi/2fracdt sqrt1-k^2(1-2sin^2(t))=4displaystyleint_0^pi/2fracdt sqrt(1-k^2)+2k^2sin^2(t)$$
                That is an elliptic integral of the first order.



                Result can be found here:
                Forum math



                Where
                $$theta=2t$$



                I used boost and worked. Elliptic integrals are included in in C++17, so it is not needed install boost:



                #include<iostream>
                #include <cmath>


                const double PI = 3.1415926535897932384626433832795;
                const double PI2 = 2.0 * PI;

                using namespace std;


                int main()

                double flimit = PI, k = 0.25, f;
                f = ellint_1(k, flimit);
                double expected = 1.596242222131783510149;
                cout << "Ellint error for k,F=" << k << " & " << flimit << " = " << fabs(f - expected) << endl;

                cout << endl << "=== END ===" << endl; getchar();
                return 1;






                share|cite|improve this answer
























                  up vote
                  0
                  down vote










                  up vote
                  0
                  down vote









                  The response is:
                  $$displaystyleint_0^2pifracd theta sqrt1-k^2cos( theta )=2displaystyleint_0^pifracd theta sqrt1-k^2cos( theta )$$



                  $$displaystyleint_0^pi/2fracdt sqrt1-k^2cos(2t)=4displaystyleint_0^pi/2fracdt sqrt1-k^2(1-2sin^2(t))=4displaystyleint_0^pi/2fracdt sqrt(1-k^2)+2k^2sin^2(t)$$
                  That is an elliptic integral of the first order.



                  Result can be found here:
                  Forum math



                  Where
                  $$theta=2t$$



                  I used boost and worked. Elliptic integrals are included in in C++17, so it is not needed install boost:



                  #include<iostream>
                  #include <cmath>


                  const double PI = 3.1415926535897932384626433832795;
                  const double PI2 = 2.0 * PI;

                  using namespace std;


                  int main()

                  double flimit = PI, k = 0.25, f;
                  f = ellint_1(k, flimit);
                  double expected = 1.596242222131783510149;
                  cout << "Ellint error for k,F=" << k << " & " << flimit << " = " << fabs(f - expected) << endl;

                  cout << endl << "=== END ===" << endl; getchar();
                  return 1;






                  share|cite|improve this answer














                  The response is:
                  $$displaystyleint_0^2pifracd theta sqrt1-k^2cos( theta )=2displaystyleint_0^pifracd theta sqrt1-k^2cos( theta )$$



                  $$displaystyleint_0^pi/2fracdt sqrt1-k^2cos(2t)=4displaystyleint_0^pi/2fracdt sqrt1-k^2(1-2sin^2(t))=4displaystyleint_0^pi/2fracdt sqrt(1-k^2)+2k^2sin^2(t)$$
                  That is an elliptic integral of the first order.



                  Result can be found here:
                  Forum math



                  Where
                  $$theta=2t$$



                  I used boost and worked. Elliptic integrals are included in in C++17, so it is not needed install boost:



                  #include<iostream>
                  #include <cmath>


                  const double PI = 3.1415926535897932384626433832795;
                  const double PI2 = 2.0 * PI;

                  using namespace std;


                  int main()

                  double flimit = PI, k = 0.25, f;
                  f = ellint_1(k, flimit);
                  double expected = 1.596242222131783510149;
                  cout << "Ellint error for k,F=" << k << " & " << flimit << " = " << fabs(f - expected) << endl;

                  cout << endl << "=== END ===" << endl; getchar();
                  return 1;







                  share|cite|improve this answer














                  share|cite|improve this answer



                  share|cite|improve this answer








                  edited Aug 14 at 8:16

























                  answered Aug 3 at 9:57









                  mathengineer

                  51




                  51






















                       

                      draft saved


                      draft discarded


























                       


                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2848979%2fdefinite-integral-int-02-pi-fracd-theta-sqrt1-k2-cos-theta%23new-answer', 'question_page');

                      );

                      Post as a guest













































































                      這個網誌中的熱門文章

                      How to combine Bézier curves to a surface?

                      Carbon dioxide

                      Why am i infinitely getting the same tweet with the Twitter Search API?