I have a function defined f(x) = acos(x) in python, and want to solve for its zeroes given an initial value. However, fsolve seems to return a math domain error even when my initial guess is well within the domain of the cosine inverse function, or if I start with the actual root as the initial guess.
from math import *
from scipy.optimize import fsolve
def funct(x):
temp = acos(x)
return(temp)
print(fsolve(funct, 1))
How do I debug this?