Integral with DiracDelta. Can Mathematica be made to solve this?How to solve this integralIntegral of DiracDelta giving an unusual answerHow can I solve this integral analytically?DiracDelta behaves incorrectly on multidimensional integralPartial derivative with Dirac Delta as initial conditionDensity of states from numerical integration and then differentiationIntegral Representation of DiracDeltaCan this integral be calculated using Mathematica?Symbolic IntegralMathematica won't evaluate this integral

Renting a house to a graduate student in my department

Was there a contingency plan in place if Little Boy failed to detonate?

Pre-1993 comic in which Wolverine's claws were turned to rubber?

Is there an idiom that means "revealing a secret unintentionally"?

Why Faces eat each other?

Is it possible to reduce the cost of brewing potions?

Company stopped paying my salary. What are my options?

Was the Highlands Ranch shooting the 115th mass shooting in the US in 2019

how to find out if there's files in a folder and exit accordingly (in KSH)

How did Captain Marvel know where to find these characters?

Are wands in any sort of book going to be too much like Harry Potter?

When do you stop "pushing" a book?

What are these round pads on the bottom of a PCB?

"Estrontium" on poster

Can the president of the United States be guilty of insider trading?

Unicode-math and mathrm result in missing symbols

Is it a good idea to copy a trader when investing?

Narcissistic cube asks who are we?

What's the difference between "ricochet" and "bounce"?

Is it safe to keep the GPU on 100% utilization for a very long time?

Why is it wrong to *implement* myself a known, published, widely believed to be secure crypto algorithm?

What's an appropriate age to involve kids in life changing decisions?

How can I test a shell script in a "safe environment" to avoid harm to my computer?

Is there a need for better software for writers?



Integral with DiracDelta. Can Mathematica be made to solve this?


How to solve this integralIntegral of DiracDelta giving an unusual answerHow can I solve this integral analytically?DiracDelta behaves incorrectly on multidimensional integralPartial derivative with Dirac Delta as initial conditionDensity of states from numerical integration and then differentiationIntegral Representation of DiracDeltaCan this integral be calculated using Mathematica?Symbolic IntegralMathematica won't evaluate this integral













4












$begingroup$


This was an exam question.



$$
int_0^2 pi delta(sin^2(theta) -x ) ,dtheta
$$



Direct use of Integrate on it does not give the solution. Is there a trick or workaround? Here is the code I used



ClearAll[theta,x]
integrand = DiracDelta[Sin[theta]^2 - x]
Integrate[ integrand, theta, 0, 2 Pi]


Here is the key solution analytical solution



Mathematica graphics



The solution uses this known relation (half way down the Wikipedia page)



Mathematica graphics



Where the sum above is over all zeros of $g(x)$ in the integration interval. Mathematica does not seem to know this relation?



ps. Maple can't do it either.










share|improve this question











