In R, how would I go about finding the (first) root, x for an equation such as this:
Unfortunately, R code such as this doesn't work since there's no symbolic structure in R
g <- function(t) integrate(sin(t)/t,lower=0,upper=x)
root <- uniroot(g,(c(0,1)))$root
In general I want the integrand to be any arbitrary function, which after integration may or may not have analytical close form solutions. Also, the left-hand-side could be any arbitrary constant.
Well, your syntax for such a problem is a bit off. Something like
is a bit closer. R's not good about evaluating the equation at 0 in this case. You can move away from 0. Plus, accoring to Wolfram Alpha the "root" there appears at 1.06 which is outside your search range. This should give the right answer