Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

All published worksheets from http://sagenb.org

Views: 168754
Image: ubuntu2004
from sympy import * from sympy.matrices import Matrix from numpy import * a,b,x=symbols("abx")
Mat_A=Matrix(( (a,b,0,0), (x,a,b,0), (x,-2*x,a,b), (-x**2,-x,x,a), )) Mat_A
[ a, b, 0, 0] [ x, a, b, 0] [ x, -2*x, a, b] [-x**2, -x, x, a]
h=symbols("h") eq_1=(Mat_A-eye(4)*h).det() y=symbols("y") eq_2=eq_1.subs(h,a+y) eq_2
-4*a**3*(a + y) + b**2*x**2 + b**3*x**2 + 6*a**2*(a + y)**2 - 4*a*(a + y)**3 + a**4 + (a + y)**4
eq_2.expand()
b**2*x**2 + b**3*x**2 + y**4
lambda=a+sqrt(abs(x)*abs(b)*sqrt(-1*(b+1))) lambda
Syntax Error: labda