Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Please help Explicit integral could not be found

Subject: Please help Explicit integral could not be found

From: rakib hasan

Date: 20 Nov, 2010 03:46:05

Message: 1 of 8

I was trying to do following integration and result would be function z. But every time I ran it says
Warning: Explicit integral could not be found.
> In sym.int at 58

syms z x
fxy=exp((-x^3+2*x-z)/x)/x;
y=int(fxy,x,0,5);

Please anybody help me. Is there anyway integrate it numerically by keeping z as a symbol ? thanks in advance.

Subject: Please help Explicit integral could not be found

From: Greg Heath

Date: 20 Nov, 2010 08:27:56

Message: 2 of 8

On Nov 19, 10:46 pm, "rakib hasan" <upo...@gmail.com> wrote:
> I was trying to do following integration and result would be function z. But every time I ran it says
> Warning: Explicit integral could not be found.
>
> > In sym.int at 58
>
> syms z x
> fxy=exp((-x^3+2*x-z)/x)/x;
> y=int(fxy,x,0,5);
>
> Please anybody help me. Is there anyway integrate it numerically by keeping z as a symbol ? thanks in advance.

The integral doesn't exist because of the singularity at x = 0.

Hope this helps.

Greg

Subject: Please help Explicit integral could not be found

From: Roger Stafford

Date: 20 Nov, 2010 21:02:04

Message: 3 of 8

Greg Heath <heath@alumni.brown.edu> wrote in message <f3df0346-e04b-43e6-bc45-6176288a4775@s4g2000yql.googlegroups.com>...
> On Nov 19, 10:46 pm, "rakib hasan" <upo...@gmail.com> wrote:
> > .......
> > fxy=exp((-x^3+2*x-z)/x)/x;
> > y=int(fxy,x,0,5);
> > .......
> The integral doesn't exist because of the singularity at x = 0.
> .......
- - - - - - - - - - - -
  That depends on the value of z. If z has a positive real part, the function is always integrable over the interval [0,5]. Considered as a function of z, I believe this integral has an essential singularity at z = 0.

Roger Stafford

Subject: Please help Explicit integral could not be found

From: rakib hasan

Date: 21 Nov, 2010 00:05:05

Message: 4 of 8

"Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid> wrote in message <ic9d0c$44r$1@fred.mathworks.com>...
> Greg Heath <heath@alumni.brown.edu> wrote in message <f3df0346-e04b-43e6-bc45-6176288a4775@s4g2000yql.googlegroups.com>...
> > On Nov 19, 10:46 pm, "rakib hasan" <upo...@gmail.com> wrote:
> > > .......
> > > fxy=exp((-x^3+2*x-z)/x)/x;
> > > y=int(fxy,x,0,5);
> > > .......
> > The integral doesn't exist because of the singularity at x = 0.
> > .......
> - - - - - - - - - - - -
> That depends on the value of z. If z has a positive real part, the function is always integrable over the interval [0,5]. Considered as a function of z, I believe this integral has an essential singularity at z = 0.
>
> Roger Stafford


The value of Z and x is positive and complex. But how could get a solid expression in terms of Z ? Is this impossible to do matlab ?

Subject: Please help Explicit integral could not be found

From: rakib hasan

Date: 21 Nov, 2010 00:08:03

Message: 5 of 8

"Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid> wrote in message <ic9d0c$44r$1@fred.mathworks.com>...
> Greg Heath <heath@alumni.brown.edu> wrote in message <f3df0346-e04b-43e6-bc45-6176288a4775@s4g2000yql.googlegroups.com>...
> > On Nov 19, 10:46 pm, "rakib hasan" <upo...@gmail.com> wrote:
> > > .......
> > > fxy=exp((-x^3+2*x-z)/x)/x;
> > > y=int(fxy,x,0,5);
> > > .......
> > The integral doesn't exist because of the singularity at x = 0.
> > .......
> - - - - - - - - - - - -
> That depends on the value of z. If z has a positive real part, the function is always integrable over the interval [0,5]. Considered as a function of z, I believe this integral has an essential singularity at z = 0.
>
> Roger Stafford


How could I avoid the warning ? thanks.

Subject: Please help Explicit integral could not be found

From: Roger Stafford

Date: 21 Nov, 2010 03:40:05

Message: 6 of 8

