passagemath-repl 10.5.28__py3-none-any.whl → 10.5.30__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. passagemath_repl-10.5.30.data/data/share/jupyter/kernels/sagemath/kernel.json +1 -0
  2. passagemath_repl-10.5.30.data/data/share/jupyter/kernels/sagemath/logo-64x64.png +0 -0
  3. passagemath_repl-10.5.30.data/data/share/jupyter/kernels/sagemath/logo.svg +352 -0
  4. {passagemath_repl-10.5.28.dist-info → passagemath_repl-10.5.30.dist-info}/METADATA +3 -3
  5. {passagemath_repl-10.5.28.dist-info → passagemath_repl-10.5.30.dist-info}/RECORD +95 -24
  6. {passagemath_repl-10.5.28.dist-info → passagemath_repl-10.5.30.dist-info}/top_level.txt +1 -0
  7. sage/ext_data/all__sagemath_repl.py +1 -0
  8. sage/interfaces/all__sagemath_repl.py +1 -0
  9. sage/repl/ipython_kernel/install.py +6 -8
  10. sage/tests/books/__init__.py +2 -0
  11. sage/tests/books/computational-mathematics-with-sagemath/__init__.py +1 -0
  12. sage/tests/books/computational-mathematics-with-sagemath/calculus_doctest.py +550 -0
  13. sage/tests/books/computational-mathematics-with-sagemath/combinat_doctest.py +1054 -0
  14. sage/tests/books/computational-mathematics-with-sagemath/domaines_doctest.py +444 -0
  15. sage/tests/books/computational-mathematics-with-sagemath/float_doctest.py +478 -0
  16. sage/tests/books/computational-mathematics-with-sagemath/graphique_doctest.py +255 -0
  17. sage/tests/books/computational-mathematics-with-sagemath/graphtheory_doctest.py +419 -0
  18. sage/tests/books/computational-mathematics-with-sagemath/integration_doctest.py +291 -0
  19. sage/tests/books/computational-mathematics-with-sagemath/linalg_doctest.py +455 -0
  20. sage/tests/books/computational-mathematics-with-sagemath/linsolve_doctest.py +422 -0
  21. sage/tests/books/computational-mathematics-with-sagemath/lp_doctest.py +235 -0
  22. sage/tests/books/computational-mathematics-with-sagemath/mpoly_doctest.py +561 -0
  23. sage/tests/books/computational-mathematics-with-sagemath/nonlinear_doctest.py +491 -0
  24. sage/tests/books/computational-mathematics-with-sagemath/numbertheory_doctest.py +156 -0
  25. sage/tests/books/computational-mathematics-with-sagemath/polynomes_doctest.py +406 -0
  26. sage/tests/books/computational-mathematics-with-sagemath/premierspas_doctest.py +181 -0
  27. sage/tests/books/computational-mathematics-with-sagemath/programmation_doctest.py +663 -0
  28. sage/tests/books/computational-mathematics-with-sagemath/recequadiff_doctest.py +393 -0
  29. sage/tests/books/computational-mathematics-with-sagemath/sol/__init__.py +1 -0
  30. sage/tests/books/computational-mathematics-with-sagemath/sol/calculus_doctest.py +265 -0
  31. sage/tests/books/computational-mathematics-with-sagemath/sol/combinat_doctest.py +218 -0
  32. sage/tests/books/computational-mathematics-with-sagemath/sol/domaines_doctest.py +60 -0
  33. sage/tests/books/computational-mathematics-with-sagemath/sol/float_doctest.py +142 -0
  34. sage/tests/books/computational-mathematics-with-sagemath/sol/graphique_doctest.py +106 -0
  35. sage/tests/books/computational-mathematics-with-sagemath/sol/graphtheory_doctest.py +54 -0
  36. sage/tests/books/computational-mathematics-with-sagemath/sol/integration_doctest.py +57 -0
  37. sage/tests/books/computational-mathematics-with-sagemath/sol/linalg_doctest.py +57 -0
  38. sage/tests/books/computational-mathematics-with-sagemath/sol/linsolve_doctest.py +26 -0
  39. sage/tests/books/computational-mathematics-with-sagemath/sol/lp_doctest.py +48 -0
  40. sage/tests/books/computational-mathematics-with-sagemath/sol/mpoly_doctest.py +116 -0
  41. sage/tests/books/computational-mathematics-with-sagemath/sol/nonlinear_doctest.py +112 -0
  42. sage/tests/books/computational-mathematics-with-sagemath/sol/numbertheory_doctest.py +168 -0
  43. sage/tests/books/computational-mathematics-with-sagemath/sol/polynomes_doctest.py +108 -0
  44. sage/tests/books/computational-mathematics-with-sagemath/sol/recequadiff_doctest.py +59 -0
  45. sage/tests/books/judson-abstract-algebra/__init__.py +1 -0
  46. sage/tests/books/judson-abstract-algebra/actions-sage-exercises.py +52 -0
  47. sage/tests/books/judson-abstract-algebra/actions-sage.py +174 -0
  48. sage/tests/books/judson-abstract-algebra/algcodes-sage.py +131 -0
  49. sage/tests/books/judson-abstract-algebra/boolean-sage.py +270 -0
  50. sage/tests/books/judson-abstract-algebra/cosets-sage-exercises.py +88 -0
  51. sage/tests/books/judson-abstract-algebra/cosets-sage.py +171 -0
  52. sage/tests/books/judson-abstract-algebra/crypt-sage.py +152 -0
  53. sage/tests/books/judson-abstract-algebra/cyclic-sage.py +451 -0
  54. sage/tests/books/judson-abstract-algebra/domains-sage.py +164 -0
  55. sage/tests/books/judson-abstract-algebra/fields-sage.py +300 -0
  56. sage/tests/books/judson-abstract-algebra/finite-sage.py +109 -0
  57. sage/tests/books/judson-abstract-algebra/galois-sage.py +485 -0
  58. sage/tests/books/judson-abstract-algebra/groups-sage.py +281 -0
  59. sage/tests/books/judson-abstract-algebra/homomorph-sage-exercises.py +66 -0
  60. sage/tests/books/judson-abstract-algebra/homomorph-sage.py +201 -0
  61. sage/tests/books/judson-abstract-algebra/integers-sage.py +198 -0
  62. sage/tests/books/judson-abstract-algebra/isomorph-sage.py +173 -0
  63. sage/tests/books/judson-abstract-algebra/normal-sage.py +134 -0
  64. sage/tests/books/judson-abstract-algebra/permute-sage.py +320 -0
  65. sage/tests/books/judson-abstract-algebra/poly-sage.py +301 -0
  66. sage/tests/books/judson-abstract-algebra/rings-sage.py +414 -0
  67. sage/tests/books/judson-abstract-algebra/sets-sage.py +164 -0
  68. sage/tests/books/judson-abstract-algebra/struct-sage.py +64 -0
  69. sage/tests/books/judson-abstract-algebra/sylow-sage.py +251 -0
  70. sage/tests/books/judson-abstract-algebra/vect-sage-exercises.py +49 -0
  71. sage/tests/books/judson-abstract-algebra/vect-sage.py +212 -0
  72. sage/tests/memcheck/__init__.py +1 -0
  73. sage/tests/memcheck/run_tests.py +25 -0
  74. sage/tests/memcheck/run_tests_in_valgrind.py +36 -0
  75. sage/tests/memcheck/symbolic_expression.py +12 -0
  76. sage/tests/memcheck/verify_no_leak.py +28 -0
  77. sage/tests/all.py +0 -0
  78. {passagemath_repl-10.5.28.data → passagemath_repl-10.5.30.data}/scripts/sage-cachegrind +0 -0
  79. {passagemath_repl-10.5.28.data → passagemath_repl-10.5.30.data}/scripts/sage-callgrind +0 -0
  80. {passagemath_repl-10.5.28.data → passagemath_repl-10.5.30.data}/scripts/sage-cleaner +0 -0
  81. {passagemath_repl-10.5.28.data → passagemath_repl-10.5.30.data}/scripts/sage-coverage +0 -0
  82. {passagemath_repl-10.5.28.data → passagemath_repl-10.5.30.data}/scripts/sage-eval +0 -0
  83. {passagemath_repl-10.5.28.data → passagemath_repl-10.5.30.data}/scripts/sage-fixdoctests +0 -0
  84. {passagemath_repl-10.5.28.data → passagemath_repl-10.5.30.data}/scripts/sage-inline-fortran +0 -0
  85. {passagemath_repl-10.5.28.data → passagemath_repl-10.5.30.data}/scripts/sage-ipynb2rst +0 -0
  86. {passagemath_repl-10.5.28.data → passagemath_repl-10.5.30.data}/scripts/sage-ipython +0 -0
  87. {passagemath_repl-10.5.28.data → passagemath_repl-10.5.30.data}/scripts/sage-massif +0 -0
  88. {passagemath_repl-10.5.28.data → passagemath_repl-10.5.30.data}/scripts/sage-notebook +0 -0
  89. {passagemath_repl-10.5.28.data → passagemath_repl-10.5.30.data}/scripts/sage-omega +0 -0
  90. {passagemath_repl-10.5.28.data → passagemath_repl-10.5.30.data}/scripts/sage-preparse +0 -0
  91. {passagemath_repl-10.5.28.data → passagemath_repl-10.5.30.data}/scripts/sage-run +0 -0
  92. {passagemath_repl-10.5.28.data → passagemath_repl-10.5.30.data}/scripts/sage-run-cython +0 -0
  93. {passagemath_repl-10.5.28.data → passagemath_repl-10.5.30.data}/scripts/sage-runtests +0 -0
  94. {passagemath_repl-10.5.28.data → passagemath_repl-10.5.30.data}/scripts/sage-startuptime.py +0 -0
  95. {passagemath_repl-10.5.28.data → passagemath_repl-10.5.30.data}/scripts/sage-valgrind +0 -0
  96. {passagemath_repl-10.5.28.dist-info → passagemath_repl-10.5.30.dist-info}/WHEEL +0 -0
