Group Abstract Group Abstract

Message Boards Message Boards

Integral upper limit a function

I am new to Mathematica and am having trouble performing a general multiple integral.

My issue is that the upper limit of the first of a triple integral is a function of the next integration variable.

Mathmatical 9 gives several error messages. 

First, it says that it can't tell if the limit function is real or not. Second, it gives partial answer as a conditional with half a page of real and imaginary constraints.

I cannot deternine how to tell Mathematica that all values and functions are real.

I have checked the syntax multiple times, which is no guarantee of not missing something.

Simple numerical limits show that the integral is not transcendental and gives real values.

I have looked at a half dozen sources to determine how to trouble shoot the integral and how to insert assumptions, but nothing seems to fix the issue.

Any pointers would be welcome.
POSTED BY: Luther Nayhm
10 months ago
Hi. Can you give a simple example of the kind of integral you mention?  A multiple integral where "the upper limit of the first of a triple integral is a function of the next integration variable. If I try to express this as an iterated integral, do you mean something like this:
Integrate[Integrate[f[x, y], {x, 0, 1}], {y, 0, g[x]}]
Integrate[f[x, y], {y, 0, g[x]}, {x, 0, 1}]

You can use the Assumptions option to inform most functions that some constants are supposed to be real. Please see the tutorial on using Assumptions.

If possible, please try giving the smallest example possible of the issue you are seeing. 
POSTED BY: Sean Clarke
10 months ago
I looked at the Assumptions and the Reals useage, but cannot get it to work when I am doing certain integrals. When I re-did the integral again that has been troubling, I found that I had misstated my issue to you before, though both Assumptions and Reals is an issue for me in simplifying the integration times and repetitions.

When I perform Integragte[r1 r2/Sqrt[r1^2+r2^2+d+r1 r2 W],{r1,0,Sqrt[a-z1^2]},{r2,0,Sqrt[a-z2^2]}], the first integral is calulated but the second is not. It is left undone, which usualy means it cannot be done, except that it can be done by hand if the limit d>r1+r2 is involked. However, I have to keep the Sqrt limits regardless of my approach.That is what I cannot get to work.

This integral is further integrated over the z1 and z2 variables, which have simple limits, and there is a final double integral over W(t1,t2). I am trying to find a way of doing the complete integration, but it may not be possible without expanding the integrand as a power series and performing a less complex integral term by term. 

I have had some success with NIntegrate when I can use numerical limits, but not always, since I need to invoke some Assumptions about the limits being real. The equation is a parametric model, and I want to be able to vary d to produce a plot of the integral value vs d.
POSTED BY: Updating Name
10 months ago
Well, Mathematica does a very general check of the expression to find any part that it can simplify. So if your expression contains too many radicals and Log function, it would be fairly difficult to handle since you might not be aware of the really complicated conditions which requires too much computation. A good idea is always to simplify this type of problem at first step.
At first glance the up limit of the integral can be simplified. They do not have dependance. I will just go ahead the do the integral separatedly:
Integrate[x y/Sqrt[x^2 + y^2 + d + x*y*w], x]
Then I will have a result. Use Rule and Replace functions to find the value of the first step integral (I just copy and paste the results): 

Then you can copy the above two expressions into the new integrate function:
y (Sqrt[a^2 + d + a w y + y^2] -
     1/2 w y Log[2 a + w y + 2 Sqrt[a^2 + d + a w y + y^2]]) -
  y (Sqrt[d + y^2] - 1/2 w y Log[w y + 2 Sqrt[d + y^2]]), y]
The result is

Finally, if you really want to have the up limits to be your version, you just need to use the rule function again:
<aforementioned results>/.{a->XXX,b->YYY}
The problem you can see here is that once Mathematica does the symbolic computation, it basically keeps everything there and perhaps more than that you are aware of. Moreover the dependances of the radicals and wrapped Log and fractional power really makes a direct way cheesy. 
POSTED BY: Shenghui Yang
10 months ago
Wow! You know way more than I do about Mathematica. I will have to study your approach.

One point is that my limits need to remain Sqrt functions, since I am performing a specific volume integral and the limits are a sphere as described in cylindrical coordinates. Consequently, I will have to investigate whether your approach as changed the integral into something that is not relevant to the scenario I am modeling.

Other than that, your attention to this issue is much appreciated. I will post back what I will take a while...days? Weeks? But it is something to pursue where there was nothing before.

POSTED BY: Luther Nayhm
10 months ago
 You can have a try of this problem by yourself using Rule and some replace functions in Mathematica first. This is how you learn this languange. 
POSTED BY: Shenghui Yang
10 months ago
I have played around with your approach. It appears that while it works, there are other integrals in the model that cannot be solved symbolically. These occur in the last integrals over the "w" function. I may be able to do this numerically.

On the other hand, your rule and replacement approach will allow me to develop a power series expansion. The "d" in the expression is a function of z1 and z2. I can pull it out of the Sqrt function, which leaves me with 1/Sqrt[1+a] where for most values, a<1 and the series converges. However, I need to actually replace the "a" in the power series by the complete expression and allow Mathematica to do the algebra for me. I can integrate these term by term with simple integrals. It is tedious until I learn how to use other capabilities within Mathematica.

I have run across two other issues, however, with the power series expansion. First, there does not seem to be any one variable about which I can perform the expansion without using the symbol "a" to replace all functions at once.

The second thing is that the variables within the numerator allow the complete integrated series to converge term by term even when I chose values for "d" which would not allow the power series to actually converge. The total integral is more than the sum of its parts as far as the stability of the model is concerned. I did not expect this. What appears to be happening is that each term, in the limit, after being integrated comes to a finite value that is less than one.

POSTED BY: Luther Nayhm
10 months ago