Mathematica newbie: why won't this integrate?

In summary, the conversation is about attempting to integrate a function ψ[x] over all space using Mathematica. The user has tried to use the function ψ[x]*ψ[x] and has attached a notebook file, but has not been able to find a numerical result. The expert suggests using NIntegrate instead of trying to find an exact answer using Mathematica.
  • #1
Flanz
1
0
EDIT: I solved it. Sorry for waste of time! :(

Here is the function ψ[x]:

0.0000551056 a0.25 (30240. a0.5 x - 80640. a1.5 x3 +
48384. a2.5 x5 - 9216. a3.5 x7 + 512. a4.5 x9)(-((a x2)/2))

I am trying to integrate ψ[x]*ψ[x] over all space (-infinity to +infinity).

I don't get any error messages... it just says "running" for a good 5 minutes. Then it grinds to a halt and spits out the integral in its unsolved form.

I have attached the notebook file if anyone is curious. I'm just really stumped on this one.
 

Attachments

  • quantum oscillator.nb
    5.9 KB · Views: 540
Last edited:
Physics news on Phys.org
  • #2
I didn't look at your notebook but sounds like you're trying to find an exact answer which Mathematica cannot find. When it can't integrate it does what you say it does. Surely you're trying to find a numerical result right? Why not use NIntegrate?
 

Related to Mathematica newbie: why won't this integrate?

1. Why won't Mathematica integrate my function?

There could be several reasons why Mathematica is not able to integrate your function. One common reason is that the function may not have a closed-form antiderivative, which is necessary for integration. Another reason could be that the function has special cases or singularities that make it difficult for Mathematica to integrate.

2. How do I fix integration errors in Mathematica?

If Mathematica is giving you integration errors, the first step is to check if your function is defined properly. Make sure there are no typos or missing parentheses. If the function is defined correctly, you can try using different integration methods by specifying the Method option in the Integrate command. You can also try simplifying your function or breaking it into smaller parts before integrating.

3. Can Mathematica integrate symbolic expressions?

Yes, Mathematica has the ability to integrate symbolic expressions and return the antiderivative in terms of symbolic variables. However, the integration may not always be possible or may result in a complex expression.

4. How do I check if my integration result is correct?

One way to check the correctness of your integration result is to use the Wolfram Alpha website. You can enter your function and its integration result to compare it with the result given by Mathematica. Another way is to differentiate the integration result and see if it gives back the original function.

5. Are there any resources for learning how to use integration in Mathematica?

Yes, there are several resources available for learning how to use integration in Mathematica. You can refer to the official Mathematica documentation, which provides detailed explanations and examples for different integration methods. You can also find tutorials and guides online, as well as books on Mathematica that cover integration in depth.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
4K
Back
Top