```Date: Feb 13, 2013 4:11 AM
Author: Christopher Creutzig
Subject: Re: how to solve tan(x)=3x/(3+x^2)

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 findingall of them.Your input is sufficiently tame that finding (approximations) to allzeroes in some range is a reasonable expectation, though. I don't thinkthere is a nice calling syntax in the symbolic toolbox yet, but you cancall MuPAD commands directly using feval, so you can for example usenumeric::realroots, which returns ranges such that any zero of yourfunction is in one of those:>> eq = tan(x)==3*x/(3+x^2)eq =tan(x) == (3*x)/(x^2 + 3)>> s = feval(symengine, 'numeric::realroots', ...             eq, 'x=0..10', 1e-4)s =[ [0.0, 0.0485992431640625], [3.726348876953125, 3.7264251708984375],[6.681365966796875, 6.6814422607421875], [9.7154998779296875,9.715576171875]]>> vpasolve(eq, x, s(1))ans =0>> vpasolve(eq, x, s(2))ans =3.7263846964537519995745420194228>> vpasolve(eq, x, s(3))ans =6.6814348529499497169811754681414>> vpasolve(eq, x, s(4))ans =9.7155660951117226365449206516755HTH,	Christopher
```