Items tagged with integral integral Tagged Items Feed

This is the code. I am sure that the mistakes must be something about t0,I1(t) and I2(t) because everything else works well.

for t0 = NextZero(proc (t) options operator, arrow; Phi(t) end proc, 0) I want to get the root of Phi(t)=0 and I denote the root as t0.

for I1(t) and I2(t) I want to get the integral considering the t is parameter and x is the variable so after the integral I can get two funcions of t. And the limits of I2(t) should also be a funcion of t.


The two forms below (eqn1 and eqn2) give the same result. You can convert from eqn1 to eqn2 using the expand option but is there a way can you get Maple to simplify eqn2 back to eqn1?

( I have tried all the simplify options I know)


eqn1:= int(int(k(upsilon)*h(tau)*x(t-tau)*x(t-upsilon), tau = -infinity .. infinity), upsilon = -infinity .. infinity)


eqn2:= (int(h(tau)*x(t-tau), tau = -infinity .. infinity))*(int(k(upsilon)*x(t-upsilon), upsilon = -infinity .. infinity))




Dear all,

I am using Maple to perform numerical integrations. When the final index in the loop is set to 5, the computation is fast and the results are quickly delivered. When I set a number higher than that, even 6, the program gets really slow and often crashes.

I herewith attach the script I use to generate the results. I guess that there should be a problem of memory management and I tried to use gc() as suggested in some forms but without success. I would appreciate it if someone here could explain the reason behind the problem.

Thank you,

restart; Ts := 1.; sigma := 1.; C := 1.; B := 2./(1+C); with(inttrans); beta := B*Ts*omega; assume(Tb > 0); assume(u >= 0); FzzS := -(3/2)*u^3*((2*u+I*beta)*(exp(2*sigma*u)+sigma^2*exp(2*u))-4*sigma*u*((1+sigma)*u-1))/((2*u+I*beta)^2*exp((2*(1+sigma))*u)-4*u^2*((1+sigma)*u-1)^2); InvFzzS := simplify(invfourier(FzzS, omega, t)); logTimeMin := -2; logTimeMax := -1; NumSteps := 6; logTimeStep := evalf(1.0*(logTimeMax-logTimeMin)/NumSteps); curdirectory(); A := matrix(NumSteps, 2); T1 := Array(1 .. NumSteps); AF := Array(1 .. NumSteps); for i to NumSteps do logTime := evalf(i*logTimeStep+logTimeMin); curTime := evalf(10^logTime); A[i, 1] := curTime; A[i, 2] := evalf(Int(eval(InvFzzS, t = curTime), u = 0 .. infinity, epsilon = 10^(-5))); T1[i] := A[i, 1]; AF[i] := A[i, 2] end do






This is the code


Let me explain it.

I am sure that the mistakes must be about the expresstion of the I1(t) and I2(t). Actually if you delete I1(t) and I2(t) , the whole code works and get the picture at the bottom. 

What I want is to put the expresstion of the I1(t) and I2(t) into 'sol:=dsolve...' and 'plots...' to get the picture of I1(t) and I2(t) with respect to t. Before the t* which subject to Phi(t*)=0 (The blue line in the picture at the bottom is Phi) I want I1(t) and after t* I want I2(t).

I1(t) = (int(sqrt(2*(H(t)+omega*cos(q(t)))), q(t) = q(t)-2*Pi .. q(t), numeric))/Pi.    what I want of this experesstion is to get  'int(sqrt(2*(H(t)+omega*cos(q(t)))' from  'q(t)-2*Pi' to 'q(t)' by numeric method.This q(t) is the solution of the ODE sys.

For example(the number I used is not true,just for example) , at the point t=20, q(t)=30-2*Pi.

so I1(t)= (int(sqrt(2*(H(t)+omega*cos(x))), x = 30-2*Pi .. 30, numeric))/Pi.The I2(t) I want is similar to I1(t).


How can I solve it?

