I guess what you have is g <- function(x){ 2*x-3 } s <- function(x){ 5*x^2+2 }
and what you want is f<-function(x){ g(x)*s(x) } integrate(f,a,b) Try that and see if it works. If not (that is, if your actual g and s are not as in the example), maybe you'll have to do this: integrate(Vectorize(f),a,b) On Thu, Dec 16, 2010 at 10:27 AM, Alaios <ala...@yahoo.com> wrote: > Hello I have two function in R > like > g(x)=2x-3 > and s(x)=5x^2+2 > > and I want to find the integrafl of the g(x)*s(x) inside the interval of > [a,b] > > Could you please help me find the proper function? > > I would like to thank you in advance for your help > > Regards > Alex > > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.