Items tagged with integration integration Tagged Items Feed

Hello Everyone


I have an expression which I would like to integrate from x=0 to x=L. The expression is 



Here, beta, m, alpha are constant. However I want the result in terms of these quantities.


I will be grateful if you could help mw in this regard.

Thanks a lot.

Dear all,

I have somme difficulties to calculate this integral.

int(I*sqrt((R*exp(I*theta)+1)/(R*exp(I*theta)-a)), theta = 0 .. Pi);


I have the following integration:


Int(c-sqrt(a+b*(v*x+u)^2), x = -(b*u+sqrt(b*c^2-a*b))/(b*v) .. (-b*u+sqrt(b*c^2-a*b))/(b*v));

This integration is equivalent to the following integration (between dashed lines):


NumericEventHandler(invalid_operation = `Heaviside/EventHandler`(value_at_zero = 1)):


Heaviside(x) = convert(Heaviside(x), piecewise)

Int(Heaviside(x+(b*u+sqrt(b*c^2-a*b))/(b*v))*(c-sqrt(a+b*(v*x+u)^2)), x = -infinity .. (-b*u+sqrt(b*c^2-a*b))/(b*v));


In this form the function, which is to be integrated, is taken as equal to zero for x < -(b*u+sqrt(b*c^2-a*b))/(b*v).

Now I want to write a form such that the function is also taken as equal to zero for x > (-b*u+sqrt(b*c^2-a*b))/(b*v).

How should I do this? Can this also be done with Heaviside?

Hello people in mapleprimes,


I cannot obtain a proper result from the following code.

a:=int(((beta/beta[1,2])^(-theta/(1-theta))-kappa[1]^(-theta/(1-theta)))*m*beta^(m-1),beta=0 .. kappa[1]*beta[1,2]);


Please tell me if you know how to have maple calculate it.


Thanks in advance.



Doing the following:

Why is int used when defining F not evaluated to x^2/2 when used to defined function F as shown in (2), when the int is evaluated when used separately in (3)?

Dear all

I need a help to compute the integral from -1 to 1 of product of derivative of legendre polynomial

> restart;
> with(orthopoly);

P(n, x); # Designe the legendre polynomial of degree n
I would like to compute

int(diff(P(n,x),x)*diff(P(m,x),x),x=-1..1) ;


In this previous formula when I put n=2 and m=3 I can get the result but in general  case i cannot,

Many thanks



I have written a code which generates a Gaussian like curve as a set of points and have written some basic commands to find several important quantities from the plot. The three of importance here are the peak position, peak height and Full Width at Half Maximum.

See the attached minimal working example maple worksheet.

It can find the peak position and the peak height no problem, but another quantity I want it to find is the Full Width at Half Maximum (FWHM). I use the aforementioned calculated values to find the left and right components of the FWHM but the fsolve command just hangs.

In the worksheet this is not evident but in the much longer full code which I run through the terminal and prints the values to a file, it begins the fsolve command and reaches a particular value and it just hangs. No amount of waiting time makes it continue the calculation.

However if I use an approximate integration scheme (such as Riemann sums) then the fsolve part executed perfectly. fslove seems to get stuck during the numerical integration step.

There is probably an easy answer to this problem which I am missing. Any help is appreciated.


- Yeti

Hi all,

I'm trying to perform some calculations containing exponential integrals. Here is a snippet of my code:



Es := 4*10^9:


C := (q) -> q^(H+1.5):

G := (q) -> (int(q^3*C(q), q = q[0] .. q)):
P := (q) -> 1/sqrt(G(q)):

p := (xi) -> p[0]/P(xi*q[0]):
w:= (q,xi) -> 1/(Pi*(int(C(qs)*qs^3, qs = xi*q[0] .. q)))^(1/2):

U := (xi) -> (int(q*C(q)*w(q,xi)*(Int(exp(-(w(q, xi)*ps/Es)^2)/ps,ps=p(xi)..infinity)),q=xi*q[0]..q[s])):