In this code I'm trying to separately normalize two independent probability densities and then combine them to get the joint probability density that's normalized and then use it to calculate the probability that the two variables are equal. fD(x) is a Gaussian divided by x^2 and fA(x) is a Gaussian. The first problem occurs when I'm checking the normalization of the joint probability density by doing the double integral over all space for fD(x)*fA(y)dxdy, I get weird vanishing number when the parameter "hartree" takes a certain value, namely 27.211. If I change hartree to 27 or 1 or 2 it all worked, but 27.211 is not good. Also later when I do a single integral over all space for fD(x)*fA(x)dx to get the probability that these two are equal, I find the result is dependent on hartree. This hartree thing is a unit conversion in my physical problem and in principle should not interfere with either the normalization or the probability result at all. I suspect this is a coding bug but I can't find what it is. I'd appreciate any input.

Thank you very much!


Edit: I found out that the problem with the double integral normalization may have something to do with the discretization for numerical evaluation of the integral, since if I change the lower bound to 1/hartree and upper to 10/hartree then it's fine, however if I use lower bound at 1/hartree and upper at 5/hartree it doesn't work, although the distribution has no value between 5/hartree and 10/hartree. However after this is fixed I still have the problem with the single integral over all space for fD(x)*fA(x)dx changing with hartree. Well as a probability I would expect the integral to be bound between 0 and 1, but since it almost linearly depends on hartree, at hartree around 27 I would get the integral value to be about 25, which doesn't make sense. In fact, I now suspect it is not Maple, but my calculation of the probability of the two random variables taking the same value is wrong, I'd appreciate it very much if someone can confirm this.

Hi all


Please help me to solve this Integral...



when the variable is in limits of integration?

there exist an error : 

Error, (in int) unable to compute a numeric answer for symbolic limits, q = -3.141592654+arccos(11./(1.+.1000000000*t)) .. 3.141592654-1.*arccos(11./(1.+.1000000000*t))

How to make this code work?


     I have a list of 603 integrals that I want to evaluate. Unfortunately, I can't get Maple to do most of them. Mathematica can do some that Maple can't, and returns an answer in terms of BesselJ functions. So my question is 2-fold

1) Is there a way to make Maple do this integral?
2) If not, is there a way to efficiently convert 603 expessions to Mathematica and back?


assume(k1::real, k2::real, R::real, R>0);
a :=cos(x)*exp(I*(k1*R*sin(x)+k2*R*sin(x)-4*x))*sin(x):
int(a, x=-Pi/2..Pi/2) assuming real;



assume(k1::real, k2::real, R::real, R>0);

a :=cos(x)*exp(I*(k1*R*sin(x)+k2*R*sin(x)-4*x))*sin(x)



int(a, x=-Pi/2..Pi/2) assuming real;

int(cos(x)*exp(I*(k1*R*sin(x)+k2*R*sin(x)-4*x))*sin(x), x = -(1/2)*Pi .. (1/2)*Pi)


Mathematica Answer

