diff --git a/Sage Math/Sage Math.txt b/Sage Math/Sage Math.txt new file mode 100644 index 0000000..4621d9f --- /dev/null +++ b/Sage Math/Sage Math.txt @@ -0,0 +1,43 @@ +SAGE MATH + +zad.1. + +a) +sage: rownaniee = x + 2 == 3*x - 5 +sage: solve(rownaniee, x) + +b) +sage: rownanieee = x^2 + 3*x - 1 == 0 +sage: solve(rownanieee, x) + +c) +sage: rownanieeee = 3^x * (x^2 - 4) == 0 +sage: solve(rownanieeee, x) + + +zad.2. + +a) +sage: var('x,y') +sage: solve([5*x + 2*y == 4, x - 4*y == -2],x,y) + +P = implicit_plot(5*x + 2*y == 4, (x,-2,2), (y,-2,2), color="red") +G = implicit_plot(x - 4*y == -2, (x,-2,2), (y,-2,2), color="blue") +R = points([(6/11, 7/11)], size=45, color="green", figsize=4) +P + G + R + +lub: + +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)) + + +b) +sage: var('x,y') +sage: solve([x^2 + 2*x + y^2 - 4*x == 20, 2*x - y == 0],x,y) + +A = implicit_plot(x^2 + 2*x + y^2 - 4*x == 20, (x,-10,10), (y,-10,10), color="red") +B = implicit_plot(2*x - y == 0, (x,-10,10), (y,-10,10), color="blue") +C = 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) +A+B+C \ No newline at end of file