"Dhritiman " <dhritimanbhattacharya@uiowa.edu> wrote in message <gkra97$24k$1@fred.mathworks.com>...
> 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*((10.99*z)^1.32)*((1/w)^3.68)*((1/((2)*.06^3))*(z^(31))*(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*(1b*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
