"Paul " <unicybsatr@gmail.com> wrote in message <i4e2ns$pak$1@fred.mathworks.com>...
> Hello.
> I have two integrals (S is integral):
> I(t)=S(f(x,t))dx
> B(t)=S(g(x,t))dx
>
> function dblquad is used to find integral SS(f(x,t)*g(x,t))dxdt
> But is there exist some way to find the following integral:
>
> S(I(t)*B(t))dt
>
> May be some numerical methods.
> Please help, I just don't know how to do it.
> Thanks in advance.
        
The easy way to do it is to consider it a triple integration problem. Matlab's 'triplequad' could handle it provided a threedimensional rectangular volume is involved. The integrand would simply be f(x,t)*g(y,t), integrated with respect to x, y, and t. The x and y would range over the values you use for defining I(t) and B(t) and the t would range over the values you have for the final integral.
On the other hand you could conceivably treat it as a double integration problem by defining the functions I(t) and B(t) in terms of results obtained from separate uses of one of the quadrature functions. Then you could prepare another function that would multiply these two values together to be used as an integrand in a second quadrature. The difficulty there would be that with matlab's quadrature routines this second quadrature function will be passing vectors, not scalars, to its integrand function. Since your integrand function has to do two integrations for each value in such a vector, you would have to provide your integrand function with this capability  meaning that there has to be a testing of the length of the vector passed to it and a forloop with the corresponding count used to obtain the multiple integrand values.
You can count on the latter being a slow process. However triple integration is not fast either and it might possibly be much slower than doing the more cumbersome double integration.
Roger Stafford
