Kokosza-iwp2016/zajęcia 8/iwp.sagews

42 lines
2.1 KiB
Plaintext
Raw Normal View History

2016-12-07 10:47:36 +01:00
︠58f3928f-b0b8-4d0e-af8d-88e70edb680cs︠
sage: x = var('x')
sage: solve(x^6 - 9*x^5 + 10*x^4 + 18*x^3 + 49*x^2 + 135*x + 84,x)
sage: solve(x^3 - 5*x^2 + 8*x-40,x)
︡c38f6bf8-73ab-4415-9396-96498afba245︡{"stdout":"[x == 7, x == 4, x == -I*sqrt(3), x == I*sqrt(3), x == -1]\n"}︡{"stdout":"[x == -2*I*sqrt(2), x == 2*I*sqrt(2), x == 5]\n"}︡{"done":true}︡
︠0ae7f086-ceab-4f9c-9c65-c0a1a61997e3s︠
sage: phi = var('phi')
sage: find_root(cos(phi)==phi,0,pi/2)
︡2290d9fe-39f1-4e28-aa30-b19d43c8102a︡{"stdout":"0.7390851332151607\n"}︡{"done":true}︡︡
︠c24bf081-4878-4cac-8809-9ca8fd5b01f7︠
sage: integrate(x/(sin(x)),x)
︡3fea0fb8-4566-423a-a774-a47ff13dc5d7︡{"stdout":"-I*x*arctan2(sin(x), cos(x) + 1) - I*x*arctan2(sin(x), -cos(x) + 1) - 1/2*x*log(cos(x)^2 + sin(x)^2 + 2*cos(x) + 1) + 1/2*x*log(cos(x)^2 + sin(x)^2 - 2*cos(x) + 1) + I*polylog(2, -e^(I*x)) - I*polylog(2, e^(I*x))\n"}︡{"done":true}︡
︠48452d8b-fdf3-4c20-9b2d-ec4e96979509s︠
sage: integrate(e^(1/x^2), (x, -2, 4))
︡a349ef4e-faa9-4817-b227-21bc83f07051︡{"stdout":"1/2*I*gamma(-1/2, -1/16) + 1/2*I*gamma(-1/2, -1/4)"}︡{"stdout":"\n"}︡{"done":true}︡
︠f369f238-c343-44e1-b12b-a0e7dafbda04s︠
sage: diff((x^2 * sin(x+2))^0.5,x)
sage: diff((x*e^(cos (x)))^3,x)
︡f3f4c353-01ab-4a50-a5be-4ef3f0bfc2c2︡{"stdout":"0.500000000000000*(x^2*cos(x + 2) + 2*x*sin(x + 2))/sqrt(x^2*sin(x + 2))\n"}︡{"stdout":"-3*x^3*e^(3*cos(x))*sin(x) + 3*x^2*e^(3*cos(x))\n"}︡{"done":true}︡
︠eec4c055-7bf0-4fc3-8bfd-d6c6288422f3s︠
sage: x, y = var('x,y')
sage: f = x^2+sin(x*y)-y
sage: f.diff(y)
︡56f11819-2f78-495e-9606-29b96873fe8d︡{"stdout":"x*cos(x*y) - 1\n"}︡{"done":true}︡
︠8e7c079c-bc28-4840-9d36-fc5acd1b43ccs︠
sage: A = matrix([[1, -4, 7],[14, 6, 8],[-4, -1, 2]])
sage: B = matrix([[2, 3, 9],[-1, 17, 6],[ 0, 5, -7]])
sage: A * B
sage: det(A)
sage: B^(-1)
︡a1dc970e-3028-4711-b07f-96995317b161︡{"stdout":"[ 6 -30 -64]\n[ 22 184 106]\n[ -7 -19 -56]\n"}︡{"stdout":"330\n"}︡{"stdout":"[149/364 -33/182 135/364]\n[ 1/52 1/26 3/52]\n[ 5/364 5/182 -37/364]\n"}︡{"done":true}︡