Re: [R] Simplifying an expression with an integral

2013-12-24 Thread David Winsemius
On Dec 24, 2013, at 9:39 AM, Aurélien Philippot wrote: > Dear R experts, > I am computing the following integral. > > [image: \int_{1,100} \frac{1}{x+Max(x-50,0)} g(x)dx], where g is the > density of the standard normal, and [1,100] is the domain. > > 1) I use the following code which works fin

[R] Simplifying an expression with an integral

2013-12-24 Thread Aurélien Philippot
Dear R experts, I am computing the following integral. [image: \int_{1,100} \frac{1}{x+Max(x-50,0)} g(x)dx], where g is the density of the standard normal, and [1,100] is the domain. 1) I use the following code which works fine: integrand1<- function(x){1/x*dnorm(x)} integrand2<- function(x){1/(2