Forcing Mathematica's Integrate to give more general answers












7












$begingroup$


I have a simple gaussian integral: $int^{infty}_{-infty}dx:e^{ialpha x^2}$.



If $alpha in mathbb{R}$, then:



$$
int^infty_{-infty} dx; e^{i , alpha x^2} = sqrt{frac pi {-i alpha}} qquad qquad alpha <0
$$



Now if $alpha in mathbb{C}$ then we obtain the same answer but with different conditions:



$$
int^infty_{-infty} dx; e^{i , alpha x^2} = sqrt{frac pi {-i alpha}} qquad qquad Im(alpha)>0
$$



These can be combined into a simple answer with an OR statement:



$$
int^infty_{-infty} dx; e^{i , alpha x^2} = sqrt{frac pi {-i alpha}} qquad qquad Im(alpha)=0 , & , Re(alpha) <0 quad|| quad Im(alpha)>0
$$



When I I ask Mathematica to solve this for me



Integrate[E^(I x^2 a), {x, -∞, ∞}]


Mathematica returns only one of these cases:



ConditionalExpression[Sqrt[π]/Sqrt[-I a], Im[a] > 0]


I have tried specifying $Im(alpha)geq 0$ in the Assumptions but Mathematica disregards this and gives the same result. It can of course find the answer for $alpha in mathbb{R}$ but it cannot seem to give a fully general answer where both conditions are present.










share|improve this question











$endgroup$












  • $begingroup$
    Where did this integral come up?
    $endgroup$
    – mjw
    Mar 7 at 18:45
















7












$begingroup$


I have a simple gaussian integral: $int^{infty}_{-infty}dx:e^{ialpha x^2}$.



If $alpha in mathbb{R}$, then:



$$
int^infty_{-infty} dx; e^{i , alpha x^2} = sqrt{frac pi {-i alpha}} qquad qquad alpha <0
$$



Now if $alpha in mathbb{C}$ then we obtain the same answer but with different conditions:



$$
int^infty_{-infty} dx; e^{i , alpha x^2} = sqrt{frac pi {-i alpha}} qquad qquad Im(alpha)>0
$$



These can be combined into a simple answer with an OR statement:



$$
int^infty_{-infty} dx; e^{i , alpha x^2} = sqrt{frac pi {-i alpha}} qquad qquad Im(alpha)=0 , & , Re(alpha) <0 quad|| quad Im(alpha)>0
$$



When I I ask Mathematica to solve this for me



Integrate[E^(I x^2 a), {x, -∞, ∞}]


Mathematica returns only one of these cases:



ConditionalExpression[Sqrt[π]/Sqrt[-I a], Im[a] > 0]


I have tried specifying $Im(alpha)geq 0$ in the Assumptions but Mathematica disregards this and gives the same result. It can of course find the answer for $alpha in mathbb{R}$ but it cannot seem to give a fully general answer where both conditions are present.










share|improve this question











$endgroup$












  • $begingroup$
    Where did this integral come up?
    $endgroup$
    – mjw
    Mar 7 at 18:45














7












7








7


1



$begingroup$


I have a simple gaussian integral: $int^{infty}_{-infty}dx:e^{ialpha x^2}$.



If $alpha in mathbb{R}$, then:



$$
int^infty_{-infty} dx; e^{i , alpha x^2} = sqrt{frac pi {-i alpha}} qquad qquad alpha <0
$$



Now if $alpha in mathbb{C}$ then we obtain the same answer but with different conditions:



$$
int^infty_{-infty} dx; e^{i , alpha x^2} = sqrt{frac pi {-i alpha}} qquad qquad Im(alpha)>0
$$



These can be combined into a simple answer with an OR statement:



$$
int^infty_{-infty} dx; e^{i , alpha x^2} = sqrt{frac pi {-i alpha}} qquad qquad Im(alpha)=0 , & , Re(alpha) <0 quad|| quad Im(alpha)>0
$$



When I I ask Mathematica to solve this for me



