The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: how to solve tan(x)=3x/(3+x^2)
Replies: 1   Last Post: Feb 13, 2013 4:11 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View  
Christopher Creutzig

Posts: 323
Registered: 2/24/09
Re: how to solve tan(x)=3x/(3+x^2)
Posted: Feb 13, 2013 4:11 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

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)

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,

>> vpasolve(eq, x, s(1))

ans =


>> vpasolve(eq, x, s(2))

ans =


>> vpasolve(eq, x, s(3))

ans =


>> vpasolve(eq, x, s(4))

ans =



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.