how to code PDF ? or for that matter Integration in general.

I need to use the Probability Function on a set of values. I am okay with understanding the math, but i don't quite know how to convert that stuff to code.

basically i need the integral of f(x) from a to b where f(x) is the curve of the random function. So how do i calculate it ? I mean if f(x) was (x+5x) and a=5 b=46, how would you calculate the integral ?

I thought people on this site might have done these things before, so i asked this question here.

-
Is $x+5x$ different from $6x$, please fix the typo, may be one of them has an exponent! –  user21436 Jan 13 '12 at 9:35
You can do an Ito integral. By using your pdf you will have to compute $\lim_{n\rightarrow\infty}\langle\left[\sum_{i=0}^{n-1}f(\xi_i)\right]^2\rangle$‌​. –  Jon Jan 13 '12 at 9:50
@KannappanSampath is meant x squared plus five x but its just an example anyway .. –  Wildling Jan 13 '12 at 10:28