@@ -0,0 +1,550 @@
1
+ # sage_setup: distribution = sagemath-repl
2
+ # sage.doctest: needs sage.symbolic
3
+ """
4
+ This file (./calculus_doctest.sage) was *autogenerated* from ./calculus.tex,
5
+ with sagetex.sty version 2011/05/27 v2.3.1.
6
+ It contains the contents of all the sageexample environments from this file.
7
+ You should be able to doctest this file with:
8
+ sage -t ./calculus_doctest.sage
9
+ It is always safe to delete this file; it is not used in typesetting your
10
+ document.
11
+
12
+ Sage example in ./calculus.tex, line 76::
13
+
14
+ sage: bool(arctan(1+abs(x)) == pi/2 - arctan(1/(1+abs(x))))
15
+ False
16
+
17
+ Sage example in ./calculus.tex, line 121::
18
+
19
+ sage: a, x = var('a, x'); y = cos(x+a) * (x+1); y
20
+ (x + 1)*cos(a + x)
21
+ sage: y.subs(a=-x); y.subs(x=pi/2, a=pi/3); y.subs(x=0.5, a=2.3)
22
+ x + 1
23
+ -1/4*sqrt(3)*(pi + 2)
24
+ -1.41333351100299
25
+ sage: y(a=-x); y(x=pi/2, a=pi/3); y(x=0.5, a=2.3)
26
+ x + 1
27
+ -1/4*sqrt(3)*(pi + 2)
28
+ -1.41333351100299
29
+
30
+ Sage example in ./calculus.tex, line 143::
31
+
32
+ sage: x, y, z = var('x, y, z') ; q = x*y + y*z + z*x
33
+ sage: bool(q(x=y, y=z, z=x) == q), bool(q(z=y)(y=x) == 3*x^2)
34
+ (True, True)
35
+
36
+ Sage example in ./calculus.tex, line 155::
37
+
38
+ sage: y, z = var('y, z'); f = x^3 + y^2 + z
39
+ sage: f.substitute(x^3 == y^2, z==1)
40
+ 2*y^2 + 1
41
+
42
+ Sage example in ./calculus.tex, line 176::
43
+
44
+ sage: f(x)=(2*x+1)^3 ; f(-3)
45
+ -125
46
+ sage: f.expand()
47
+ x |--> 8*x^3 + 12*x^2 + 6*x + 1
48
+
49
+ Sage example in ./calculus.tex, line 193::
50
+
51
+ sage: y = var('y'); u = sin(x) + x*cos(y)
52
+ sage: v = u.function(x, y); v
53
+ (x, y) |--> x*cos(y) + sin(x)
54
+ sage: w(x, y) = u; w
55
+ (x, y) |--> x*cos(y) + sin(x)
56
+
57
+ Sage example in ./calculus.tex, line 240::
58
+
59
+ sage: x, y = SR.var('x,y')
60
+ sage: p = (x+y)*(x+1)^2
61
+ sage: p2 = p.expand(); p2
62
+ x^3 + x^2*y + 2*x^2 + 2*x*y + x + y
63
+
64
+ Sage example in ./calculus.tex, line 251::
65
+
66
+ sage: p2.collect(x)
67
+ x^3 + x^2*(y + 2) + x*(2*y + 1) + y
68
+
69
+ Sage example in ./calculus.tex, line 260::
70
+
71
+ sage: ((x+y+sin(x))^2).expand().collect(sin(x))
72
+ x^2 + 2*x*y + y^2 + 2*(x + y)*sin(x) + sin(x)^2
73
+
74
+ Sage example in ./calculus.tex, line 416::
75
+
76
+ sage: (x^x/x).simplify()
77
+ x^(x - 1)
78
+
79
+ Sage example in ./calculus.tex, line 426::
80
+
81
+ sage: f = (e^x-1) / (1+e^(x/2)); f.canonicalize_radical()
82
+ e^(1/2*x) - 1
83
+
84
+ Sage example in ./calculus.tex, line 435::
85
+
86
+ sage: f = cos(x)^6 + sin(x)^6 + 3 * sin(x)^2 * cos(x)^2
87
+ sage: f.simplify_trig()
88
+ 1
89
+
90
+ Sage example in ./calculus.tex, line 447::
91
+
92
+ sage: f = cos(x)^6; f.reduce_trig()
93
+ 1/32*cos(6*x) + 3/16*cos(4*x) + 15/32*cos(2*x) + 5/16
94
+ sage: f = sin(5 * x); f.expand_trig()
95
+ 5*cos(x)^4*sin(x) - 10*cos(x)^2*sin(x)^3 + sin(x)^5
96
+
97
+ Sage example in ./calculus.tex, line 482::
98
+
99
+ sage: n = var('n'); f = factorial(n+1)/factorial(n)
100
+ sage: f.simplify_factorial()
101
+ n + 1
102
+
103
+ Sage example in ./calculus.tex, line 502::
104
+
105
+ sage: f = sqrt(abs(x)^2); f.canonicalize_radical()
106
+ abs(x)
107
+ sage: f = log(x*y); f.canonicalize_radical()
108
+ log(x) + log(y)
109
+
110
+ Sage example in ./calculus.tex, line 592::
111
+
112
+ sage: assume(x > 0); bool(sqrt(x^2) == x)
113
+ True
114
+ sage: forget(x > 0); bool(sqrt(x^2) == x)
115
+ False
116
+ sage: n = var('n'); assume(n, 'integer'); sin(n*pi)
117
+ 0
118
+
119
+ Sage example in ./calculus.tex, line 600::
120
+
121
+ sage: forget(n, 'integer');
122
+
123
+ Sage example in ./calculus.tex, line 690::
124
+
125
+ sage: a = var('a')
126
+ sage: c = (a+1)^2 - (a^2+2*a+1)
127
+
128
+ Sage example in ./calculus.tex, line 700::
129
+
130
+ sage: eq = c * x == 0
131
+
132
+ Sage example in ./calculus.tex, line 707::
133
+
134
+ sage: eq2 = eq / c; eq2
135
+ x == 0
136
+ sage: solve(eq2, x)
137
+ [x == 0]
138
+
139
+ Sage example in ./calculus.tex, line 715::
140
+
141
+ sage: solve(eq, x)
142
+ [x == x]
143
+
144
+ Sage example in ./calculus.tex, line 725::
145
+
146
+ sage: expand(c)
147
+ 0
148
+
149
+ Sage example in ./calculus.tex, line 738::
150
+
151
+ sage: c = cos(a)^2 + sin(a)^2 - 1
152
+ sage: eq = c*x == 0
153
+ sage: solve(eq, x)
154
+ [x == 0]
155
+
156
+ Sage example in ./calculus.tex, line 750::
157
+
158
+ sage: c.simplify_trig()
159
+ 0
160
+ sage: c.is_zero()
161
+ True
162
+
163
+ Sage example in ./calculus.tex, line 839::
164
+
165
+ sage: z, phi = var('z, phi')
166
+ sage: eq = z**2 - 2/cos(phi)*z + 5/cos(phi)**2 - 4 == 0; eq
167
+ z^2 - 2*z/cos(phi) + 5/cos(phi)^2 - 4 == 0
168
+
169
+ Sage example in ./calculus.tex, line 852::
170
+
171
+ sage: eq.lhs()
172
+ z^2 - 2*z/cos(phi) + 5/cos(phi)^2 - 4
173
+ sage: eq.rhs()
174
+ 0
175
+
176
+ Sage example in ./calculus.tex, line 861::
177
+
178
+ sage: solve(eq, z)
179
+ [z == -(2*sqrt(cos(phi)^2 - 1) - 1)/cos(phi),
180
+ z == (2*sqrt(cos(phi)^2 - 1) + 1)/cos(phi)]
181
+
182
+ Sage example in ./calculus.tex, line 871::
183
+
184
+ sage: y = var('y'); solve(y^7==y, y)
185
+ [y == 1/2*I*sqrt(3) + 1/2, y == 1/2*I*sqrt(3) - 1/2, y == -1,
186
+ y == -1/2*I*sqrt(3) - 1/2, y == -1/2*I*sqrt(3) + 1/2, y == 1, y == 0]
187
+
188
+ Sage example in ./calculus.tex, line 880::
189
+
190
+ sage: solve(x^2-1, x, solution_dict=True)
191
+ [{x: -1}, {x: 1}]
192
+
193
+ Sage example in ./calculus.tex, line 894::
194
+
195
+ sage: solve([x+y == 3, 2*x+2*y == 6], x, y)
196
+ [[x == -r1 + 3, y == r1]]
197
+
198
+ Sage example in ./calculus.tex, line 910::
199
+
200
+ sage: solve([cos(x)*sin(x) == 1/2, x+y == 0], x, y)
201
+ [[x == 1/4*pi + pi*z..., y == -1/4*pi - pi*z...]]
202
+
203
+ Sage example in ./calculus.tex, line 920::
204
+
205
+ sage: solve(x^2+x-1 > 0, x)
206
+ [[x < -1/2*sqrt(5) - 1/2], [x > 1/2*sqrt(5) - 1/2]]
207
+
208
+ Sage example in ./calculus.tex, line 943::
209
+
210
+ sage: x, y, z = var('x, y, z')
211
+ sage: solve([x^2 * y * z == 18, x * y^3 * z == 24,\
212
+ ....: x * y * z^4 == 6], x, y, z)
213
+ [[x == 3, y == 2, z == 1],
214
+ [x == (1.3372150673296... - 2.685489874065...*I),
215
+ y == (-1.7004342714592... + 1.0528643257547...*I),
216
+ z == (0.93247222940435... - 0.36124166618715...*I)], ...]
217
+
218
+ Sage example in ./calculus.tex, line 975::
219
+
220
+ sage: expr = sin(x) + sin(2 * x) + sin(3 * x)
221
+ sage: solve(expr, x)
222
+ [sin(3*x) == -sin(2*x) - sin(x)]
223
+
224
+ Sage example in ./calculus.tex, line 983::
225
+
226
+ sage: find_root(expr, 0.1, pi) # abs tol 1e-12
227
+ 2.0943951023931957
228
+
229
+ Sage example in ./calculus.tex, line 989::
230
+
231
+ sage: f = expr.simplify_trig(); f
232
+ 2*(2*cos(x)^2 + cos(x))*sin(x)
233
+ sage: solve(f, x)
234
+ [x == 0, x == 2/3*pi, x == 1/2*pi]
235
+
236
+ Sage example in ./calculus.tex, line 1022::
237
+
238
+ sage: (x^3+2*x+1).roots(x)
239
+ [(-1/2*(1/18*sqrt(59)*sqrt(3) - 1/2)^(1/3)*(I*sqrt(3) + 1)
240
+ - 1/3*(I*sqrt(3) - 1)/(1/18*sqrt(59)*sqrt(3) - 1/2)^(1/3), 1),
241
+ (-1/2*(1/18*sqrt(59)*sqrt(3) - 1/2)^(1/3)*(-I*sqrt(3) + 1)
242
+ - 1/3*(-I*sqrt(3) - 1)/(1/18*sqrt(59)*sqrt(3) - 1/2)^(1/3), 1),
243
+ ((1/18*sqrt(59)*sqrt(3) - 1/2)^(1/3)
244
+ - 2/3/(1/18*sqrt(59)*sqrt(3) - 1/2)^(1/3), 1)]
245
+
246
+ Sage example in ./calculus.tex, line 1058::
247
+
248
+ sage: (x^3+2*x+1).roots(x, ring=RR)
249
+ [(-0.453397651516404, 1)]
250
+
251
+ Sage example in ./calculus.tex, line 1062::
252
+
253
+ sage: (x^3+2*x+1).roots(x, ring=CC)
254
+ [(-0.453397651516404, 1),
255
+ (0.226698825758202 - 1.46771150871022*I, 1),
256
+ (0.226698825758202 + 1.46771150871022*I, 1)]
257
+
258
+ Sage example in ./calculus.tex, line 1086::
259
+
260
+ sage: solve(x^(1/x)==(1/x)^x, x)
261
+ [(1/x)^x == x^(1/x)]
262
+
263
+ Sage example in ./calculus.tex, line 1124::
264
+
265
+ sage: y = function('y')(x)
266
+ sage: desolve(diff(y,x,x) + x*diff(y,x) + y == 0, y, [0,0,1])
267
+ -1/2*I*sqrt(2)*sqrt(pi)*erf(1/2*I*sqrt(2)*x)*e^(-1/2*x^2)
268
+
269
+ Sage example in ./calculus.tex, line 1171::
270
+
271
+ sage: k, n = var('k, n')
272
+ sage: sum(k, k, 1, n).factor()
273
+ 1/2*(n + 1)*n
274
+
275
+ Sage example in ./calculus.tex, line 1179::
276
+
277
+ sage: n, k, y = var('n, k, y')
278
+ sage: sum(binomial(n,k) * x^k * y^(n-k), k, 0, n)
279
+ (x + y)^n
280
+
281
+ Sage example in ./calculus.tex, line 1189::
282
+
283
+ sage: k, n = var('k, n')
284
+ sage: sum(binomial(n,k), k, 0, n),\
285
+ ....: sum(k * binomial(n, k), k, 0, n),\
286
+ ....: sum((-1)^k*binomial(n,k), k, 0, n)
287
+ (2^n, 2^(n - 1)*n, 0)
288
+
289
+ Sage example in ./calculus.tex, line 1199::
290
+
291
+ sage: a, q, k, n = var('a, q, k, n')
292
+ sage: sum(a*q^k, k, 0, n)
293
+ (a*q^(n + 1) - a)/(q - 1)
294
+
295
+ Sage example in ./calculus.tex, line 1212::
296
+
297
+ sage: assume(abs(q) < 1)
298
+ sage: sum(a*q^k, k, 0, infinity)
299
+ -a/(q - 1)
300
+
301
+ Sage example in ./calculus.tex, line 1218::
302
+
303
+ sage: forget(); assume(q > 1); sum(a*q^k, k, 0, infinity)
304
+ Traceback (most recent call last):
305
+ ...
306
+ ValueError: Sum is divergent.
307
+
308
+ Sage example in ./calculus.tex, line 1300::
309
+
310
+ sage: limit((x**(1/3) - 2) / ((x + 19)**(1/3) - 3), x = 8)
311
+ 9/4
312
+ sage: f(x) = (cos(pi/4-x)-tan(x))/(1-sin(pi/4 + x))
313
+ sage: limit(f(x), x = pi/4)
314
+ Infinity
315
+
316
+ Sage example in ./calculus.tex, line 1317::
317
+
318
+ sage: limit(f(x), x = pi/4, dir='minus')
319
+ +Infinity
320
+ sage: limit(f(x), x = pi/4, dir='plus')
321
+ -Infinity
322
+
323
+ Sage example in ./calculus.tex, line 1368::
324
+
325
+ sage: u(n) = n^100 / 100^n
326
+ sage: u(1.);u(2.);u(3.);u(4.);u(5.);u(6.);u(7.);u(8.);u(9.);u(10.)
327
+ 0.0100000000000000
328
+ 1.26765060022823e26
329
+ 5.15377520732011e41
330
+ 1.60693804425899e52
331
+ 7.88860905221012e59
332
+ 6.53318623500071e65
333
+ 3.23447650962476e70
334
+ 2.03703597633449e74
335
+ 2.65613988875875e77
336
+ 1.00000000000000e80
337
+
338
+ Sage example in ./calculus.tex, line 1389::
339
+
340
+ sage: plot(u(x), x, 1, 40)
341
+ Graphics object consisting of 1 graphics primitive
342
+
343
+ Sage example in ./calculus.tex, line 1407::
344
+
345
+ sage: v(x) = diff(u(x), x); sol = solve(v(x) == 0, x); sol
346
+ [x == 50/log(10), x == 0]
347
+ sage: floor(sol[0].rhs())
348
+ 21
349
+
350
+ Sage example in ./calculus.tex, line 1420::
351
+
352
+ sage: limit(u(n), n=infinity)
353
+ 0
354
+ sage: n0 = find_root(u(n) - 1e-8 == 0, 22, 1000); n0
355
+ 105.07496210187252
356
+
357
+ Sage example in ./calculus.tex, line 1502::
358
+
359
+ sage: ((1+arctan(x))^(1/x)).series(x==0, 3)
360
+ (e) + (-1/2*e)*x + (1/8*e)*x^2 + Order(x^3)
361
+
362
+ Sage example in ./calculus.tex, line 1507::
363
+
364
+ sage: (ln(2*sin(x))).series(x==pi/6, 3)
365
+ (sqrt(3))*(-1/6*pi + x) + (-2)*(-1/6*pi + x)^2
366
+ + Order(-1/216*(pi - 6*x)^3)
367
+
368
+ Sage example in ./calculus.tex, line 1520::
369
+
370
+ sage: (ln(2*sin(x))).series(x==pi/6, 3).truncate()
371
+ -1/18*(pi - 6*x)^2 - 1/6*sqrt(3)*(pi - 6*x)
372
+
373
+ Sage example in ./calculus.tex, line 1537::
374
+
375
+ sage: taylor((x**3+x)**(1/3) - (x**3-x)**(1/3), x, infinity, 2)
376
+ 2/3/x
377
+
378
+ Sage example in ./calculus.tex, line 1577::
379
+
380
+ sage: tan(4*arctan(1/5)).simplify_trig()
381
+ 120/119
382
+ sage: tan(pi/4+arctan(1/239)).simplify_trig()
383
+ 120/119
384
+
385
+ Sage example in ./calculus.tex, line 1591::
386
+
387
+ sage: f = arctan(x).series(x, 10); f
388
+ 1*x + (-1/3)*x^3 + 1/5*x^5 + (-1/7)*x^7 + 1/9*x^9 + Order(x^10)
389
+ sage: (16*f.subs(x==1/5) - 4*f.subs(x==1/239)).n(); pi.n()
390
+ 3.14159268240440
391
+ 3.14159265358979
392
+
393
+ Sage example in ./calculus.tex, line 1662::
394
+
395
+ sage: k = var('k')
396
+ sage: sum(1/k^2, k, 1, infinity),\
397
+ ....: sum(1/k^4, k, 1, infinity),\
398
+ ....: sum(1/k^5, k, 1, infinity)
399
+ (1/6*pi^2, 1/90*pi^4, zeta(5))
400
+
401
+ Sage example in ./calculus.tex, line 1689::
402
+
403
+ sage: s = 2*sqrt(2)/9801*(sum((factorial(4*k)) * (1103+26390*k) /
404
+ ....: ((factorial(k)) ^ 4 * 396 ^ (4 * k)) for k in (0..11)))
405
+ sage: (1/s).n(digits=100)
406
+ 3.141592653589793238462643383279502884197169399375105820974...
407
+ sage: (pi-1/s).n(digits=100).n()
408
+ -4.36415445739398e-96
409
+
410
+ Sage example in ./calculus.tex, line 1722::
411
+
412
+ sage: n = var('n'); u = sin(pi*(sqrt(4*n^2+1)-2*n))
413
+ sage: taylor(u, n, infinity, 3)
414
+ 1/4*pi/n - 1/384*(6*pi + pi^3)/n^3
415
+
416
+ Sage example in ./calculus.tex, line 1762::
417
+
418
+ sage: diff(sin(x^2), x)
419
+ 2*x*cos(x^2)
420
+ sage: function('f')(x); function('g')(x); diff(f(g(x)), x)
421
+ f(x)
422
+ g(x)
423
+ D[0](f)(g(x))*diff(g(x), x)
424
+ sage: diff(ln(f(x)), x)
425
+ diff(f(x), x)/f(x)
426
+
427
+ Sage example in ./calculus.tex, line 1780::
428
+
429
+ sage: f(x,y) = x*y + sin(x^2) + e^(-x); derivative(f, x)
430
+ (x, y) |--> 2*x*cos(x^2) + y - e^(-x)
431
+ sage: derivative(f, y)
432
+ (x, y) |--> x
433
+
434
+ Sage example in ./calculus.tex, line 1803::
435
+
436
+ sage: x, y = var('x, y'); f = ln(x**2+y**2) / 2
437
+ sage: delta = diff(f,x,2) + diff(f,y,2)
438
+ sage: delta.simplify_rational()
439
+ 0
440
+
441
+ Sage example in ./calculus.tex, line 1854::
442
+
443
+ sage: sin(x).integral(x, 0, pi/2)
444
+ 1
445
+ sage: integrate(1/(1+x^2), x)
446
+ arctan(x)
447
+ sage: integrate(1/(1+x^2), x, -infinity, infinity)
448
+ pi
449
+ sage: integrate(exp(-x**2), x, 0, infinity)
450
+ 1/2*sqrt(pi)
451
+
452
+ Sage example in ./calculus.tex, line 1864::
453
+
454
+ sage: integrate(exp(-x), x, -infinity, infinity)
455
+ Traceback (most recent call last):
456
+ ...
457
+ ValueError: Integral is divergent.
458
+
459
+ Sage example in ./calculus.tex, line 1878::
460
+
461
+ sage: u = var('u'); f = x * cos(u) / (u^2 + x^2)
462
+ sage: assume(x>0); f.integrate(u, 0, infinity)
463
+ 1/2*pi*e^(-x)
464
+ sage: forget(); assume(x<0); f.integrate(u, 0, infinity)
465
+ -1/2*pi*e^x
466
+
467
+ Sage example in ./calculus.tex, line 1904::
468
+
469
+ sage: integral_numerical(sin(x)/x, 0, 1) # abs tol 1e-12
470
+ (0.946083070367183, 1.0503632079297087e-14)
471
+ sage: g = integrate(exp(-x**2), x, 0, infinity)
472
+ sage: g, g.n() # abs tol 1e-12
473
+ (1/2*sqrt(pi), 0.886226925452758)
474
+ sage: approx = integral_numerical(exp(-x**2), 0, infinity)
475
+ sage: approx # abs tol 1e-12
476
+ (0.8862269254527568, 1.714774436012769e-08)
477
+ sage: approx[0]-g.n() # abs tol 1e-12
478
+ -1.11022302462516e-15
479
+
480
+ Sage example in ./calculus.tex, line 2228::
481
+
482
+ sage: A = matrix(QQ, [[1,2],[3,4]]); A
483
+ [1 2]
484
+ [3 4]
485
+
486
+ Sage example in ./calculus.tex, line 2468::
487
+
488
+ sage: A = matrix(QQ, [[2,4,3],[-4,-6,-3],[3,3,1]])
489
+ sage: A.characteristic_polynomial()
490
+ x^3 + 3*x^2 - 4
491
+ sage: A.eigenvalues()
492
+ [1, -2, -2]
493
+ sage: A.minimal_polynomial().factor()
494
+ (x - 1) * (x + 2)^2
495
+
496
+ Sage example in ./calculus.tex, line 2487::
497
+
498
+ sage: A.eigenvectors_right()
499
+ [(1, [(1, -1, 1)], 1), (-2, [(1, -1, 0)], 2)]
500
+
501
+ Sage example in ./calculus.tex, line 2499::
502
+
503
+ sage: A.jordan_form(transformation=True)
504
+ (
505
+ [ 1| 0 0]
506
+ [--+-----] [ 1 1 1]
507
+ [ 0|-2 1] [-1 -1 0]
508
+ [ 0| 0 -2], [ 1 0 -1]
509
+ )
510
+
511
+ Sage example in ./calculus.tex, line 2533::
512
+
513
+ sage: A = matrix(QQ, [[1,-1/2],[-1/2,-1]])
514
+ sage: A.jordan_form()
515
+ Traceback (most recent call last):
516
+ ...
517
+ RuntimeError: Some eigenvalue does not exist in Rational Field.
518
+
519
+ Sage example in ./calculus.tex, line 2543::
520
+
521
+ sage: A = matrix(QQ, [[1,-1/2],[-1/2,-1]])
522
+ sage: A.minimal_polynomial()
523
+ x^2 - 5/4
524
+
525
+ Sage example in ./calculus.tex, line 2557::
526
+
527
+ sage: R = QQ[sqrt(5)]
528
+ sage: A = A.change_ring(R)
529
+ sage: A.jordan_form(transformation=True, subdivide=False)
530
+ (
531
+ [ 1/2*sqrt5 0] [ 1 1]
532
+ [ 0 -1/2*sqrt5], [-sqrt5 + 2 sqrt5 + 2]
533
+ )
534
+
535
+ Sage example in ./calculus.tex, line 2597::
536
+
537
+ sage: K.<sqrt2> = NumberField(x^2 - 2)
538
+ sage: L.<sqrt3> = K.extension(x^2 - 3)
539
+ sage: A = matrix(L, [[2, sqrt2*sqrt3, sqrt2], \
540
+ ....: [sqrt2*sqrt3, 3, sqrt3], \
541
+ ....: [sqrt2, sqrt3, 1]])
542
+ sage: A.jordan_form(transformation=True)
543
+ (
544
+ [6|0|0]
545
+ [-+-+-]
546
+ [0|0|0] [ 1 1 0]
547
+ [-+-+-] [1/2*sqrt2*sqrt3 0 1]
548
+ [0|0|0], [ 1/2*sqrt2 -sqrt2 -sqrt3]
549
+ )
550
+ """