Shared2018-10-10-234254.sagewsOpen in CoCalc
def T(n, x):
    if n==1:
        return (x^2)-1
    elif n==2:
        return 2*(x^4)-2*(x^2)+1
    else:
        return (2*x^2-1)*T(n-1,x)+x^2*T(n-2,x)
t = var('t');
f(t)=exp(I*t)/(2^(1/2))
H=plot((0,0))
for i in range(10,11):
    G=parametric_plot((real(T(i,f(t))),imag(T(i,f(t)))),[t,1/4*pi,3/4*pi],rgbcolor=hue(sin(i)))
    if i==1:
        H=G
    else:
        H=H+G
show(H,xmin=-0.5,xmax=0.5,ymin=-0.5,ymax=0.5)
i=6
f(t)=exp(I*t)/(2^(1/2))
G=parametric_plot((real(T(i,T(i,f(t)))),imag(T(i,T(i,f(t))))),[t,0,2*pi])
show(G)
x=var('x')
G=circle((0,0),1/(2^(1/2)))
for i in range(1,21):
    eq=T(i,x)==0
    L=eq.roots(x,ring=CC,multiplicities=False)
    G=G+list_plot(L,rgbcolor=hue(i/10))
Lx=plot(x)
Lxx=plot(-x)
show(G+Lx+Lxx)

x,t=var('x,t')
f(t)=exp(I*t)/(2^(1/2))
F(x)=4*x^4-8*x^2+1
G(x)=2*x^2-1
parametric_plot((real(F(f(t))),imag(F(f(t)))),[t,0,2*pi])
R = ZZ['x']
x = R.gen()
for i in range(1,30):
    T(i,x).is_irreducible()

False
Error in lines 3-5 Traceback (most recent call last): File "/cocalc/lib/python2.7/site-packages/smc_sagews/sage_server.py", line 1188, in execute flags=compile_flags) in namespace, locals File "", line 3, in <module> File "sage/structure/element.pyx", line 493, in sage.structure.element.Element.__getattr__ (build/cythonized/sage/structure/element.c:4518) return self.getattr_from_category(name) File "sage/structure/element.pyx", line 506, in sage.structure.element.Element.getattr_from_category (build/cythonized/sage/structure/element.c:4627) return getattr_from_other_class(self, cls, name) File "sage/cpython/getattr.pyx", line 394, in sage.cpython.getattr.getattr_from_other_class (build/cythonized/sage/cpython/getattr.c:2535) raise AttributeError(dummy_error_message) AttributeError: 'sage.rings.polynomial.polynomial_integer_dense_flint.Polynomial_integer_dense_flint' object has no attribute 'expand'
 x=var('x')
for i in range(1,10):
    expand(2*T(i,x/2^(1/2)))
x^2 - 2 x^4 - 2*x^2 + 2 x^6 - 5/2*x^4 + 3*x^2 - 2 x^8 - 3*x^6 + 9/2*x^4 - 4*x^2 + 2 x^10 - 7/2*x^8 + 25/4*x^6 - 7*x^4 + 5*x^2 - 2 x^12 - 4*x^10 + 33/4*x^8 - 11*x^6 + 10*x^4 - 6*x^2 + 2 x^14 - 9/2*x^12 + 21/2*x^10 - 129/8*x^8 + 35/2*x^6 - 27/2*x^4 + 7*x^2 - 2 x^16 - 5*x^14 + 13*x^12 - 45/2*x^10 + 225/8*x^8 - 26*x^6 + 35/2*x^4 - 8*x^2 + 2 x^18 - 11/2*x^16 + 63/4*x^14 - 121/4*x^12 + 681/16*x^10 - 363/8*x^8 + 147/4*x^6 - 22*x^4 + 9*x^2 - 2
        for i in range(1,10):
    T(i,1)
0 1 1 2 3 5 8 13 21
x=var('x')
G=circle((0,0),1)
lamd=2
tt=pi/2-lamd*pi/4
t=exp(I*tt)/(sqrt(2))
F=x^2-(2*t^2-1)*x-t^2==0
L=F.roots(x,ring=CC,multiplicities=False)
L.append(I)
print(L)
G=G+list_plot(L,color='red',size=100)
show(G)
[-0.707106781186548, 0.707106781186548, I]