ans := -(1/((k1 + k2)^6*R^6))*2*I*Pi*
10*(k1 + k2)^4*Pi*R^4*BesselJ(2, sqrt((k1 + k2)^2*R^2))
+ 2*Pi ((k1 + k2)^2*R^2)^(3/2) (-30 + (k1 + k2)^2*R^2) *BesselJ(3, sqrt((k1 + k2)^2*R^2))
- (k1 + k2)^4*R^4*(-(k1 + k2)*R*cos((k1 + k2)*R) + sin((k1 + k2)*R))
+ 8*(k1 + k2)^2*R^2*(-(k1 + k2)*R*(-6 + (k1 + k2)^2*R^2)*cos((k1 + k2)*R) + 3*(-2 + (k1 + k2)^2*R^2)*sin((k1 + k2)*R))
- 8*(-(k1 + k2)*R*(
120 - 20*k2^2*R^2 + k1^4*R^4 + 4*k1^3*k2*R^4 +

 k2^4*R^4 + 4*k1*k2*R^2*(-10 + k2^2*R^2) +

 k1^2*(-20*R^2 + 6*k2^2*R^4))*cos((k1 + k2)*R) +

 5*(24 - 12*k2^2*R^2 + k1^4*R^4 + 4*k1^3*k2*R^4 + k2^4*R^4 +

 4*k1*k2*R^2*(-6 + k2^2*R^2) +

 6*k1^2*R^2*(-2 + k2^2*R^2))*sin((k1 + k2)*R)

-(2*I)*Pi*(10*(k1+k2)^4*Pi*R^4*BesselJ(2, (k1+k2)*R)+2*Pi((k1+k2)^2*R^2)^(3/2)*BesselJ(3, (k1+k2)*R)-(k1+k2)^4*R^4*(-(k1+k2)*R*cos((k1+k2)*R)+sin((k1+k2)*R))+8*(k1+k2)^2*R^2*(-(k1+k2)*R*(-6+(k1+k2)^2*R^2)*cos((k1+k2)*R)+3*(-2+(k1+k2)^2*R^2)*sin((k1+k2)*R))+8*(k1+k2)*R*(120-20*R^2*k2^2+k1^4*R^4+4*k1^3*k2*R^4+k2^4*R^4+4*k1*k2*R^2*(R^2*k2^2-10)+k1^2*(6*R^4*k2^2-20*R^2))*cos((k1+k2)*R)-40*(24-12*R^2*k2^2+k1^4*R^4+4*k1^3*k2*R^4+k2^4*R^4+4*k1*k2*R^2*(R^2*k2^2-6)+6*k1^2*R^2*(R^2*k2^2-2))*sin((k1+k2)*R))/((k1+k2)^6*R^6)





My goal is to plot the integral J with respect to t and as you can see J is a piecewise function.

This is my code.


Actually it's a problem about adiabatic invariants.

If you want to know the backgroud please see this link.

hi all

how can i solve this program?


How to simplify this result in order it returns the correct answer i.e : sqrt(Pi)/2*exp(-2*abs(x))  -infinity<x<infinity.

int(exp(-t^2-x^2*t^-2), t = 0 .. infinity);

print(`output redirected...`); # input placeholder
1 |
- |
2 \
            /     /                    / 2            \
  1   (1/2) |     |                    |t  + csgn(x) x|
- - Pi      |limit|exp(4 csgn(x) x) erf|--------------|
  2         \     \                    \      t       /

                           /  2            \                  \\
                           |-t  + csgn(x) x|                  ||
   - exp(4 csgn(x) x) - erf|---------------| + 1, t = 0, right||
                           \       t       /                  //

   + Pi     | exp(-2 csgn(x) x)


It comes from Peirces's Tables No 510.

I have notice that Maple's integrator is very efficient.It is one  integral from these tables that Maple can't handle directly.

To be contined later.



I have some X-Y data, and I would like to calculate a definate integral of the data. In this case x_data and y_data are vectors.

I tried this method.


But when I try to calculate an integral like this, I get an error.

int(y, x0..x1)

Error, (in int) operator y cannot be evaluated at one variable.

What is this error trying to tell me? I have tested by function y for values x1 and x2. My data is smooth and includes x1 and x2. I have no reason to believe that the function cannot be evaluated for any value of x. 

Is there another (better) way to do what I want? This is a part of a large worksheet that reads data from an excel file, and I don't know how to reduce the worksheet for only this problem.


The following integral
f := u-> int(-1/(x*sqrt(-1+u^2*(x+1)^2*x^2)), x = (1/2)*(-u-sqrt(u^2-4*u))/u .. (1/2)*(-u+sqrt(u^2-4*u))/u);
arised in an applied research. I was asked about its properties:
plot on RealRange(4,infinity), limit(f(u),u=4,right), limit(f(u),u=infinity).
Unfortunately, I lost a file. As far as I remember it, I have had a problem with
the last-named one only:

limit(f(u), u = infinity);

MultiSeries:-limit(f(u), u = infinity);

asympt(f(u), u, 2);

Error, (in asympt) unable to compute series

Hope my colleagues will make progress with it. The assumed value is Pi/2.

I would like integrate and plot the following double integral:


I enclosed


I'm trying to define a function by a definite integral. For this, first we define the following  procedure



and the map


So, for a given m, my desired  "function" should be fun(curva(m,t)). The problem here, is that this function not work because, for instance, for m=2 the command fun(curva(2,t)) returns the below expession, which i think is wrong (where is the expression on "sin" or "cos(2*Pi*t)" ???)

Somebody can help me??



1 2 3 4 5 6 7 Last Page 1 of 35