"rakib hasan" <upol94@gmail.com> wrote in message <ic9nnh$muj$1@fred.mathworks.com>...
> .......
> The value of Z and x is positive and complex. But how could get a solid expression in terms of Z ? Is this impossible to do matlab ?
- - - - - - - - - -
  The warning that "Explicit integral could not be found" means that you cannot use the symbolic toolbox to evaluate this integral, so it must be done numerically, using one of the quadrature routines, 'quad', etc. You will have to write a function that uses z as input and finds this integral numerically, and z must have a positive real part to evaluate it this way.

  Your integrand, fxy, becomes indeterminate at x = 0. As x approaches zero fxy must also approach zero, provided the real part of z is positive, as can be proven using L'hospital's rule. That means that if you define fxy as being zero at x = 0 for such a z, it will constitute a continuous function and consequently be integrable. However to avoid sending NaNs back to the quadrature routine, it will be necessary to define fxy as a function that is equal to exp((-x^3+2*x-z)/x)/x for x>=e for some suitably small positive quantity e, and equal to the appropriate finite Taylor series for x<e. If you choose e sufficiently small, you would perhaps need only one or two terms of the series for sufficient accuracy.

  You can show by differentiation of the integrand that this integral has a well-defined derivative with respect to z if z has a positive real part, and it therefore constitutes an analytic function of z at least in the right half complex plane. I am fairly sure moreover that it can be analytically continued into the left half plane as long as you avoid the essential singularity at z = 0. However at the moment I have no idea of how it could be computed in this left half in a practical manner. Certainly for this purpose you cannot use the integral you have defined, since it is not integrable in that left half. So we'll assume you are content to be restricted to the right half where you can directly compute the integral.

Roger Stafford

Subject: Please help Explicit integral could not be found

From: Roger Stafford

Date: 21 Nov, 2010 17:45:04

Message: 7 of 8

"Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid> wrote in message <ica4al$a91$1@fred.mathworks.com>...
> ...... However to avoid sending NaNs back to the quadrature routine, it will be necessary to define fxy as a function that is equal to exp((-x^3+2*x-z)/x)/x for x>=e for some suitably small positive quantity e, and equal to the appropriate finite Taylor series for x<e. If you choose e sufficiently small, you would perhaps need only one or two terms of the series for sufficient accuracy.
> .......
- - - - - - - - - -
  I need to correct one of the assertions I made yesterday. I advised using a Taylor series expansion in powers of x for your fxy function to approximate its integral from zero to a small positive number e. Unfortunately fxy and all its derivatives with respect to x approach zero as x approaches zero, and therefore it cannot be expanded in a Taylor series in powers of x. It has an essential singularity there.

  My advice instead would be to make a change of variable y = x/z so that you are integrating 1/y*exp(-z^2*y^2+2-1/y) w.r. to y from y = 0 to y = 5/z. This way it will be easier to select the appropriate e so that the integral from e to 5/z rather than 0 to 5/z will be sufficiently accurate, and still avoid NaNs in the quadrature routines. A value of e = .03 or thereabouts ought to be adequate.

Roger Stafford

Subject: Please help Explicit integral could not be found

From: rakib hasan

Date: 21 Nov, 2010 20:53:04

Message: 8 of 8

"Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid> wrote in message <icblr0$57q$1@fred.mathworks.com>...
> "Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid> wrote in message <ica4al$a91$1@fred.mathworks.com>...
> > ...... However to avoid sending NaNs back to the quadrature routine, it will be necessary to define fxy as a function that is equal to exp((-x^3+2*x-z)/x)/x for x>=e for some suitably small positive quantity e, and equal to the appropriate finite Taylor series for x<e. If you choose e sufficiently small, you would perhaps need only one or two terms of the series for sufficient accuracy.
> > .......
> - - - - - - - - - -
> I need to correct one of the assertions I made yesterday. I advised using a Taylor series expansion in powers of x for your fxy function to approximate its integral from zero to a small positive number e. Unfortunately fxy and all its derivatives with respect to x approach zero as x approaches zero, and therefore it cannot be expanded in a Taylor series in powers of x. It has an essential singularity there.
>
> My advice instead would be to make a change of variable y = x/z so that you are integrating 1/y*exp(-z^2*y^2+2-1/y) w.r. to y from y = 0 to y = 5/z. This way it will be easier to select the appropriate e so that the integral from e to 5/z rather than 0 to 5/z will be sufficiently accurate, and still avoid NaNs in the quadrature routines. A value of e = .03 or thereabouts ought to be adequate.
>
> Roger Stafford
First of all, many many thanks for your comments. This is an expression of joint pdf. My final goal was to find a value x such that integration of fxy w.r.t z , limit from .001 to x is equal to 1.00. I guess I have to writemy code in a different way to perform integration numerically. thanks again for your time.

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us