## Fortran ~ Newton Raphson Method

- Let Xo be an approximate value of the root of the equation f(X)=0 either algebraic or transcendental and let h be a real number sufficiently small.
- F(X)=2*X**3-5.0*X-2.15
- This is known as the Newton – Raphson formula or Newton’s iteration formula.

**Write a program to demonstrate the application of the Newton-Raphson method to find the root of the equation.?**

```
PROGRAM RAPHSON
C
C PROGRAM TO LOCATE THE ROOT OF AN EQUATION USING NEWTON RAPHSON METHOD
C
C GIVEN EQUATION
F(X)=2*X**3-5.0*X-2.15
C DERIVATIVE OF THE GIVEN EQUATION
FD(X)=6.0*X**2-5.0
C
WRITE(*,*)' ENTER YOUR ESTIMATE OF ROOT...'
READ(*,*)X
I=0
300 I=I+1
C FIND ROOT POSITION
X=X-F(X)/FD(X)
CHK=ABS(F(X))
C EXIT LOOP IF ROOT FOUND
IF(CHK.LE.0.0001)GOTO 100
C EXIT LOOP IF UNABLE TO FIND ROOT EVEN AFTER 100+CYCLES
IF(I.GT.100)GOTO 200
C START NEXT CYCLE
GOTO 300
100 WRITE(*,*)'ROOT FOUND AT', X
STOP
200 WRITE(*,*)'ROOT NOT FOUND'
STOP
END
#OUTPUT
ENTER YOUR ESTIMATE OF THE ROOT
1
ROOT FOUND AT 1.3247180
```