Integrate[E^(I x^2 a), {x, -∞, ∞}]


Mathematica returns only one of these cases:



ConditionalExpression[Sqrt[π]/Sqrt[-I a], Im[a] > 0]


I have tried specifying $Im(alpha)geq 0$ in the Assumptions but Mathematica disregards this and gives the same result. It can of course find the answer for $alpha in mathbb{R}$ but it cannot seem to give a fully general answer where both conditions are present.










share|improve this question











$endgroup$




I have a simple gaussian integral: $int^{infty}_{-infty}dx:e^{ialpha x^2}$.



If $alpha in mathbb{R}$, then:



$$
int^infty_{-infty} dx; e^{i , alpha x^2} = sqrt{frac pi {-i alpha}} qquad qquad alpha <0
$$



Now if $alpha in mathbb{C}$ then we obtain the same answer but with different conditions:



$$
int^infty_{-infty} dx; e^{i , alpha x^2} = sqrt{frac pi {-i alpha}} qquad qquad Im(alpha)>0
$$



These can be combined into a simple answer with an OR statement:



$$
int^infty_{-infty} dx; e^{i , alpha x^2} = sqrt{frac pi {-i alpha}} qquad qquad Im(alpha)=0 , & , Re(alpha) <0 quad|| quad Im(alpha)>0
$$



When I I ask Mathematica to solve this for me



Integrate[E^(I x^2 a), {x, -∞, ∞}]


Mathematica returns only one of these cases:



ConditionalExpression[Sqrt[π]/Sqrt[-I a], Im[a] > 0]


I have tried specifying $Im(alpha)geq 0$ in the Assumptions but Mathematica disregards this and gives the same result. It can of course find the answer for $alpha in mathbb{R}$ but it cannot seem to give a fully general answer where both conditions are present.







calculus-and-analysis assumptions






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 8 at 2:04









J. M. is slightly pensive

97.9k10304464




97.9k10304464










asked Mar 7 at 15:02









OldTomMorrisOldTomMorris

30019




30019












  • $begingroup$
    Where did this integral come up?
    $endgroup$
    – mjw
    Mar 7 at 18:45


















  • $begingroup$
    Where did this integral come up?
    $endgroup$
    – mjw
    Mar 7 at 18:45
















$begingroup$
Where did this integral come up?
$endgroup$
– mjw
Mar 7 at 18:45




$begingroup$
Where did this integral come up?
$endgroup$
– mjw
Mar 7 at 18:45










2 Answers
2






active

oldest

votes


















7












$begingroup$

If $alpha$ is complex, then yes, The imaginary part of alpha should be strictly greater than zero. If $alpha$ is real, does it converge? If you complete the contour in the complex plane, with a semicircle, and replace $x$ by $z=x+ i y$, I do not see the integral converging along the semicircle.



$mathbf{UPDATE:}$



Okay, I looked the integral up in Gradshteyn and Ryzhik, Table of Integrals, Series, and Products, 6$^textrm{th}$ edition, p. 333. Looks like the integral for $alpha$ real converges for $alpha<0$ but with limits zero to infinity.



$displaystyle int_0^infty e^{-ilambda x^2} dx = frac{1}{2} sqrt{frac{pi}{lambda}} e^{-ipi/4}, quad (lambda>0)$.



We can infer from this (let $w=-x$ $Rightarrow$ $dw = - dx$)



$displaystyle int_{-infty}^infty e^{-ilambda x^2} dx = sqrt{frac{pi}{lambda}} e^{-ipi/4}, quad (lambda>0)$.



Replacing $lambda$ by $-lambda$ we get the complex conjugate:



$displaystyle int_{-infty}^infty e^{ilambda x^2} dx = sqrt{frac{pi}{-lambda}} e^{ipi/4}, quad (lambda<0)$.



Combining these:



$displaystyle int_{-infty}^infty e^{-ilambda x^2} dx = sqrt{frac{pi}{lambda}} e^{ - ipi ,textrm{sign }{(lambda)} /4}, quad (lambda ne 0, lambda in Re)$.



