Note that 0<t<1
So that
Let
Compare which had 1/(1+x)2
So that
Solve for r to find
So that
Dwight 856.31[i]
Using N points
IMPLICIT REAL*8(A-H,O-Z)
PARAMETER (N=5000)
COMMON/PASS/A,B
DATA PI/3.141592653589793D0/
C ***
MID-POINT
A=17
B=23
AINT=0
H=1D0/N
DO I=1,N
T=H*(I-.5D0)
R=TAN(PI*(T-.5D0))
F=(1+R**2)*FTEST(R)
AINT=AINT+F
ENDDO
AINT=AINT*H*PI
ANAL=PI/(A*B*(A+B))
PRINT*,' NUMERICAL FULL INTEGRAL ',AINT
PRINT*,' ANALYTIC FULL INTEGRAL ',ANAL
READ(*,'(A)')
END
FUNCTION FTEST(X)
IMPLICIT REAL*8(A-H,O-Z)
COMMON/PASS/A,B
FTEST=1/((A*A+X*X)*(B*B+X*X))
RETURN
END
FULL INTEGRAL 5000 pts 2.008690954980680D-004 mid point
2.008690954980690D-004 analytical
compare this accuracy
with #Semi_result
The difference is due
to the fact that the integrals at the end of the region are smooth. The function can be periodically continued. –
more on this later.
Figure 2 Full integration range.
Figure 3 Lower interval
Figure 4 Upper interval
Note that c. does not go to zero as t à 0 and 1. In addition its accuracy is somewhat limited owing to an infinite set of oscillations.
The function g(r)=1/(a2+r2) has an integral
So that
Solve for r(t) to find
So that