79400806

Date: 2025-01-30 18:02:37
Score: 0.5
Natty:
Report link

The Newton method is a numerical method, but your f(x) and g(x) as they are remain symbolic. You need to evaluate them. With the following changes, the code ran in my computer. But since I don't see and expected output I cannot attest it runs as you expected.

# Compute the determinant of the matrix A
    det1 = A.det()
    ddet=diff(det1,x)
    
    # Defining Function
    def f(xvalue):
        return  det1.subs({x  : xvalue})

    # Defining derivative of function
    def g(xvalue):
        return ddet.subs({x : xvalue})
Reasons:
  • Blacklisted phrase (0.5): I cannot
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: J Suay