Path: news.mathworks.com!not-for-mail
From: "Steven Lord" <slord@mathworks.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: integrating the symbolic normcdf
Date: Sun, 27 Jun 2010 22:39:53 -0400
Organization: The MathWorks, Inc.
Lines: 39
Message-ID: <i0921l$9v1$1@fred.mathworks.com>
References: <i03aa5$t52$1@fred.mathworks.com>
Reply-To: "Steven Lord" <slord@mathworks.com>
NNTP-Posting-Host: lords.dhcp.mathworks.com
X-Trace: fred.mathworks.com 1277692789 10209 172.31.44.118 (28 Jun 2010 02:39:49 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 28 Jun 2010 02:39:49 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
X-RFC2646: Format=Flowed; Response
Xref: news.mathworks.com comp.soft-sys.matlab:648527


"Angie" <angie11tr@yahoo.com> wrote in message 
news:i03aa5$t52$1@fred.mathworks.com...
> Hi,
>
> Is there a way to solve the following definite integral? My integrand is 
> symbolic:
>
> myintegrand = @(x) x*normcdf(x,1,0);
> int(myintegrand,x,0,1)
>
> Matlab says:
> Warning: Explicit integral could not be found.  ans =
> int(x*normcdf(x, 1, 0), x = 0..1)
>
> Basically, it does not give me an answer. I also tried "erfc" with no 
> luck.

NORMCDF is a function from Statistics Toolbox that's defined for _numeric_ 
inputs, not symbolic.

Using the expression from the documentation for NORMCDF, you can find the 
value of your integral:

syms x t
integralBody = exp(-t^2/2);
symbolicNormcdf = (1/sqrt(2*sym(pi)))*int(integralBody, -Inf, x);
myintegrand = int(x*symbolicNormcdf, 0, 1)

VPA this expression to obtain a numeric representation of the result.

-- 
Steve Lord
slord@mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
To contact Technical Support use the Contact Us link on 
http://www.mathworks.com