If you plan to approximate using Newton-Raphson (NR) method then you also need to choose an appropriate equation, for which NR can give a convergent solution (as mention by @Holo). Please see "Numerical Methods for Engineers" by Chapra and Canale, 6th Edition, Page-153. It has nice illustrations to when NR method may fail.
I tried following three in Matlab:
1. $f(x) = x - \tan(x) = 0$. The solution near $x=3$ is $x = \pi$.
With $x_0 \in (0,3]$ NR method diverged for any choice of starting point in the interval.
2. $f(x) = \sin(x) - \cos(2 x) = 0$. The solution near $x=3$ is $x = \pi$.
With $x_0 \in [0,3]$ NR method goes up to $x=3.1453$ then script stops running before achieving desired accuracy.
3. $f(x) = \tan(x/4) - 1$ The solution near $x=3$ is $x = \pi$.
With $x_0 \in [0,3]$ NR method converges for all starting points in the interval and gives $x=3.1415926536 \simeq \pi$ (The tolerance is set to $10^{-20}$ and variables are defined as "double").
Hope this helps.