기초수학실습-0114-송정현

1974 days 전, Xetrov 작성

fuck you 
       
Traceback (click to the left of this block for traceback)
...
SyntaxError: invalid syntax
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "_sage_input_2.py", line 10, in <module>
    exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("ZnVjayB5b3U="),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))
  File "", line 1, in <module>
    
  File "/tmp/tmpo3gQBz/___code___.py", line 2
    fuck you
           ^
SyntaxError: invalid syntax
[-9, -7..-1] 
       
[-9, -7, -5, -3, -1]
[-9, -7, -5, -3, -1]
[-18,-15..100] 
       
[-18, -15, -12, -9, -6, -3, 0, 3, 6, 9, 12, 15, 18, 21, 24, 27, 30, 33,
36, 39, 42, 45, 48, 51, 54, 57, 60, 63, 66, 69, 72, 75, 78, 81, 84, 87,
90, 93, 96, 99]
[-18, -15, -12, -9, -6, -3, 0, 3, 6, 9, 12, 15, 18, 21, 24, 27, 30, 33, 36, 39, 42, 45, 48, 51, 54, 57, 60, 63, 66, 69, 72, 75, 78, 81, 84, 87, 90, 93, 96, 99]
[a.is_prime() for a in [1..100]] 
       
[False, True, True, False, True, False, True, False, False, False, True,
False, True, False, False, False, True, False, True, False, False,
False, True, False, False, False, False, False, True, False, True,
False, False, False, False, False, True, False, False, False, True,
False, True, False, False, False, True, False, False, False, False,
False, True, False, False, False, False, False, True, False, True,
False, False, False, False, False, True, False, False, False, True,
False, True, False, False, False, False, False, True, False, False,
False, True, False, False, False, False, False, True, False, False,
False, False, False, False, False, True, False, False, False]
[False, True, True, False, True, False, True, False, False, False, True, False, True, False, False, False, True, False, True, False, False, False, True, False, False, False, False, False, True, False, True, False, False, False, False, False, True, False, False, False, True, False, True, False, False, False, True, False, False, False, False, False, True, False, False, False, False, False, True, False, True, False, False, False, False, False, True, False, False, False, True, False, True, False, False, False, False, False, True, False, False, False, True, False, False, False, False, False, True, False, False, False, False, False, False, False, True, False, False, False]
b=[] for a in [1..100]: if a.is_prime(): b.append(a) print b 
       
[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67,
71, 73, 79, 83, 89, 97]
[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97]
P(x)=(x-2)^3*(x^2-4*x+3)*2 
       
expand(P(x)) 
       
2*x^5 - 20*x^4 + 78*x^3 - 148*x^2 + 136*x - 48
2*x^5 - 20*x^4 + 78*x^3 - 148*x^2 + 136*x - 48
factor(P(x)) 
       
2*(x - 1)*(x - 2)^3*(x - 3)
2*(x - 1)*(x - 2)^3*(x - 3)
factor(2*x^5 - 20*x^4 + 78*x^3 - 148*x^2 + 136*x - 48) 
       
2*(x - 1)*(x - 2)^3*(x - 3)
2*(x - 1)*(x - 2)^3*(x - 3)
expand(2*(x - 1)*(x - 2)^3*(x - 3)) 
       
2*x^5 - 20*x^4 + 78*x^3 - 148*x^2 + 136*x - 48
2*x^5 - 20*x^4 + 78*x^3 - 148*x^2 + 136*x - 48
(P(x)/(x-2)) 
       
2*(x^2 - 4*x + 3)*(x - 2)^2
2*(x^2 - 4*x + 3)*(x - 2)^2
(P(x)/(x-1)).simplify_full() 
       
2*x^4 - 18*x^3 + 60*x^2 - 88*x + 48
2*x^4 - 18*x^3 + 60*x^2 - 88*x + 48
W.<x>=QQ[] W(P(x)).quo_rem(x^2-5*x+1) 
       
(2*x^3 - 10*x^2 + 26*x - 8, 70*x - 40)
(2*x^3 - 10*x^2 + 26*x - 8, 70*x - 40)
((2*x^3 - 10*x^2 + 26*x - 8)*(x^2-5*x+1)+70*x - 40) 
       
2*x^5 - 20*x^4 + 78*x^3 - 148*x^2 + 136*x - 48
2*x^5 - 20*x^4 + 78*x^3 - 148*x^2 + 136*x - 48
var('x, y') solve( [3*x - y == 2, -2*x -y == 1 ], x,y) 
       
