title: Fortan code for Monte Carlo Integration within boundary point a and b
body: <p>I understand Monte carlo simulation is for estimating area by plotting random points and calculating the ration between the points outside the curve and inside the curve.</p>
  
  <p>I have well calculated the value of pi assuming radius of curve to be unity.</p>
  
  <p>Here is the code</p>
  
  <pre><code>program pi
  implicit none
  
  integer :: count, n, i
  real :: r, x, y
  count = 0
  n=500
  CALL RANDOM_SEED
  DO i = 1, n
   CALL RANDOM_NUMBER(x)
   CALL RANDOM_NUMBER(y)
   IF (x*x + y*Y &lt;1.0) count = count + 1
  END DO
  r = 4 * REAL(count)/n
  print *, r
  end program pi
  </code></pre>
  
  <p>But to find integration , Textbook says to apply same idea. But I'm lost on How to write a code if I want to find the integration of </p>
  
  <pre><code>f(x)=sqrt(1+x**2) over a = 1 and b = 5
  </code></pre>
  
  <p>Before when radius was one, I did assume point falling inside by condition x*2+y**2 but How can I solve above one?<a href="https://i.stack.imgur.com/jUkZA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jUkZA.png" alt="enter image description here"></a></p>
  
  <p>Any help is extremely helpful</p>