From bfbe34406c9f131781ef8649e237c793ed7fcd8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marzena=20Grze=C5=9Bkowiak?= Date: Wed, 30 Jan 2019 11:23:51 +0100 Subject: [PATCH] Sage Math --- Sage Math/sagematch.sagews | 61 ++++++++++++++++++++++++++++++++++++++ Sage Math/sagematch.txt | 39 ++++++++++++++++++++++++ 2 files changed, 100 insertions(+) create mode 100644 Sage Math/sagematch.sagews create mode 100644 Sage Math/sagematch.txt diff --git a/Sage Math/sagematch.sagews b/Sage Math/sagematch.sagews new file mode 100644 index 0000000..f5a1f0a --- /dev/null +++ b/Sage Math/sagematch.sagews @@ -0,0 +1,61 @@ +︠b96febc1-f67b-401b-b5fe-20362fbe6fcc︠ +#zad1 +#a +rownanie=x+2==3*x-5 +solve(rownanie, x) +︡45151274-5a0c-4701-a75a-ab27a2d5e98a︡{"stdout":"[x == (7/2)]\n"}︡{"done":true} +︠4ce563a4-133b-4e0d-973b-dc667e9d8f59︠ +#b +rownanie2=x*x+3*x-1==0 +solve(rownanie2, x) +︡af099b4d-de7c-4f4c-9f7c-abcefdedac48︡{"stdout":"[x == -1/2*sqrt(13) - 3/2, x == 1/2*sqrt(13) - 3/2]\n"}︡{"done":true} +︠b6d3ea9b-a40f-455f-9da8-d7df3d82eb97s︠ +#c +rownanie3=3^x*(x^2-4)==0 +solve(rownanie3, x) +︡73f15e83-e826-4f46-a165-9014f196c353︡{"stdout":"[x == -2, x == 2]"}︡{"stdout":"\n"}︡{"done":true}︡ +︠b6cd8bba-d317-46d1-82e6-9653be131a52︠ +#d +rownanie4=(x+2)/(x-1)==3/(2*x-5) +solve(rownanie4, x) +︡ba27d302-ec0c-47b4-b4a2-25763ba74de0︡{"stdout":"[x == -3/2*sqrt(2) + 1, x == 3/2*sqrt(2) + 1]\n"}︡{"done":true} +︠7997e2b5-c74b-4be3-8ad5-cd6951d1c361︠ +#e +rownanie5=(2*x-1)*(x+2)==(x-1)^2 +solve(rownanie5, x) +︡e554d26e-1849-4845-b606-9e73cd1a7f7d︡{"stdout":"[x == -1/2*sqrt(37) - 5/2, x == 1/2*sqrt(37) - 5/2]\n"}︡{"done":true} +︠e0d62a12-9fba-4a89-947c-3d1c61e7eb43s︠ +#zad2 +#a +var('x,y') +solve([5*x+2*y==4, x-4*y==-2],x,y) +show(implicit_plot(5*x+2*y==4,(x,-2,2),(y,-2,2), color="red")\ + +implicit_plot(x-4*y==-2,(x,-2,2),(y,-2,2),color="blue")\ + +points([(6/11,7/11)], size=45, color='green',figsize=4)) + +a=implicit_plot(5*x+2*y==4,(x,-2,2),(y,-2,2), color="red") +b=implicit_plot(x-4*y==-2,(x,-2,2),(y,-2,2),color="blue") +c=points([(6/11,7/11)], size=45, color='green',figsize=4) +a+b+c + + +#b +var('x,y') +solve([x^2+2*x+y^2-4*x==20, 2*x-y==0],x,y) +show(implicit_plot(x^2+2*x+y^2-4*x==20,(x,-10,10),(y,-10,10), color="red")\ + +implicit_plot(2*x-y==0,(x,-10,10),(y,-10,10),color="blue")\ + +points([(-1/5*sqrt(101) + 1/5,-2/5*sqrt(101) + 2/5),(1/5*sqrt(101) + 1/5,2/5*sqrt(101) + 2/5)], size=45, color='green',figsize=4)) +p=implicit_plot(x^2+2*x+y^2-4*x==20,(x,-10,10),(y,-10,10), color="red") +g=implicit_plot(2*x-y==0,(x,-10,10),(y,-10,10), color="blue") +i=points([(-1/5*sqrt(101) + 1/5,-2/5*sqrt(101) + 2/5),(1/5*sqrt(101) + 1/5,2/5*sqrt(101) + 2/5)], size=45, color='green',figsize=4) +p+g+i +︡6885544e-ca6b-49f2-8017-b247a489e23e︡{"stdout":"(x, y)\n"}︡{"stdout":"[[x == (6/11), y == (7/11)]]\n"}︡{"file":{"filename":"/home/user/.sage/temp/project-57137279-018d-4802-a428-656eb095dab7/109/tmp_ugx8PL.svg","show":true,"text":null,"uuid":"d9d60160-4ffd-497a-b21c-6727c812a47c"},"once":false}︡{"file":{"filename":"/home/user/.sage/temp/project-57137279-018d-4802-a428-656eb095dab7/109/tmp_GdT8j3.svg","show":true,"text":null,"uuid":"b1624faf-f7eb-4d7d-b905-d0363cdc0b97"},"once":false}︡{"stdout":"(x, y)\n"}︡{"stdout":"[[x == -1/5*sqrt(101) + 1/5, y == -2/5*sqrt(101) + 2/5], [x == 1/5*sqrt(101) + 1/5, y == 2/5*sqrt(101) + 2/5]]\n"}︡{"file":{"filename":"/home/user/.sage/temp/project-57137279-018d-4802-a428-656eb095dab7/109/tmp_TiNtEW.svg","show":true,"text":null,"uuid":"8849ca25-0f40-43ba-8de0-e372a8d3b89b"},"once":false}︡{"file":{"filename":"/home/user/.sage/temp/project-57137279-018d-4802-a428-656eb095dab7/109/tmp_89lU7A.svg","show":true,"text":null,"uuid":"9ede7da2-6891-4f29-a85a-fb3c1fcbd93b"},"once":false}︡{"done":true} + + + + + + + + + diff --git a/Sage Math/sagematch.txt b/Sage Math/sagematch.txt new file mode 100644 index 0000000..4eec881 --- /dev/null +++ b/Sage Math/sagematch.txt @@ -0,0 +1,39 @@ +#zad1 +#a +rownanie=x+2==3*x-5 +solve(rownanie, x) +#b +rownanie2=x*x+3*x-1==0 +solve(rownanie2, x) +#c +rownanie3=3^x*(x^2-4)==0 +solve(rownanie3, x) +#d +rownanie4=(x+2)/(x-1)==3/(2*x-5) +solve(rownanie4, x) +#e +rownanie5=(2*x-1)*(x+2)==(x-1)^2 +solve(rownanie5, x) +#zad2 +#a +var('x,y') +solve([5*x+2*y==4, x-4*y==-2],x,y) +show(implicit_plot(5*x+2*y==4,(x,-2,2),(y,-2,2), color="red")\ + +implicit_plot(x-4*y==-2,(x,-2,2),(y,-2,2),color="blue")\ + +points([(6/11,7/11)], size=45, color='green',figsize=4)) + +a=implicit_plot(5*x+2*y==4,(x,-2,2),(y,-2,2), color="red") +b=implicit_plot(x-4*y==-2,(x,-2,2),(y,-2,2),color="blue") +c=points([(6/11,7/11)], size=45, color='green',figsize=4) +a+b+c +#b +var('x,y') +solve([x^2+2*x+y^2-4*x==20, 2*x-y==0],x,y) +show(implicit_plot(x^2+2*x+y^2-4*x==20,(x,-10,10),(y,-10,10), color="red")\ + +implicit_plot(2*x-y==0,(x,-10,10),(y,-10,10),color="blue")\ + +points([(-1/5*sqrt(101) + 1/5,-2/5*sqrt(101) + 2/5),(1/5*sqrt(101) + 1/5,2/5*sqrt(101) + 2/5)], size=45, color='green',figsize=4)) + +p=implicit_plot(x^2+2*x+y^2-4*x==20,(x,-10,10),(y,-10,10), color="red") +g=implicit_plot(2*x-y==0,(x,-10,10),(y,-10,10), color="blue") +i=points([(-1/5*sqrt(101) + 1/5,-2/5*sqrt(101) + 2/5),(1/5*sqrt(101) + 1/5,2/5*sqrt(101) + 2/5)], size=45, color='green',figsize=4) +p+g+i