My objective is to evaluate U for a set of discrete values of xi for further processing e.g. visualisation via plots. Neither value(U(xi)) nor evalf(U(xi)) produces a numerical result so I keep searching for solution. Does anybody have an advice how to solve U?

Regards, lassa

Leading on from this post I made before:

I have a script that can now integrate larger sums thanks to the tips I was given. I now have a question regarding cpu usage when the calculation is run through a loop. I have attached two files. One contains the sum (large_sum.txt) which is then read in to the main Maple script (

When the loop is run, the first few points are calculated quite consistently with very similar cpu times. However, as the calculation progresses the cpu time suddenly increases (with larger sums than the one given it is a very severe increase) it then decreases again and returns to the time it took for the initial points to be calculated.

Is there a reason there is a sticking point in this calculation? is there a more efficient way to simplify it before it reaches the integration stage? When using simplify(...,size) the initial block takes a very long time to execute hence is not included here. This is not the largest sum that needs to be processed so I am looking for means to speed up calculation time/make it more consistent.

Any help is appreciated



A calculation I am currently doing has gotten to the stage where the time taken to integrate is just too much.
I have attached a minimal working example Maple script showing an example of the integration which is very messy. When this is run it takes ~ 10 seconds on my machine which is no issue. However the polynomial sum in this example is only a small version, and it can get, much, much larger. To the point it takes over a day to calculate (but it does evaluate).

The reason for this is that the boole integration method does not scale well with more terms in the sum. It beats the other methods for small sums (like in the example) but when the sum gets larger is not that good. The Riemann method appears to be the best for larger sums, but once again is still slow.

Is there any way to speed this up? As the Boole method is fast for this example and gives a good answer, I was thinking to break the much larger sums into smaller seperate sums and then process them all seperately with the Boole method and add up all the results?


Any feedback would be appreciated :)

The attached worksheet shows a small selection of new and improved results in integration for Maple 2016. Note that integration is a vast topic, so there will always be more improvements that can be made, but be sure that we are working on them.

A selection of new and improved integration results for Maple 2016

New answers in Maple 2016



Indefinite integrals:


int(sqrt(1+sqrt(z-1)), z);



int(arctan((-1+sec(x))^(1/2))*sin(x), x);



int(((1+exp(I*x))^2+(1+exp(-I*x))^2)/(1-2*c*cos(x)+c^2), x);







Definite integrals:

int(arcsin(sin(z)), z=0..1);



int(sqrt(1 - sqrt(1+z)), z=0..1);



int(z/(exp(2*z)+4*exp(z)+10),z = 0 .. infinity);



simplify(int(sinh(a*abs(x-y)), y=0..c, 'method'='FTOC'));

(1/2)*(piecewise(x < 0, 0, 0 <= x, 2*exp(-a*x))+piecewise(x < 0, 0, 0 <= x, -4)+2*piecewise(c <= x, -cosh(a*(-x+c))/a, x < c, (cosh(a*(-x+c))-2)/a)*a-exp(-a*x)+piecewise(x < 0, 0, 0 <= x, 2*exp(a*x))+4-exp(a*x))/a


int(ln(x+y)/(x^2+y), [x=0..infinity, y=0..infinity]);



Definite integrals with assumptions on the parameters:

int(x^(-ln(x)),x=0..b) assuming b > 0;



int(exp(-z)*exp(-I*n*z)*cos(n*z),z = -infinity .. infinity) assuming n::integer;



Integral of symbolic integer powers of sin(x) or cos(x):

int(sin(x)^n,x) assuming n::integer;

` piecewise`(0 < n, -(Sum((Product(1+1/(n-2*j), j = 1 .. i))*sin(x)^(n-2*i-1), i = 0 .. ceil((1/2)*n)-1))*cos(x)/n+(Product(1-1/(n-2*j), j = 0 .. ceil((1/2)*n)-1))*x, n < 0, (Sum((Product(1-1/(n+2*j+1), j = 0 .. i))*sin(x)^(n+2*i+1), i = 0 .. -ceil((1/2)*n)-1))*cos(x)/n+(Product(1+1/(n+2*j-1), j = 1 .. -ceil((1/2)*n)))*ln(csc(x)-cot(x)), x)