[[x == (1/5), y == (-7/5)]]
[[x == (1/5), y == (-7/5)]]
var('x, y, z') solve([ 2*x + 3*y + 5*z == 1, 4*x + 6*y + 10*z == 2, 6*x + 9*y + 15*z == 3], x,y,z) 
       
[[x == -5/2*r1 - 3/2*r2 + 1/2, y == r2, z == r1]]
[[x == -5/2*r1 - 3/2*r2 + 1/2, y == r2, z == r1]]
solve([ x^3 - x == 7*x^2 - 7], x) 
       
[x == 7, x == -1, x == 1]
[x == 7, x == -1, x == 1]
solve(abs(t-7)>= 3, t) 
       
#0: solve_rat_ineq(ineq=abs(t-7) >= 3)
[[t == 10], [t == 4], [t < 4], [10 < t]]
#0: solve_rat_ineq(ineq=abs(t-7) >= 3)
[[t == 10], [t == 4], [t < 4], [10 < t]]
solve([2*x+y==17, x-3*y==-16], x, y) 
       
[[x == 5, y == 7]]
[[x == 5, y == 7]]
solve(x^3-x == 7*x^2-7, x) 
       
[x == 7, x == -1, x == 1]
[x == 7, x == -1, x == 1]
var('t') solve(abs(t-7)>=3, x) 
       
#0: solve_rat_ineq(ineq=abs(t-7) >= 3)
[[t == 10], [t == 4], [t < 4], [10 < t]]
#0: solve_rat_ineq(ineq=abs(t-7) >= 3)
[[t == 10], [t == 4], [t < 4], [10 < t]]
f(x) = sin(x) 
       
 
       
p = plot(f(x), (x, -pi/2, pi/2)) 
       
p = plot(f(x), (x,-pi/2, pi/2), axes_labels=['x','sin(x)'], color='purple') p.show() 
       
sage: f(x) = sin(x) sage: g(x) = cos(x) sage: p = plot(f(x),(x,-pi/2,pi/2), color='black') sage: q = plot(g(x), (x,-pi/2, pi/2), color='red') sage: r = p + q sage: r.show() 
       
sage: f(x) = (x^3 + x^2 + x)/(x^2 - x -2 ) sage: p = plot(f(x), (x, -5,5)) sage: p.show() p.show(xmin=-2, xmax=4, ymin=-20, ymax=20) 
       
sage: P(x)=2*x^3+3*x^2-5*x-6 solve(P(x)==0, x) sage: plot(P(x), (x, -4, 4), ymax=20, ymin=-20) 
       
sage: P(x)=4*x^4++4*x^3-9*x^2-x+2 solve(P(x)==0, x) p.show() 
       
plot(sin(pi*x-pi), (x,-1, 1), thickness=8, color='red') 
       
plot(cos(pi*x-pi), (x,-1, 1), thickness=8, color='blue') 
       
p = plot(sin(pi*x-pi), (x,-1, 1), thickness=8, color='red') q = plot(cos(pi*x-pi), (x,-1, 1), thickness=8, color='blue') r = p + q r.show() 
       
z = plot(1/x, (x,-1,1)) z.show(ymin=-10, ymax=10) 
       
plot(P(x), (x, -4, 4), ymax=20, ymin=-20) 
       
P(x)=4*x^4++4*x^3-9*x^2-x+2 solve(P(x)==0, x) 
       
[x == (1/2), x == -2, x == 1, x == (-1/2)]
[x == (1/2), x == -2, x == 1, x == (-1/2)]
f(x)=2/(x-5) plot(f(x), (x, 2, 7), ymax=10, ymin=-10) 
       
sage: f(x)=-4/((x-4)^2) sage: plot(f(x), (x, 2, 7), ymax=10, ymin=-20) 
       
sage: f(x)=(2*x^2+1)/(x^2-4*x+3) sage: plot(f(x), (x, -2, 6), ymax=20, ymin=-20) 
       
sage: f(x)=(2*x^2-1)/(x^2+1) sage: plot(f(x), (x, -6, 6), ymax=3)+plot(2, (x, -6, 6), color='red') 
       
f(x)=4 plot(f(x), (x,-0.5,0.5)) 
       
sage: x,y = var("x y") sage: f(x,y) = x^2 - y^2 sage: p = plot3d(f(x,y), (x,-10,10), (y,-10,10)) sage: p.show() 
       
