So, this is your function right now (I hope you know how to write the R function, and if not, check the spelling of your own function )
f <- function (x) (pi / 2) * (1 / (1 + 0.25 * x ^ 2))
fis defined on (-Inf, Inf), therefore integration on this range gives an indefinite integral. Fortunately, it approaches Infwith speed x ^ (-2), so the integral is well defined and can be calculated:
C <- integrate(f, -Inf, Inf)
# 9.869604 with absolute error < 1e-09
C <- C$value ## extract integral value
# [1] 9.869604
Then you want to normalize f, since we know that probability density should integrate into 1:
f <- function (x) (pi / 2) * (1 / (1 + 0.25 * x ^ 2)) / C
You can draw its density:
curve(f, from = -10, to = 10)
