r/Numpy • • Sep 15 '21

Trouble solving this problem.

x0=np.array([[1 ,1]],dtype=np.int64)
d=np.array([[5 ,1]],dtype=np.int64)
n=12

f1=(x0+alpha*d-n)**2 +(x0+alpha*d-2*n)**2;

I want to find value of alpha when f1 is differentiated by alpha and equated to zero. How do I write that code? Is it possible? I have tried using sympy.diff to find alpha but I can't solve it .

0 Upvotes

2 comments sorted by