Sleeping...
If no image appears re-execute the cell. 3-D viewer has been updated.
f(x)=4^(-x) plot(f(x), (x, -3, 3), ymax=30) 
       
f(x)=2^(-abs(x)) plot(f(x), (x, -3, 3), ymax=2) 
       
f(x)=-(1/2)^x plot(f(x), (x, -3, 3)) 
       
f(x)=(1/2)^x+(1/2)^(-x) plot(f(x), (x, -3, 3)) 
       
f(x)=2^x g(x)=2^x+2 h(x)=2^(x+1)-2 plot(f(x), (x, -3, 3))+plot(g(x), (x, -3, 3), color='red')+plot(h(x), (x, -3, 3),color='black') 
       
f(x)=log(x,2) g(x)=log(x-2,2) h(x)=log(x,2)+3 t(x)=log(x-2,2)+3 plot(f(x), (x, 0, 5))+plot(g(x), (x, 2, 5), color='red')+plot(h(x), (x, 0, 5),color='black')+plot(t(x), (x, 2, 5), color='green') 
       
f(x)=log(abs(x), 10) plot(f, (x, -3, 3), ymin=-1, color='brown') 
       
f(x)=abs(log(x, 10)) plot(f, (x, 0, 3)) 
       
solve((1/2)^x==4,x) 
       
[x == -2]
[x == -2]
solve(1/27==x^(-1), x) 
       
[x == 27]
[x == 27]
solve(exp(3+3*x)==exp(-8*x), x) 
       
[x == (-3/11)]
[x == (-3/11)]
solve(log(1/8,x)==-1/3,x) 
       
[x == 512]
[x == 512]
solve(log(x,16)==1/2,x) 
       
[x == e^(1/2*log(16))]
[x == e^(1/2*log(16))]
solve(log(x^2)==(log(x))^2,x) 
       
[log(x^2) == log(x)^2]
[log(x^2) == log(x)^2]
f(x)=sin(x) plot(f(x), (x, -pi, 3*pi), color='pink') 
       
f(x)=cos(x) plot(f(x), (x, -pi, 3*pi)) 
       
f(x)=tan(x) plot(f(x), (x, -pi, 3*pi), ymax=5, ymin=-5) 
       
f(x)=sin(x) g(x)=2*sin(x) h(x)=(1/2)*sin(x) p1=plot(f(x), (x, -2*pi, 2*pi)) p2=plot(g(x), (x, -2*pi, 2*pi), color='red') p3=plot(h(x), (x, -2*pi, 2*pi), color='green') p1+p2+p3 
       
f(x)=sin(x) t(x)=sin(2*x) u(x)=sin((1/2)*x) p1=plot(f(x), (x, -2*pi, 2*pi)) p4=plot(t(x), (x, -2*pi, 2*pi), color='black') p5=plot(u(x), (x, -2*pi, 2*pi), color='yellow') p1+p4+p5 
       
f(x)=cos(x) g(x)=cos(x-1)+2 plot(f(x), (x, -2*pi, 2*pi))+plot(g(x), (x, -2*pi, 2*pi), color='red')+plot(1, (x, -2*pi, 2*pi), color='green') 
       
f(x)=4*sin(x-1)+2 plot(f(x), (x, -2*pi, 2*pi)) 
       
f(x)=sin(abs(x)) plot(f(x), (x, -2*pi, 2*pi)) 
       
f(x)=abs(cos(x-pi/2)) plot(f(x), (x, -2*pi, 2*pi)) 
       
f(x)=sin(x)+sin(2*x) plot(f(x), (x, -2*pi, 2*pi)) 
       
f(x)=cot(x) plot(f(x), (x, -2*pi, 2*pi), ymax=10, ymin=-10) 
       
f(x)=cot(x) g(x)=tan(x) plot(f(x), (x, -2*pi, 2*pi), ymax=10, ymin=-10)+plot(g(x), (x, -2*pi, 2*pi), ymax=10, ymin=-10, color='red') 
       
f(x)=sec(x) plot(f(x), (x, -2*pi, 2*pi), ymax=10, ymin=-10) 
       
f(x)=sec(x) g(x)=cos(x) plot(f(x), (x, -2*pi, 2*pi), ymax=10, ymin=-10)+plot(g(x), (x, -2*pi, 2*pi), ymax=10, ymin=-10, color='red') 
       
f(x)=csc(x) plot(f(x), (x, -2*pi, 2*pi), ymax=10, ymin=-10)