This is consistent with what Mathematica (Version 11.2.0.0, Mac OS X) gives:



Assuming[Element[a,Reals],Integrate[Exp[I a x^2],{x,-Infinity,Infinity}]


returning



Sqrt[Pi]/2 (1+ I Sign[a])/Sqrt[Abs[a]]


If anybody has an idea how to compute this integral with contour integration (or otherwise) from first principals, that would be interesting!



Also, we still haven't answered why Mathematica assumes that $alpha$ is not real if $alpha in mathbb{C}$!



$mathbf{ADDITIONAL ,, UPDATE:}$



This will take into account each case, and output the result or indicate if the integral does not converge:



q[a_] := Integrate[Exp[I a x^2], {x, -Infinity, Infinity}]; 
integral[a_] := If[Element[a, Reals], Assuming[Element[a, Reals], q[a]], q[a]];


Here are a few examples:



enter image description here






share|improve this answer











$endgroup$









  • 1




    $begingroup$
    I don't think Mathematica gave the proper response $alpha<0$. If it converges for $alpha<0$ why not $alpha>0$. and does it converge?
    $endgroup$
    – mjw
    Mar 7 at 15:38












  • $begingroup$
    I have assumed $x in mathbb{R}$ so convergence in that sense has not been accounted for.
    $endgroup$
    – OldTomMorris
    Mar 7 at 16:28










  • $begingroup$
    Well, I believe Gradshteyn and Ryzhik's listing. We can then make some substitutions to compute what happens for $alpha>0$. Mathematica (ver. 11.2) gives an answer that is consistent. Obviously, the integral diverges for $alpha=0$. Mathematica's result $rightarrow infty$ there.
    $endgroup$
    – mjw
    Mar 7 at 18:44










  • $begingroup$
    "Also, we still haven't answered why Mathematica assumes that 𝛼 is not real if 𝛼 ∈ ℂ!". This is exactly my problem!
    $endgroup$
    – OldTomMorris
    Mar 8 at 10:26








  • 1




    $begingroup$
    Agreed! I've updated my answer to output what we would have liked to have seen for cases when $alpha$ is real and when $alpha$ has a nonzero imaginary part.
    $endgroup$
    – mjw
    Mar 8 at 18:36



















4












$begingroup$

By default, Mathematica assumes all symbols are complex valued, so this is what you get if you don't specify. You can see all the variations by making assumptions:



Integrate[E^(I x^2 a), {x, -∞, ∞}, Assumptions -> #] 
& /@ {a ∈ Complexes, a ∈ Reals, Im[a] == 0,
Im[a] < 0, Im[a] > 0, Re[a] == 0, Im[a] >= 0, a == 0, a < 0}


One of these doesn't converge and another is equal to infinity, but they do give the full range of possibilities.






share|improve this answer











$endgroup$













    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: "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%2f192797%2fforcing-mathematicas-integrate-to-give-more-general-answers%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









    7












    $begingroup$

    If $alpha$ is complex, then yes, The imaginary part of alpha should be strictly greater than zero. If $alpha$ is real, does it converge? If you complete the contour in the complex plane, with a semicircle, and replace $x$ by $z=x+ i y$, I do not see the integral converging along the semicircle.



    $mathbf{UPDATE:}$



    Okay, I looked the integral up in Gradshteyn and Ryzhik, Table of Integrals, Series, and Products, 6$^textrm{th}$ edition, p. 333. Looks like the integral for $alpha$ real converges for $alpha<0$ but with limits zero to infinity.



    $displaystyle int_0^infty e^{-ilambda x^2} dx = frac{1}{2} sqrt{frac{pi}{lambda}} e^{-ipi/4}, quad (lambda>0)$.



    We can infer from this (let $w=-x$ $Rightarrow$ $dw = - dx$)



    $displaystyle int_{-infty}^infty e^{-ilambda x^2} dx = sqrt{frac{pi}{lambda}} e^{-ipi/4}, quad (lambda>0)$.



    Replacing $lambda$ by $-lambda$ we get the complex conjugate:



    $displaystyle int_{-infty}^infty e^{ilambda x^2} dx = sqrt{frac{pi}{-lambda}} e^{ipi/4}, quad (lambda<0)$.



    Combining these:



    $displaystyle int_{-infty}^infty e^{-ilambda x^2} dx = sqrt{frac{pi}{lambda}} e^{ - ipi ,textrm{sign }{(lambda)} /4}, quad (lambda ne 0, lambda in Re)$.



    This is consistent with what Mathematica (Version 11.2.0.0, Mac OS X) gives:



    Assuming[Element[a,Reals],Integrate[Exp[I a x^2],{x,-Infinity,Infinity}]


    returning



    Sqrt[Pi]/2 (1+ I Sign[a])/Sqrt[Abs[a]]


    If anybody has an idea how to compute this integral with contour integration (or otherwise) from first principals, that would be interesting!



    Also, we still haven't answered why Mathematica assumes that $alpha$ is not real if $alpha in mathbb{C}$!



    $mathbf{ADDITIONAL ,, UPDATE:}$



    This will take into account each case, and output the result or indicate if the integral does not converge:



    q[a_] := Integrate[Exp[I a x^2], {x, -Infinity, Infinity}]; 
    integral[a_] := If[Element[a, Reals], Assuming[Element[a, Reals], q[a]], q[a]];


    Here are a few examples:



    enter image description here






    share|improve this answer











    $endgroup$









    • 1




      $begingroup$
      I don't think Mathematica gave the proper response $alpha<0$. If it converges for $alpha<0$ why not $alpha>0$. and does it converge?
      $endgroup$
      – mjw
      Mar 7 at 15:38












    • $begingroup$
      I have assumed $x in mathbb{R}$ so convergence in that sense has not been accounted for.
      $endgroup$
      – OldTomMorris
      Mar 7 at 16:28










    • $begingroup$
      Well, I believe Gradshteyn and Ryzhik's listing. We can then make some substitutions to compute what happens for $alpha>0$. Mathematica (ver. 11.2) gives an answer that is consistent. Obviously, the integral diverges for $alpha=0$. Mathematica's result $rightarrow infty$ there.
      $endgroup$
      – mjw
      Mar 7 at 18:44










    • $begingroup$
      "Also, we still haven't answered why Mathematica assumes that 𝛼 is not real if 𝛼 ∈ ℂ!". This is exactly my problem!
      $endgroup$
      – OldTomMorris
      Mar 8 at 10:26








    • 1




      $begingroup$
      Agreed! I've updated my answer to output what we would have liked to have seen for cases when $alpha$ is real and when $alpha$ has a nonzero imaginary part.
      $endgroup$
      – mjw
      Mar 8 at 18:36
















    7












    $begingroup$

    If $alpha$ is complex, then yes, The imaginary part of alpha should be strictly greater than zero. If $alpha$ is real, does it converge? If you complete the contour in the complex plane, with a semicircle, and replace $x$ by $z=x+ i y$, I do not see the integral converging along the semicircle.



    $mathbf{UPDATE:}$



    Okay, I looked the integral up in Gradshteyn and Ryzhik, Table of Integrals, Series, and Products, 6$^textrm{th}$ edition, p. 333. Looks like the integral for $alpha$ real converges for $alpha<0$ but with limits zero to infinity.



    $displaystyle int_0^infty e^{-ilambda x^2} dx = frac{1}{2} sqrt{frac{pi}{lambda}} e^{-ipi/4}, quad (lambda>0)$.



    We can infer from this (let $w=-x$ $Rightarrow$ $dw = - dx$)



    $displaystyle int_{-infty}^infty e^{-ilambda x^2} dx = sqrt{frac{pi}{lambda}} e^{-ipi/4}, quad (lambda>0)$.



    Replacing $lambda$ by $-lambda$ we get the complex conjugate:



    $displaystyle int_{-infty}^infty e^{ilambda x^2} dx = sqrt{frac{pi}{-lambda}} e^{ipi/4}, quad (lambda<0)$.



    Combining these:



    $displaystyle int_{-infty}^infty e^{-ilambda x^2} dx = sqrt{frac{pi}{lambda}} e^{ - ipi ,textrm{sign }{(lambda)} /4}, quad (lambda ne 0, lambda in Re)$.



    This is consistent with what Mathematica (Version 11.2.0.0, Mac OS X) gives:



    Assuming[Element[a,Reals],Integrate[Exp[I a x^2],{x,-Infinity,Infinity}]


    returning



    Sqrt[Pi]/2 (1+ I Sign[a])/Sqrt[Abs[a]]


    If anybody has an idea how to compute this integral with contour integration (or otherwise) from first principals, that would be interesting!



    Also, we still haven't answered why Mathematica assumes that $alpha$ is not real if $alpha in mathbb{C}$!



    $mathbf{ADDITIONAL ,, UPDATE:}$



    This will take into account each case, and output the result or indicate if the integral does not converge:



    q[a_] := Integrate[Exp[I a x^2], {x, -Infinity, Infinity}]; 
    integral[a_] := If[Element[a, Reals], Assuming[Element[a, Reals], q[a]], q[a]];


    Here are a few examples:



    enter image description here






    share|improve this answer











    $endgroup$









    • 1




      $begingroup$
      I don't think Mathematica gave the proper response $alpha<0$. If it converges for $alpha<0$ why not $alpha>0$. and does it converge?
      $endgroup$
      – mjw
      Mar 7 at 15:38












    • $begingroup$
      I have assumed $x in mathbb{R}$ so convergence in that sense has not been accounted for.
      $endgroup$
      – OldTomMorris
      Mar 7 at 16:28










    • $begingroup$
      Well, I believe Gradshteyn and Ryzhik's listing. We can then make some substitutions to compute what happens for $alpha>0$. Mathematica (ver. 11.2) gives an answer that is consistent. Obviously, the integral diverges for $alpha=0$. Mathematica's result $rightarrow infty$ there.
      $endgroup$
      – mjw
      Mar 7 at 18:44










    • $begingroup$
      "Also, we still haven't answered why Mathematica assumes that 𝛼 is not real if 𝛼 ∈ ℂ!". This is exactly my problem!
      $endgroup$
      – OldTomMorris
      Mar 8 at 10:26








    • 1




      $begingroup$
      Agreed! I've updated my answer to output what we would have liked to have seen for cases when $alpha$ is real and when $alpha$ has a nonzero imaginary part.
      $endgroup$
      – mjw
      Mar 8 at 18:36














    7












    7








    7





    $begingroup$

    If $alpha$ is complex, then yes, The imaginary part of alpha should be strictly greater than zero. If $alpha$ is real, does it converge? If you complete the contour in the complex plane, with a semicircle, and replace $x$ by $z=x+ i y$, I do not see the integral converging along the semicircle.



    $mathbf{UPDATE:}$



    Okay, I looked the integral up in Gradshteyn and Ryzhik, Table of Integrals, Series, and Products, 6$^textrm{th}$ edition, p. 333. Looks like the integral for $alpha$ real converges for $alpha<0$ but with limits zero to infinity.



    $displaystyle int_0^infty e^{-ilambda x^2} dx = frac{1}{2} sqrt{frac{pi}{lambda}} e^{-ipi/4}, quad (lambda>0)$.



    We can infer from this (let $w=-x$ $Rightarrow$ $dw = - dx$)



    $displaystyle int_{-infty}^infty e^{-ilambda x^2} dx = sqrt{frac{pi}{lambda}} e^{-ipi/4}, quad (lambda>0)$.



    Replacing $lambda$ by $-lambda$ we get the complex conjugate:



    $displaystyle int_{-infty}^infty e^{ilambda x^2} dx = sqrt{frac{pi}{-lambda}} e^{ipi/4}, quad (lambda<0)$.



    Combining these:



    $displaystyle int_{-infty}^infty e^{-ilambda x^2} dx = sqrt{frac{pi}{lambda}} e^{ - ipi ,textrm{sign }{(lambda)} /4}, quad (lambda ne 0, lambda in Re)$.



    This is consistent with what Mathematica (Version 11.2.0.0, Mac OS X) gives:



    Assuming[Element[a,Reals],Integrate[Exp[I a x^2],{x,-Infinity,Infinity}]


    returning



    Sqrt[Pi]/2 (1+ I Sign[a])/Sqrt[Abs[a]]


    If anybody has an idea how to compute this integral with contour integration (or otherwise) from first principals, that would be interesting!



    Also, we still haven't answered why Mathematica assumes that $alpha$ is not real if $alpha in mathbb{C}$!



    $mathbf{ADDITIONAL ,, UPDATE:}$



    This will take into account each case, and output the result or indicate if the integral does not converge:



    q[a_] := Integrate[Exp[I a x^2], {x, -Infinity, Infinity}]; 
    integral[a_] := If[Element[a, Reals], Assuming[Element[a, Reals], q[a]], q[a]];


    Here are a few examples:



    enter image description here






    share|improve this answer











    $endgroup$



    If $alpha$ is complex, then yes, The imaginary part of alpha should be strictly greater than zero. If $alpha$ is real, does it converge? If you complete the contour in the complex plane, with a semicircle, and replace $x$ by $z=x+ i y$, I do not see the integral converging along the semicircle.



    $mathbf{UPDATE:}$



    Okay, I looked the integral up in Gradshteyn and Ryzhik, Table of Integrals, Series, and Products, 6$^textrm{th}$ edition, p. 333. Looks like the integral for $alpha$ real converges for $alpha<0$ but with limits zero to infinity.



    $displaystyle int_0^infty e^{-ilambda x^2} dx = frac{1}{2} sqrt{frac{pi}{lambda}} e^{-ipi/4}, quad (lambda>0)$.



    We can infer from this (let $w=-x$ $Rightarrow$ $dw = - dx$)



    $displaystyle int_{-infty}^infty e^{-ilambda x^2} dx = sqrt{frac{pi}{lambda}} e^{-ipi/4}, quad (lambda>0)$.



    Replacing $lambda$ by $-lambda$ we get the complex conjugate:



    $displaystyle int_{-infty}^infty e^{ilambda x^2} dx = sqrt{frac{pi}{-lambda}} e^{ipi/4}, quad (lambda<0)$.



    Combining these:



    $displaystyle int_{-infty}^infty e^{-ilambda x^2} dx = sqrt{frac{pi}{lambda}} e^{ - ipi ,textrm{sign }{(lambda)} /4}, quad (lambda ne 0, lambda in Re)$.



    This is consistent with what Mathematica (Version 11.2.0.0, Mac OS X) gives:



    Assuming[Element[a,Reals],Integrate[Exp[I a x^2],{x,-Infinity,Infinity}]


    returning



    Sqrt[Pi]/2 (1+ I Sign[a])/Sqrt[Abs[a]]


    If anybody has an idea how to compute this integral with contour integration (or otherwise) from first principals, that would be interesting!



    Also, we still haven't answered why Mathematica assumes that $alpha$ is not real if $alpha in mathbb{C}$!



    $mathbf{ADDITIONAL ,, UPDATE:}$



    This will take into account each case, and output the result or indicate if the integral does not converge:



    q[a_] := Integrate[Exp[I a x^2], {x, -Infinity, Infinity}]; 
    integral[a_] := If[Element[a, Reals], Assuming[Element[a, Reals], q[a]], q[a]];


    Here are a few examples:



    enter image description here







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Mar 8 at 17:49

























    answered Mar 7 at 15:13









    mjwmjw

    5879




    5879








    • 1




      $begingroup$
      I don't think Mathematica gave the proper response $alpha<0$. If it converges for $alpha<0$ why not $alpha>0$. and does it converge?
      $endgroup$
      – mjw
      Mar 7 at 15:38












    • $begingroup$
      I have assumed $x in mathbb{R}$ so convergence in that sense has not been accounted for.
      $endgroup$
      – OldTomMorris
      Mar 7 at 16:28










    • $begingroup$
      Well, I believe Gradshteyn and Ryzhik's listing. We can then make some substitutions to compute what happens for $alpha>0$. Mathematica (ver. 11.2) gives an answer that is consistent. Obviously, the integral diverges for $alpha=0$. Mathematica's result $rightarrow infty$ there.
      $endgroup$
      – mjw
      Mar 7 at 18:44










    • $begingroup$
      "Also, we still haven't answered why Mathematica assumes that 𝛼 is not real if 𝛼 ∈ ℂ!". This is exactly my problem!
      $endgroup$
      – OldTomMorris
      Mar 8 at 10:26








    • 1




      $begingroup$
      Agreed! I've updated my answer to output what we would have liked to have seen for cases when $alpha$ is real and when $alpha$ has a nonzero imaginary part.
      $endgroup$
      – mjw
      Mar 8 at 18:36














    • 1




      $begingroup$
      I don't think Mathematica gave the proper response $alpha<0$. If it converges for $alpha<0$ why not $alpha>0$. and does it converge?
      $endgroup$
      – mjw
      Mar 7 at 15:38












    • $begingroup$
      I have assumed $x in mathbb{R}$ so convergence in that sense has not been accounted for.
      $endgroup$
      – OldTomMorris
      Mar 7 at 16:28










    • $begingroup$
      Well, I believe Gradshteyn and Ryzhik's listing. We can then make some substitutions to compute what happens for $alpha>0$. Mathematica (ver. 11.2) gives an answer that is consistent. Obviously, the integral diverges for $alpha=0$. Mathematica's result $rightarrow infty$ there.
      $endgroup$
      – mjw
      Mar 7 at 18:44










    • $begingroup$
      "Also, we still haven't answered why Mathematica assumes that 𝛼 is not real if 𝛼 ∈ ℂ!". This is exactly my problem!
      $endgroup$
      – OldTomMorris
      Mar 8 at 10:26








    • 1




      $begingroup$
      Agreed! I've updated my answer to output what we would have liked to have seen for cases when $alpha$ is real and when $alpha$ has a nonzero imaginary part.
      $endgroup$
      – mjw
      Mar 8 at 18:36








    1




    1




    $begingroup$
    I don't think Mathematica gave the proper response $alpha<0$. If it converges for $alpha<0$ why not $alpha>0$. and does it converge?
    $endgroup$
    – mjw
    Mar 7 at 15:38






    $begingroup$
    I don't think Mathematica gave the proper response $alpha<0$. If it converges for $alpha<0$ why not $alpha>0$. and does it converge?
    $endgroup$
    – mjw
    Mar 7 at 15:38














    $begingroup$
    I have assumed $x in mathbb{R}$ so convergence in that sense has not been accounted for.
    $endgroup$
    – OldTomMorris
    Mar 7 at 16:28




    $begingroup$
    I have assumed $x in mathbb{R}$ so convergence in that sense has not been accounted for.
    $endgroup$
    – OldTomMorris
    Mar 7 at 16:28












    $begingroup$
    Well, I believe Gradshteyn and Ryzhik's listing. We can then make some substitutions to compute what happens for $alpha>0$. Mathematica (ver. 11.2) gives an answer that is consistent. Obviously, the integral diverges for $alpha=0$. Mathematica's result $rightarrow infty$ there.
    $endgroup$
    – mjw
    Mar 7 at 18:44




    $begingroup$
    Well, I believe Gradshteyn and Ryzhik's listing. We can then make some substitutions to compute what happens for $alpha>0$. Mathematica (ver. 11.2) gives an answer that is consistent. Obviously, the integral diverges for $alpha=0$. Mathematica's result $rightarrow infty$ there.
    $endgroup$
    – mjw
    Mar 7 at 18:44












    $begingroup$
    "Also, we still haven't answered why Mathematica assumes that 𝛼 is not real if 𝛼 ∈ ℂ!". This is exactly my problem!
    $endgroup$
    – OldTomMorris
    Mar 8 at 10:26






    $begingroup$
    "Also, we still haven't answered why Mathematica assumes that 𝛼 is not real if 𝛼 ∈ ℂ!". This is exactly my problem!
    $endgroup$
    – OldTomMorris
    Mar 8 at 10:26






    1




    1




    $begingroup$
    Agreed! I've updated my answer to output what we would have liked to have seen for cases when $alpha$ is real and when $alpha$ has a nonzero imaginary part.
    $endgroup$
    – mjw
    Mar 8 at 18:36




    $begingroup$
    Agreed! I've updated my answer to output what we would have liked to have seen for cases when $alpha$ is real and when $alpha$ has a nonzero imaginary part.
    $endgroup$
    – mjw
    Mar 8 at 18:36











    4












    $begingroup$

    By default, Mathematica assumes all symbols are complex valued, so this is what you get if you don't specify. You can see all the variations by making assumptions:



    Integrate[E^(I x^2 a), {x, -∞, ∞}, Assumptions -> #] 
    & /@ {a ∈ Complexes, a ∈ Reals, Im[a] == 0,
    Im[a] < 0, Im[a] > 0, Re[a] == 0, Im[a] >= 0, a == 0, a < 0}


    One of these doesn't converge and another is equal to infinity, but they do give the full range of possibilities.






    share|improve this answer











    $endgroup$


















      4












      $begingroup$

      By default, Mathematica assumes all symbols are complex valued, so this is what you get if you don't specify. You can see all the variations by making assumptions:



      Integrate[E^(I x^2 a), {x, -∞, ∞}, Assumptions -> #] 
      & /@ {a ∈ Complexes, a ∈ Reals, Im[a] == 0,
      Im[a] < 0, Im[a] > 0, Re[a] == 0, Im[a] >= 0, a == 0, a < 0}


      One of these doesn't converge and another is equal to infinity, but they do give the full range of possibilities.






      share|improve this answer











      $endgroup$
















        4












        4








        4





        $begingroup$

        By default, Mathematica assumes all symbols are complex valued, so this is what you get if you don't specify. You can see all the variations by making assumptions:



        Integrate[E^(I x^2 a), {x, -∞, ∞}, Assumptions -> #] 
        & /@ {a ∈ Complexes, a ∈ Reals, Im[a] == 0,
        Im[a] < 0, Im[a] > 0, Re[a] == 0, Im[a] >= 0, a == 0, a < 0}


        One of these doesn't converge and another is equal to infinity, but they do give the full range of possibilities.






        share|improve this answer











        $endgroup$



        By default, Mathematica assumes all symbols are complex valued, so this is what you get if you don't specify. You can see all the variations by making assumptions:



        Integrate[E^(I x^2 a), {x, -∞, ∞}, Assumptions -> #] 
        & /@ {a ∈ Complexes, a ∈ Reals, Im[a] == 0,
        Im[a] < 0, Im[a] > 0, Re[a] == 0, Im[a] >= 0, a == 0, a < 0}


        One of these doesn't converge and another is equal to infinity, but they do give the full range of possibilities.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Mar 7 at 21:43









        MarcoB

        37.5k556113




        37.5k556113










        answered Mar 7 at 15:41









        bill sbill s

        54.2k377156




        54.2k377156






























            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%2f192797%2fforcing-mathematicas-integrate-to-give-more-general-answers%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

            How to change which sound is reproduced for terminal bell?

            Can I use Tabulator js library in my java Spring + Thymeleaf project?

            Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents