Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

All published worksheets from http://sagenb.org

Views: 168693
Image: ubuntu2004
f(x) = x^2 + 2*x + 1; f
x |--> x^2 + 2*x + 1
var('x,k,n') (x, k, n)
(x, k, n)
taylor (f, x, 0, 1)
x |--> 2*x + 1
taylor (f, x, 0, 2)
x |--> x^2 + 2*x + 1
taylor (f, x, 0, 5)
x |--> x^2 + 2*x + 1
taylor (f, x, 1, 1)
x |--> 4*x
taylor (f, x, 1, 2)
x |--> (x - 1)^2 + 4*x
((x - 1)^2 + 4*x) - (x^2 + 2*x + 1)
(x - 1)^2 - x^2 + 2*x - 1
taylor (f, x, 1, 1)
x |--> 4*x
a(x) = 4*x; a
x |--> 4*x
abs(a(1) - f(1))
0
abs(a(5) - f(5))
16
abs(a(10) - f(10))
81
abs(a(100) - f(100))
9801
g(x) = 1/(1 + x); g
x |--> 1/(x + 1)
taylor (g, x, 1, 1)
x |--> -1/4*x + 3/4
[abs((taylor (g, x, 1, 1) - g) (1 + (1/2^k))) for k in range (6)]
[1/12, 1/40, 1/144, 1/544, 1/2112, 1/8320]
taylor (g, x, 1, 2)
x |--> 1/8*(x - 1)^2 - 1/4*x + 3/4
[abs((taylor (g, x, 1, 2) - g) (1 + (1/2^k))) for k in range (6)]
[1/24, 1/160, 1/1152, 1/8704, 1/67584, 1/532480]
taylor (g, x, (-9/10), 1)
x |--> -100*x - 80
[abs((taylor (g, x, (-9/10), 2) - g) ((-9/10) + (1/2^k))) for k in range (6)]
[10000/11, 625/3, 625/14, 625/72, 625/416, 625/2688]
plot((taylor (g, x, (-9/10), 2) - g), (-1,3))
h(x) = arctan(x); h
x |--> arctan(x)
t(x) = diff(h, x, 2); t
x |--> -2*x/(x^2 + 1)^2
u(x) = diff(h, x, 6); u
x |--> -3840*x^5/(x^2 + 1)^6 + 3840*x^3/(x^2 + 1)^5 - 720*x/(x^2 + 1)^4
v(x) = diff(h, x, 11); v
x |--> 3715891200*x^10/(x^2 + 1)^11 - 8360755200*x^8/(x^2 + 1)^10 + 6502809600*x^6/(x^2 + 1)^9 - 2032128000*x^4/(x^2 + 1)^8 + 217728000*x^2/(x^2 + 1)^7 - 3628800/(x^2 + 1)^6
plot(diff(h, x, 2), (0,1))
plot(diff(h, x, 6), (0,1))
plot(diff(h, x, 11), (0,1))
taylor (h, x, 0, 1);
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "_sage_input_77.py", line 5, in <module> taylor (h, x, _sage_const_0 , _sage_const_1 ); File "/usr/local/sage/local/lib/python2.6/site-packages/sage/calculus/functional.py", line 359, in taylor return f.taylor(v=v,a=a,n=n) File "expression.pyx", line 2342, in sage.symbolic.expression.Expression.taylor (sage/symbolic/expression.cpp:12460) File "/usr/local/sage/local/lib/python2.6/site-packages/sage/interfaces/expect.py", line 1404, in __call__ return self._obj.parent().function_call(self._name, [self._obj] + list(args), kwds) File "/usr/local/sage/local/lib/python2.6/site-packages/sage/interfaces/expect.py", line 1312, in function_call return self.new(s) File "/usr/local/sage/local/lib/python2.6/site-packages/sage/interfaces/expect.py", line 1096, in new return self(code) File "/usr/local/sage/local/lib/python2.6/site-packages/sage/interfaces/expect.py", line 1031, in __call__ return cls(self, x, name=name) File "/usr/local/sage/local/lib/python2.6/site-packages/sage/interfaces/expect.py", line 1447, in __init__ raise TypeError, x TypeError: Error executing code in Maxima CODE: sage436 : taylor(sage432,sage433,sage434,sage435)$ Maxima ERROR: taylor: 1/2 cannot be a variable.
taylor (h, x, 0, 5)
x |--> 1/5*x^5 - 1/3*x^3 + x
taylor (h, x, 0, 10)
x |--> 1/9*x^9 - 1/7*x^7 + 1/5*x^5 - 1/3*x^3 + x
n(x) = x; n n(1/2) - arctan(0.5)
0.0363523909991939
0.65*((1/2)^(2)/factorial(2))
0.0812500000000000
100*((1/2)^(2)/factorial(2))
25/2
3e6*((1/2)^(2)/factorial(2))
375000.000000000
n(x) = x; n n(1) - arctan(1)
-1/4*pi + 1
0.65*((1)^(2)/factorial(2))
0.325000000000000
100*((1)^(2)/factorial(2))
50
3e6*((1)^(2)/factorial(2))
1.50000000000000e6
s(x) = 1/5*x^5 - 1/3*x^3 + x; s s(1/2) - arctan(0.5)
0.000935724332527255
0.65*((1/2)^(6)/factorial(6))
0.0000141059027777778
100*((1/2)^(6)/factorial(6))
5/2304
3e6*((1/2)^(6)/factorial(6))
65.1041666666667
s(x) = 1/5*x^5 - 1/3*x^3 + x; s s(1) - arctan(1)
-1/4*pi + 13/15
0.65*((1)^(6)/factorial(6))
0.000902777777777778
100*((1)^(6)/factorial(6))
5/36
3e6*((1)^(6)/factorial(6))
4166.66666666667
i(x)= 1/9*x^9 - 1/7*x^7 + 1/5*x^5 - 1/3*x^3 + x; i i(0.5) - arctan(0.5)
0.0000366667928446973
0.65*((1/2)^(11)/factorial(11))
7.95110861842633e-12
100*((1/2)^(11)/factorial(11))
1/817496064
3e6*((1/2)^(11)/factorial(11))
0.0000366974243927369
i(x)= 1/9*x^9 - 1/7*x^7 + 1/5*x^5 - 1/3*x^3 + x; i i(1) - arctan(1)
-1/4*pi + 263/315
0.65*((1)^(11)/factorial(11))
1.62838704505371e-8
100*((1)^(11)/factorial(11))
1/399168
3e6*((1)^(11)/factorial(11))
0.0751563251563252