Question: Complex roots of exp(x)+sin(x)-2

Using allvalues (twice) I can uncover the three roots of this expression: 1 real, 2 complex. But fsolve gives me just one real and 1 complex. Interestingly the free version of Woldframalpha.com gives the same single complex root.

Is there any way of coercing fsolve to give both?

Many thanks for any advice

Fsolve5.mw
 

 

Examples of the fsolve command: not all complex roots found

restart

expr := exp(x)+sin(x)-2

exp(x)+sin(x)-2

(1)

w := solve(expr)

RootOf(_Z-ln(-sin(_Z)+2))

(2)

w1 := evalf(allvalues(w))

.4486719164

(3)

w2 := allvalues(w)

RootOf(_Z-ln(-sin(_Z)+2), .4486719164), RootOf(_Z-ln(-sin(_Z)+2), 1.837819685+2.792964964*I), RootOf(_Z-ln(-sin(_Z)+2), -4.707337346-1.315656030*I)

(4)

q0 := evalf(w2[1])

.4486719164

(5)

q1 := evalf(w2[2])

1.837819685+2.792964964*I

(6)

q2 := evalf(w2[3])

-4.707337346-1.315656030*I

(7)

eval(expr, x = q0); eval(expr, x = q1); eval(expr, x = q2)

0.

 

0.1e-8+0.1e-8*I

 

0.-0.786e-9*I

(8)

r1 := fsolve(expr)

.4486719164

(9)

r2 := fsolve(expr, complex)

1.837819685+2.792964964*I

(10)

NULL

``


 

Download Fsolve5.mw

 

Please Wait...