int(cos(x)^n,x) assuming n::negint;

-(Sum((Product(1-1/(n+2*j+1), j = 0 .. i))*cos(x)^(n+2*i+1), i = 0 .. -ceil((1/2)*n)-1))*sin(x)/n+(Product(1+1/(n+2*j-1), j = 1 .. -ceil((1/2)*n)))*ln(sec(x)+tan(x))


int(cos(x)^n,x) assuming n::posint;

(Sum((Product(1+1/(n-2*j), j = 1 .. i))*cos(x)^(n-2*i-1), i = 0 .. ceil((1/2)*n)-1))*sin(x)/n+(Product(1-1/(n-2*j), j = 0 .. ceil((1/2)*n)-1))*x


Improved answers in Maple 2016


int(sqrt(1+sqrt(x)), x);



int(sqrt(1+sqrt(1+z)), z= 0..1);



int(signum(z^k)*exp(-z^2), z=-infinity..infinity) assuming k::real;



int(2*abs(sin(x*p)*sin(x)), x = 0 .. Pi) assuming p> 1;



int(1/(x^4-x+1), x = 0 .. infinity);

-(sum(ln(-_R)/(4*_R^3-1), _R = RootOf(_Z^4-_Z+1)))


In Maple 2016, this multiple integral is computed over 3 times faster than it was in Maple 2015.

int(exp(abs(x1-x2))*exp(abs(x1-x3))*exp(abs(x3-x4))*exp(abs(x4-x2)), [x1=0..R, x2=0..R, x3=0..R, x4=0..R], AllSolutions) assuming R>0;



Austin Roche
Mathematical Software, Maplesoft

Hello Mapleprime

I have a complicated integration to solve that I can not find an analytical solution for or even a simplification. I thus defaulted to using a Riemann sum to evaluate it which works well but is slow. I have had great speed increase using quadrature methods before so thought to try this.

The general form of the integration is as follows:


The integration domains are coupled which is causing the issue. a is independent but then b depends on a. The quadrature methods require the end points of integration to evaluate to a floating point number which the second integration cannot do. Is there any way to bypass this issue and use Quadrature methods?


Thank you in advance

Good Morning,

This is the script that I have used to to an integration, as the command ''int'' didn't work because the coputation was really heavy.

p_old := 0;

g := 0; #index

E_tot_net_Point := 0;

for g to 2 do

 h := g+1;

 loopstart := SP_time[g];

 loopend := SP_time[h];

  for tt from loopstart by 0.01 to loopend do

   t := tt;

   P_tot_net_Fkt := t -> C_motore[g]*omega_motore[g]

if t≠SP_time[g] and t ≠ SP_time[h] then

 P_tot_net_Point := P_tot_net_Fkt(t);

 P_tot_net_Point_next := P_tot_net_Fkt(t+0.001);

 plt_P_tot_net_plt[t] := pointplot([t, P_tot_net_Point]);

 E_tot_net_Point := E_tot_net_Point+(P_tot_net_Point*0.01);

 plt_E_tot_net_plt[t] := pointplot([t, E_tot_net_Point]);

 p_old := P_tot_net_Point;

end if;      

  end do:

end do:

plots:-display(entries(plt_E_tot_net_plt, 'nolist'), title = "Energy", color = "Red", symbol = point, symbolsize = 20, gridlines = true, size = [1000, 500], labels = ['[s]', '[Watt*s]'], font = [axes, 12])

I have plotted the function as a series of points over the orizontal axis (t).


Now I would like to calculate the last value of the curve (which is itself a point) as a function of the orizontal axes t. How can I do it?

Something like E_tot_net_Point = f(t)


Thank you for the help

Hello everyone !

I have a problem when I want to calculate the following multiple integration numerically:


It doesn't work. But when I replace sum(x[i],i=1..6)^2 with sum(x[i],i=1..6), it works. Is there any feasible solution to my problem ?

Thank you for reading !


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