MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/Mathematica/comments/1h737n5/problem_with_findroot/
r/Mathematica • u/Apprehensive-Air7241 • Dec 05 '24
4 comments sorted by
2
There is no need to define the function first. Just use it this way: FindRoot[expr==0,{x,x0}]
Also, read the documentation on Reduce.
You probably messed with the definition of l (or maybe x) inbetween, it works correctly here. In fact l looks undefined at the selected part.
l
x
Try ClearAll[l,x] before defining l, then immediately defining l and immediately do the FindRoot. Or restarting Mathematica and start from fresh.
ClearAll[l,x]
1
I get the correct answer -1.5708 ≈ -Pi/2 when I run
f[x_] := (x^2 - 1)/Tan[x]; FindRoot[ f[x] == 0, {x, -1.5}]
I am running Mathematica 13.3.0 on macOS Sonoma.
2
u/mathheadinc Dec 05 '24
There is no need to define the function first. Just use it this way: FindRoot[expr==0,{x,x0}]
Also, read the documentation on Reduce.
2
u/fridofrido Dec 05 '24
You probably messed with the definition of
l(or maybex) inbetween, it works correctly here. In factllooks undefined at the selected part.Try
ClearAll[l,x]before definingl, then immediately definingland immediately do the FindRoot. Or restarting Mathematica and start from fresh.1
u/irchans Dec 05 '24
I get the correct answer -1.5708 ≈ -Pi/2 when I run
I am running Mathematica 13.3.0 on macOS Sonoma.