From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: integration explicit solution could not be found
Date: Sat, 17 Jan 2009 17:45:04 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 20
Message-ID: <gkt5f0$6qf$>
References: <gkra97$24k$>
Reply-To: <HIDDEN>
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: 1232214304 6991 (17 Jan 2009 17:45:04 GMT)
NNTP-Posting-Date: Sat, 17 Jan 2009 17:45:04 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: comp.soft-sys.matlab:512233

"Dhritiman " <> wrote in message <gkra97$24k$>...
> i had an earlier post about this with a typo. My problem is that matlab cannot solve the following equation where some function of z multiplied by the pdf of gamma dist is integrated over the range [.3 .9]. I need the answer as a function of w(wage). Infact I did get a scalar answer after i used double(int(f,z,.3,.9)) but this is only working when i substitute w for a number. Is there a way out of this...i.e. I need the soultion as a function of w (to be used later inside a fzero)
> syms z w
> f=138.2528*84.626*z*((1-0.99*z)^1.32)*((1/w)^3.68)*((1/((2)*.06^3))*(z^(3-1))*(2.718^(-z/.06)))
> intfs=int(f,z,.3,.9)

  Dhritiman, I call to your attention again the fact that the factor involving w in your expression need not be included in the integrand here but can be factored outside.  What you have can be expressed as

 a/w^3.68 * int(z^3*(1-b*z)^c*exp(-z/d,z,e,f)

where a = 138.2528*84.626/(2*.06^3), b = 0.99, c = 1.32, d = .06, and where e and f are the lower and upper limits of integration.  The value of the integral part depends only on constants b, c, d and the limits of integration, not on a or w.  You can multiply these latter in after the integration is performed.

  As for the integral, the introduction of the power c = 1.32 apparently renders this integral incapable of an explicit solution, but this is a mathematical difficulty and not one that can be blamed on matlab.  Consequently it will be necessary for you to do numerical integration to evaluate it for each different set of constants b, c, d and limits of integration.

  About the only saving I can see in this will come from cases where the integration range is taken over various (e,f) intervals that overlap.  The overlap portions need be integrated only once (provided b, c, and d remain fixed.)

Roger Stafford