On 13.02.13 00:54, Jingxin wrote: > So I tried to use Solve function to solve this equation, tried root, findroot. By using FindRoot, I was able to get one solution which is closest to x0, but, what if I want all the answers from 0,10 or the first 10 term?
Just a disclaimer up front: Numerically (and without interval numerics), you can never know how many zeroes a transcendental (i.e., non-polynomial) equation has, so there is no way to guarantee finding all of them.
Your input is sufficiently tame that finding (approximations) to all zeroes in some range is a reasonable expectation, though. I don't think there is a nice calling syntax in the symbolic toolbox yet, but you can call MuPAD commands directly using feval, so you can for example use numeric::realroots, which returns ranges such that any zero of your function is in one of those:
>> eq = tan(x)==3*x/(3+x^2)
tan(x) == (3*x)/(x^2 + 3)
>> s = feval(symengine, 'numeric::realroots', ... eq, 'x=0..10', 1e-4)