Skip to content
Back to formatted view

Raw Message

Message-ID: <loom.20050115T080452-787@post.gmane.org>
Date: 2005-01-15T07:16:49Z
From: Gabor Grothendieck
Subject: UNIROOT

aar paar <aar420 <at> hotmail.com> writes:

: 
: f(x) = .01*(1.2^y) integrated from 0 to x
: 
: Find x such that
: 
: f(x) = some number, say 4
: 
: How do we do it in R?

You don't need R for this.

Your integral can be solved analytically, check any 
table of integrals, and the rest can be solved using
elementary algebra so R is not needed here.  If you 
really do want to use R anyways:

g <- function(y) .01 * 1.2^y
f <- function(x) integrate(g, 0, x)$value - 4
uniroot(f, low = -100, up = 100)