week13

148 days ago by wldnd1217

#infinite sequences #1 var('n') a(n)=(1-2*(n)^2)/(2+5*(n)^2) limit(a(n),n=+oo) 
       
-2/5
-2/5
#2 var('n') a(n)=(3-1/3^(n))*(2+1/2^(n)) limit(a(n),n=+oo) 
       
6
6
#infinite series #1 var('n') a(n) = 3/((n+1)*(n+2)) P=sum(a(n), n, 1, +oo) b(n) = 2/(3^n) Q=sum(b(n), n, 1, +oo) P-Q 
       
1/2
1/2
#2 var('n') a(n)=2^n*factorial(n)/(n^n) sum(a(n),n,1,+oo) 
       
sum(2^n*n^(-n)*factorial(n), n, 1, +Infinity)
sum(2^n*n^(-n)*factorial(n), n, 1, +Infinity)
#3 var('n') a(n)=17/1000*(1/100)^n s=sum(a(n),n,0,+oo) 23/10+s 
       
1147/495
1147/495
#integral test #1 var('x') f(x)=2^x*sin(pi/(2^x)) integral(f(x),x,1,oo) 
       
Traceback (click to the left of this block for traceback)
...
ValueError: Integral is divergent.
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "_sage_input_15.py", line 10, in <module>
    exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("I2ludGVncmFsIHRlc3QKIzEKdmFyKCd4JykKZih4KT0yXngqc2luKHBpLygyXngpKQppbnRlZ3JhbChmKHgpLHgsMSxvbyk="),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))
  File "", line 1, in <module>
    
  File "/tmp/tmpP1uyZx/___code___.py", line 6, in <module>
    exec compile(u'integral(f(x),x,_sage_const_1 ,oo)
  File "", line 1, in <module>
    
  File "/root/sage-5.8/local/lib/python2.7/site-packages/sage/misc/functional.py", line 740, in integral
    return x.integral(*args, **kwds)
  File "expression.pyx", line 9302, in sage.symbolic.expression.Expression.integral (sage/symbolic/expression.cpp:38413)
  File "/root/sage-5.8/local/lib/python2.7/site-packages/sage/symbolic/integration/integral.py", line 688, in integrate
    return definite_integral(expression, v, a, b)
  File "function.pyx", line 429, in sage.symbolic.function.Function.__call__ (sage/symbolic/function.cpp:5064)
  File "/root/sage-5.8/local/lib/python2.7/site-packages/sage/symbolic/integration/integral.py", line 173, in _eval_
    return integrator(*args)
  File "/root/sage-5.8/local/lib/python2.7/site-packages/sage/symbolic/integration/external.py", line 21, in maxima_integrator
    result = maxima.sr_integral(expression, v, a, b)
  File "/root/sage-5.8/local/lib/python2.7/site-packages/sage/interfaces/maxima_lib.py", line 739, in sr_integral
    raise ValueError, "Integral is divergent."
ValueError: Integral is divergent.
#other test #1 var('n') a(n)=(-1)^n*cos(pi/n) sum(a(n),n,1,oo) 
       
sum((-1)^n*cos(pi/n), n, 1, +Infinity)
sum((-1)^n*cos(pi/n), n, 1, +Infinity)
#2 var('x') f(x)=x*e^(-x) limit(f(x),x=+oo) g(x)=e*x-x-1 solve(g(x)>0,x) print('f(x)>f(x+1),lim(f(x))=0, convergent') 
       
f(x)>f(x+1),lim(f(x))=0, convergent
f(x)>f(x+1),lim(f(x))=0, convergent
#power series #1 var('n') a(n)=x^(2*n)/(n*(ln(n))^2) r(x)=limit(abs(a(n)/a(n+1)),n=+oo) print(solve(1<r(x),x),'R=1') 
       
([[x > -1, x < 0], [x > 0, x < 1]], 'R=1')
([[x > -1, x < 0], [x > 0, x < 1]], 'R=1')
#2 var('n') a(n)=factorial(n)*(x-4)^n r(x)=limit(abs(a(n)/a(n+1)),n=+oo) print(solve(r(x)<1,x),'divergent') 
       
([[]], 'divergent')
([[]], 'divergent')
#3 var('n') a(n)=(2^n*x^n)/(n^2*3^n) r(x)=limit(abs(a(n)/a(n+1)),n=+oo) print(solve(r(x)<1,x),'R=3/2') 
       
([[x < 0], [x > (3/2)]], 'R=3/2')
([[x < 0], [x > (3/2)]], 'R=3/2')
#4 var('n') a(n)=e^n*x^n/sqrt(4^n+1) r(x)=limit(abs(a(n)/a(n+1)),n=+oo) print(solve(r(x)<1,x),'R=2/e') 
       
([[x < 0], [x > 2*e^(-1)]], 'R=2/e')
([[x < 0], [x > 2*e^(-1)]], 'R=2/e')
#5 var('n') a(n)=(n*(x+2)^n)/3^(n+1) r(x)=limit(abs(a(n)/a(n+1)),n=+oo) solve(r(x)<1,x) 
       
[[x < -2], [x > 1]]
[[x < -2], [x > 1]]
#taylor and maclaurin series #1 cos(x).taylor(x,0,5) 
       
1/24*x^4 - 1/2*x^2 + 1
1/24*x^4 - 1/2*x^2 + 1
#2 ((sin(x))^2).taylor(x,0,5) 
       
-1/3*x^4 + x^2
-1/3*x^4 + x^2
#3 f(x)=1/sqrt(4-x) f(x).taylor(x,0,5) 
       
63/524288*x^5 + 35/65536*x^4 + 5/2048*x^3 + 3/256*x^2 + 1/16*x + 1/2
63/524288*x^5 + 35/65536*x^4 + 5/2048*x^3 + 3/256*x^2 + 1/16*x + 1/2
#4 f(x)=1/x^3 f(x).taylor(x,1,5) 
       
-21*(x - 1)^5 + 15*(x - 1)^4 - 10*(x - 1)^3 + 6*(x - 1)^2 - 3*x + 4
-21*(x - 1)^5 + 15*(x - 1)^4 - 10*(x - 1)^3 + 6*(x - 1)^2 - 3*x + 4
#5 f(x)=ln(sin(x)/x) f(x).taylor(x,2,3) 
       
-1/24*(x - 2)^3*(sin(2)^3 - 8*sin(2)^2*cos(2) - 8*cos(2)^3)/sin(2)^3 -
1/8*(x - 2)^2*(3*sin(2)^2 + 4*cos(2)^2)/sin(2)^2 - 1/2*(x - 2)*(sin(2) -
2*cos(2))/sin(2) - log(2) + log(sin(2))
-1/24*(x - 2)^3*(sin(2)^3 - 8*sin(2)^2*cos(2) - 8*cos(2)^3)/sin(2)^3 - 1/8*(x - 2)^2*(3*sin(2)^2 + 4*cos(2)^2)/sin(2)^2 - 1/2*(x - 2)*(sin(2) - 2*cos(2))/sin(2) - log(2) + log(sin(2))
#approximation to taylor polynominals #1 f(x)=sin(x) g(x)=f(x).taylor(x,pi/6,10) print('approximation=',g(pi/10).n(), 'sin(pi/10)=',f(pi/10).n()) 
       
('approximation=', 0.309016994374947, 'sin(pi/10)=', 0.309016994374947)
('approximation=', 0.309016994374947, 'sin(pi/10)=', 0.309016994374947)
#2 f(x)=((ln(1+x))^2/(x*csc(x)-1)) g(x)=f(x).taylor(x,1,10) print('appoximation=',g(0).n(),'lim(f(x))=',limit(f(x),x=0)) 
       
('appoximation=', 5.99832306193219, 'lim(f(x))=', 6)
('appoximation=', 5.99832306193219, 'lim(f(x))=', 6)