31 lines
636 B
Plaintext
31 lines
636 B
Plaintext
|
#solve equations
|
||
|
var('x','y','u')
|
||
|
A=x^6-9*x^5+10*x^4+18*x^3+49*x^2+135*x+84;A
|
||
|
solve([A==0],[x])
|
||
|
B=x^3-5*x^2+8*x-40;B
|
||
|
solve([B==0],[x])
|
||
|
C=cos(x);C
|
||
|
find_root(C==x,0,pi)
|
||
|
|
||
|
#Find
|
||
|
D=x/sin(x);D
|
||
|
integral(D,x)
|
||
|
E=e^(1/x^2);E
|
||
|
integral(E,(x,2,4))
|
||
|
F=sqrt((x^2)/sin(x+2));F
|
||
|
diff(F,x)
|
||
|
G=(x*e^(cos(x)))^3;G
|
||
|
diff(G,x)
|
||
|
H=x^2+sin(x*y)-y;H
|
||
|
diff(H,y)
|
||
|
|
||
|
#Solve equation \frac{d^2 u}{dx^2}-x\frac{du}{dx}+u=0
|
||
|
u=function('u')(x)
|
||
|
de=diff(u,x,2)-x*diff(u,x,1)+u==0
|
||
|
desolve(de,u,contrib_ode=True)
|
||
|
|
||
|
#Find product of matrices A and B
|
||
|
I=matrix([[1,-4,7],[14,6,8],[-4,-1,2]]);I
|
||
|
J=matrix([[2,3,9],[-1,17,6],[0,5,-7]]);J
|
||
|
I.det()
|
||
|
J.inverse()
|