$endgroup$
















    4












    $begingroup$


    This was an exam question.



    $$
    int_0^2 pi delta(sin^2(theta) -x ) ,dtheta
    $$



    Direct use of Integrate on it does not give the solution. Is there a trick or workaround? Here is the code I used



    ClearAll[theta,x]
    integrand = DiracDelta[Sin[theta]^2 - x]
    Integrate[ integrand, theta, 0, 2 Pi]


    Here is the key solution analytical solution



    Mathematica graphics



    The solution uses this known relation (half way down the Wikipedia page)



    Mathematica graphics



    Where the sum above is over all zeros of $g(x)$ in the integration interval. Mathematica does not seem to know this relation?



    ps. Maple can't do it either.










    share|improve this question











    $endgroup$














      4












      4








      4





      $begingroup$


      This was an exam question.



      $$
      int_0^2 pi delta(sin^2(theta) -x ) ,dtheta
      $$



      Direct use of Integrate on it does not give the solution. Is there a trick or workaround? Here is the code I used



      ClearAll[theta,x]
      integrand = DiracDelta[Sin[theta]^2 - x]
      Integrate[ integrand, theta, 0, 2 Pi]


      Here is the key solution analytical solution



      Mathematica graphics



      The solution uses this known relation (half way down the Wikipedia page)



      Mathematica graphics



      Where the sum above is over all zeros of $g(x)$ in the integration interval. Mathematica does not seem to know this relation?



      ps. Maple can't do it either.










      share|improve this question











      $endgroup$




      This was an exam question.



      $$
      int_0^2 pi delta(sin^2(theta) -x ) ,dtheta
      $$



      Direct use of Integrate on it does not give the solution. Is there a trick or workaround? Here is the code I used



      ClearAll[theta,x]
      integrand = DiracDelta[Sin[theta]^2 - x]
      Integrate[ integrand, theta, 0, 2 Pi]


      Here is the key solution analytical solution



      Mathematica graphics



      The solution uses this known relation (half way down the Wikipedia page)



      Mathematica graphics



      Where the sum above is over all zeros of $g(x)$ in the integration interval. Mathematica does not seem to know this relation?



      ps. Maple can't do it either.







      calculus-and-analysis






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 2 hours ago







      Nasser

















      asked 3 hours ago









      NasserNasser

      59.2k491209




      59.2k491209




















          2 Answers
          2






          active

          oldest

          votes


















          4












          $begingroup$

          You need to give Integrate assumptions:



          Integrate[DiracDelta[Sin[θ]^2-x], θ, 0, 2 π, Assumptions -> 0<x<1]



          2/Sqrt[-(-1 + x) x]




          Unfortunately, Integrate is not quite smart enough to use the assumption x ∈ Reals:



          Integrate[DiracDelta[Sin[θ]^2-x], θ, 0, 2 π, Assumptions -> x ∈ Reals]



          Integrate[DiracDelta[-x + Sin[θ]^2], θ, 0, 2 π,
          Assumptions -> x ∈ Reals]







          share|improve this answer









          $endgroup$












          • $begingroup$
            Nice! For some reason, this does not work for exponents other than 2 (e.g., Sin[θ]^3 - x). My code does not work either, presumably for the same reason (Solve is unable to determine the roots). Any idea how to work around this?
            $endgroup$
            – AccidentalFourierTransform
            2 hours ago






          • 2




            $begingroup$
            @AccidentalFourierTransform One hack is to replace x with EulerGamma, that will produce a result for Sin[θ]^3 - x, which you can then extrapolate into a generic answer.
            $endgroup$
            – Carl Woll
            2 hours ago


















          2












          $begingroup$

          f[θ_, x_] := Sin[θ]^2 - x
          Derivative[1, 0][f][θ, x] /. Solve[f[θ, x] == 0, 0 < θ < 2 π, θ, Reals]
          Integrate[DiracDelta[x - θ]/Abs[%], θ, 0, 2 π] // Total


          enter image description here



          This code should also work for other functions $f$, presumably.






          share|improve this answer











          $endgroup$












          • $begingroup$
            You have an extra [θ, x], and your Solve would work better if you added the domain Reals. Probably more robust than just relying on Integrate.
            $endgroup$
            – Carl Woll
            2 hours ago











          • $begingroup$
            @CarlWoll Ah, yes, thank you!
            $endgroup$
            – AccidentalFourierTransform
            2 hours ago











          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%2f197963%2fintegral-with-diracdelta-can-mathematica-be-made-to-solve-this%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          2 Answers
          2






          active

          oldest

          votes








          2 Answers
          2






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          4












          $begingroup$

          You need to give Integrate assumptions:



          Integrate[DiracDelta[Sin[θ]^2-x], θ, 0, 2 π, Assumptions -> 0<x<1]



          2/Sqrt[-(-1 + x) x]




          Unfortunately, Integrate is not quite smart enough to use the assumption x ∈ Reals:



          Integrate[DiracDelta[Sin[θ]^2-x], θ, 0, 2 π, Assumptions -> x ∈ Reals]



          Integrate[DiracDelta[-x + Sin[θ]^2], θ, 0, 2 π,
          Assumptions -> x ∈ Reals]







          share|improve this answer









          $endgroup$












          • $begingroup$
            Nice! For some reason, this does not work for exponents other than 2 (e.g., Sin[θ]^3 - x). My code does not work either, presumably for the same reason (Solve is unable to determine the roots). Any idea how to work around this?
            $endgroup$
            – AccidentalFourierTransform
            2 hours ago






          • 2




            $begingroup$
            @AccidentalFourierTransform One hack is to replace x with EulerGamma, that will produce a result for Sin[θ]^3 - x, which you can then extrapolate into a generic answer.
            $endgroup$
            – Carl Woll
            2 hours ago















          4












          $begingroup$

          You need to give Integrate assumptions:



          Integrate[DiracDelta[Sin[θ]^2-x], θ, 0, 2 π, Assumptions -> 0<x<1]



          2/Sqrt[-(-1 + x) x]




          Unfortunately, Integrate is not quite smart enough to use the assumption x ∈ Reals:



          Integrate[DiracDelta[Sin[θ]^2-x], θ, 0, 2 π, Assumptions -> x ∈ Reals]



          Integrate[DiracDelta[-x + Sin[θ]^2], θ, 0, 2 π,
          Assumptions -> x ∈ Reals]







          share|improve this answer









          $endgroup$












          • $begingroup$
            Nice! For some reason, this does not work for exponents other than 2 (e.g., Sin[θ]^3 - x). My code does not work either, presumably for the same reason (Solve is unable to determine the roots). Any idea how to work around this?
            $endgroup$
            – AccidentalFourierTransform
            2 hours ago






          • 2




            $begingroup$
            @AccidentalFourierTransform One hack is to replace x with EulerGamma, that will produce a result for Sin[θ]^3 - x, which you can then extrapolate into a generic answer.
            $endgroup$
            – Carl Woll
            2 hours ago













          4












          4








          4





          $begingroup$

          You need to give Integrate assumptions:



          Integrate[DiracDelta[Sin[θ]^2-x], θ, 0, 2 π, Assumptions -> 0<x<1]



          2/Sqrt[-(-1 + x) x]




          Unfortunately, Integrate is not quite smart enough to use the assumption x ∈ Reals:



          Integrate[DiracDelta[Sin[θ]^2-x], θ, 0, 2 π, Assumptions -> x ∈ Reals]



          Integrate[DiracDelta[-x + Sin[θ]^2], θ, 0, 2 π,
          Assumptions -> x ∈ Reals]







          share|improve this answer









          $endgroup$



          You need to give Integrate assumptions:



          Integrate[DiracDelta[Sin[θ]^2-x], θ, 0, 2 π, Assumptions -> 0<x<1]



          2/Sqrt[-(-1 + x) x]




          Unfortunately, Integrate is not quite smart enough to use the assumption x ∈ Reals:



          Integrate[DiracDelta[Sin[θ]^2-x], θ, 0, 2 π, Assumptions -> x ∈ Reals]



          Integrate[DiracDelta[-x + Sin[θ]^2], θ, 0, 2 π,
          Assumptions -> x ∈ Reals]








          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 2 hours ago









          Carl WollCarl Woll

          77.7k3102204




          77.7k3102204











          • $begingroup$
            Nice! For some reason, this does not work for exponents other than 2 (e.g., Sin[θ]^3 - x). My code does not work either, presumably for the same reason (Solve is unable to determine the roots). Any idea how to work around this?
            $endgroup$
            – AccidentalFourierTransform
            2 hours ago






          • 2




            $begingroup$
            @AccidentalFourierTransform One hack is to replace x with EulerGamma, that will produce a result for Sin[θ]^3 - x, which you can then extrapolate into a generic answer.
            $endgroup$
            – Carl Woll
            2 hours ago
















          • $begingroup$
            Nice! For some reason, this does not work for exponents other than 2 (e.g., Sin[θ]^3 - x). My code does not work either, presumably for the same reason (Solve is unable to determine the roots). Any idea how to work around this?
            $endgroup$
            – AccidentalFourierTransform
            2 hours ago






          • 2




            $begingroup$
            @AccidentalFourierTransform One hack is to replace x with EulerGamma, that will produce a result for Sin[θ]^3 - x, which you can then extrapolate into a generic answer.
            $endgroup$
            – Carl Woll
            2 hours ago















          $begingroup$
          Nice! For some reason, this does not work for exponents other than 2 (e.g., Sin[θ]^3 - x). My code does not work either, presumably for the same reason (Solve is unable to determine the roots). Any idea how to work around this?
          $endgroup$
          – AccidentalFourierTransform
          2 hours ago




          $begingroup$
          Nice! For some reason, this does not work for exponents other than 2 (e.g., Sin[θ]^3 - x). My code does not work either, presumably for the same reason (Solve is unable to determine the roots). Any idea how to work around this?
          $endgroup$
          – AccidentalFourierTransform
          2 hours ago




          2




          2




          $begingroup$
          @AccidentalFourierTransform One hack is to replace x with EulerGamma, that will produce a result for Sin[θ]^3 - x, which you can then extrapolate into a generic answer.
          $endgroup$
          – Carl Woll
          2 hours ago




          $begingroup$
          @AccidentalFourierTransform One hack is to replace x with EulerGamma, that will produce a result for Sin[θ]^3 - x, which you can then extrapolate into a generic answer.
          $endgroup$
          – Carl Woll
          2 hours ago











          2












          $begingroup$

          f[θ_, x_] := Sin[θ]^2 - x
          Derivative[1, 0][f][θ, x] /. Solve[f[θ, x] == 0, 0 < θ < 2 π, θ, Reals]
          Integrate[DiracDelta[x - θ]/Abs[%], θ, 0, 2 π] // Total


          enter image description here



          This code should also work for other functions $f$, presumably.






          share|improve this answer











          $endgroup$












          • $begingroup$
            You have an extra [θ, x], and your Solve would work better if you added the domain Reals. Probably more robust than just relying on Integrate.
            $endgroup$
            – Carl Woll
            2 hours ago











          • $begingroup$
            @CarlWoll Ah, yes, thank you!
            $endgroup$
            – AccidentalFourierTransform
            2 hours ago















          2












          $begingroup$

          f[θ_, x_] := Sin[θ]^2 - x
          Derivative[1, 0][f][θ, x] /. Solve[f[θ, x] == 0, 0 < θ < 2 π, θ, Reals]
          Integrate[DiracDelta[x - θ]/Abs[%], θ, 0, 2 π] // Total


          enter image description here



          This code should also work for other functions $f$, presumably.






          share|improve this answer











          $endgroup$












          • $begingroup$
            You have an extra [θ, x], and your Solve would work better if you added the domain Reals. Probably more robust than just relying on Integrate.
            $endgroup$
            – Carl Woll
            2 hours ago











          • $begingroup$
            @CarlWoll Ah, yes, thank you!
            $endgroup$
            – AccidentalFourierTransform
            2 hours ago













          2












          2








          2





          $begingroup$

          f[θ_, x_] := Sin[θ]^2 - x
          Derivative[1, 0][f][θ, x] /. Solve[f[θ, x] == 0, 0 < θ < 2 π, θ, Reals]
          Integrate[DiracDelta[x - θ]/Abs[%], θ, 0, 2 π] // Total


          enter image description here



          This code should also work for other functions $f$, presumably.






          share|improve this answer











          $endgroup$



          f[θ_, x_] := Sin[θ]^2 - x
          Derivative[1, 0][f][θ, x] /. Solve[f[θ, x] == 0, 0 < θ < 2 π, θ, Reals]
          Integrate[DiracDelta[x - θ]/Abs[%], θ, 0, 2 π] // Total


          enter image description here



          This code should also work for other functions $f$, presumably.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 2 hours ago

























          answered 2 hours ago









          AccidentalFourierTransformAccidentalFourierTransform

          5,18311042




          5,18311042











          • $begingroup$
            You have an extra [θ, x], and your Solve would work better if you added the domain Reals. Probably more robust than just relying on Integrate.
            $endgroup$
            – Carl Woll
            2 hours ago











          • $begingroup$
            @CarlWoll Ah, yes, thank you!
            $endgroup$
            – AccidentalFourierTransform
            2 hours ago
















          • $begingroup$
            You have an extra [θ, x], and your Solve would work better if you added the domain Reals. Probably more robust than just relying on Integrate.
            $endgroup$
            – Carl Woll
            2 hours ago











          • $begingroup$
            @CarlWoll Ah, yes, thank you!
            $endgroup$
            – AccidentalFourierTransform
            2 hours ago















          $begingroup$
          You have an extra [θ, x], and your Solve would work better if you added the domain Reals. Probably more robust than just relying on Integrate.
          $endgroup$
          – Carl Woll
          2 hours ago





          $begingroup$
          You have an extra [θ, x], and your Solve would work better if you added the domain Reals. Probably more robust than just relying on Integrate.
          $endgroup$
          – Carl Woll
          2 hours ago













          $begingroup$
          @CarlWoll Ah, yes, thank you!
          $endgroup$
          – AccidentalFourierTransform
          2 hours ago




          $begingroup$
          @CarlWoll Ah, yes, thank you!
          $endgroup$
          – AccidentalFourierTransform
          2 hours ago

















          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%2f197963%2fintegral-with-diracdelta-can-mathematica-be-made-to-solve-this%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

          Log på Navigationsmenu

          Creating second map without labels using QGIS?How to lock map labels for inset map in Print Composer?How to Force the Showing of Labels of a Vector File in QGISQGIS Valmiera, Labels only show for part of polygonsRemoving duplicate point labels in QGISLabeling every feature using QGIS?Show labels for point features outside map canvasAbbreviate Road Labels in QGIS only when requiredExporting map from composer in QGIS - text labels have moved in output?How to make sure labels in qgis turn up in layout map?Writing label expression with ArcMap and If then Statement?

          Detroit Tigers Spis treści Historia | Skład zespołu | Sukcesy | Członkowie Baseball Hall of Fame | Zastrzeżone numery | Przypisy | Menu nawigacyjneEncyclopedia of Detroit - Detroit TigersTigers Stadium, Detroit, MITigers Timeline 1900sDetroit Tigers Team History & EncyclopediaTigers Timeline 1910s1935 World Series1945 World Series1945 World Series1984 World SeriesComerica Park, Detroit, MI2006 World Series2012 World SeriesDetroit Tigers 40-Man RosterDetroit Tigers Coaching StaffTigers Hall of FamersTigers Retired Numberse