Numerical Methods for Algebraic Equations - Non root finding I'm researching a topic for solving general algebraic equations using numerical method. My numerical recipe knowledge is rather rusty with the Bisection to Newton's methods but I don't think those could be applied for equations such as:
$$
\frac{x^2}{2+x}+\cos(x+1)=x^2\times \sin\left(\frac{\sqrt x}{x^2}\right)
$$
with an approximated numerical solutions:
$$
x_1\approx0.531709
$$
and
$$
x_2\approx3.401750
$$
I know matlab has the vpasolve function for numerical approximation of the unknown variable but I can't find any details regarding the used method or even if such a numerical method exist that can be used to approximate the unknown variable for any given equation with one unknown var. At first I tried applying Newton Raphson's method but stuck right at the beginning since:


*

*I'm not searching for a solution in the form of $f(x)=0$.

*I don't know the derivative for the equation and I don't want to apply symbolic algorithms.


Thank you for the tips!
Cheers!
 A: Contrary to common opinion, there is no established numerical method to find the roots of closed-form functions.
There are indeed several excellent methods for root refinement, among which the secant/regula falsi (without derivatives) and Newton (with derivatives), that converge super-linearly.
Anyway we are pretty deprived as regards root isolation (finding intervals where a single root is guaranteed) and even more root exhaustion (finding all the roots).
For example, it would be hard to determine the number of roots of the equation below, though this number is finite:
$$
\frac{x^2}{2+x}+\cos(x+1)=x^2\sin\left(\frac{\sqrt x}{x^2}\right)+\cos(1)-0.83x.
$$
About all you can do is sampling the function densely enough, but there is no guarantee of success. You can't really spare an analytical insight into the function.


Update:
I found this reference which describes an interesting approach to automatic root isolation: 
Root isolation using function values, Bush Jones, W. G. Waller & Arnold Feldman, BIT Numerical Mathematics, September 1978, Volume 18, Issue 3, pp 311-319.
It is base on a statistical estimation of the probability to have a zero in an interval.
A: As already said in answers and comments, consider that you look for the zero's of the function $$f(x)=\frac{x^2}{2+x}+\cos(x+1)-x^2\times \sin\left(\frac{\sqrt x}{x^2}\right)$$ and apply Newton method which, starting from a "reasonable" guess $x_0$, will update it according to $$x_{n+1}=x_n-\frac{f(x_n)}{f'(x_n)}$$ For the function, let me be very lazy and choose $x_0=5$; the successive iterates will then be $$x_1=2.63695$$ $$x_2=3.65956$$ $$x_3=3.40642$$ $$x_4=3.40175$$ which is the solution for six significant figures.
For sure, you need the derivative of the function. But, may be, you do not want to establish its analytical expression. Then, just compute it using finite differences such as $$f'(x_n)=\frac{f(x_n+\epsilon)-f(x_n)} \epsilon$$ or, better $$f'(x_n)=\frac{f(x_n+\epsilon)-f(x_n-\epsilon)} {2\epsilon}$$ using, for example, $\epsilon=\frac{x_n}{1000}$. This will work fine.
A: Set $f(x) = \frac{x^2}{2+x}+\cos(x+1)-x^2\sin\left(\frac{\sqrt x}{x^2}\right)$, now you are looking for $f(x) = 0$ and you can apply something like the bisection method if you do not know the derivative of the function.
