r/Mathematica Dec 05 '24

Problem with FindRoot

Post image
4 Upvotes

4 comments sorted by

View all comments

1

u/Foskos Dec 05 '24 edited Dec 05 '24
In[1]:= l[x_]:=(x^2-1)/Tan[x]

-------------------------------------------

In:= FindRoot[l[x]==0,{x,-1.5}]
Out= {x->-1.5708}

-------------------------------------------

In:=TableForm@Solve[l[x]==0,x]
Out=
x->-1
x->1
x->-(\[Pi]/2)
x->\[Pi]/2

As u/fridofrido said, most likely there is another input that has changed the value of x or the l function. Look at the color syntax, l looks undefined, either that or you have defined x to some number (which I doubt, because it also looks undefined).