passagemath-repl 10.5.28__py3-none-any.whl → 10.5.29__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.29.data/data/share/jupyter/kernels/sagemath/kernel.json +1 -0
  2. passagemath_repl-10.5.29.data/data/share/jupyter/kernels/sagemath/logo-64x64.png +0 -0
  3. passagemath_repl-10.5.29.data/data/share/jupyter/kernels/sagemath/logo.svg +352 -0
  4. {passagemath_repl-10.5.28.dist-info → passagemath_repl-10.5.29.dist-info}/METADATA +3 -3
  5. {passagemath_repl-10.5.28.dist-info → passagemath_repl-10.5.29.dist-info}/RECORD +95 -24
  6. {passagemath_repl-10.5.28.dist-info → passagemath_repl-10.5.29.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 +549 -0
  13. sage/tests/books/computational-mathematics-with-sagemath/combinat_doctest.py +1053 -0
  14. sage/tests/books/computational-mathematics-with-sagemath/domaines_doctest.py +443 -0
  15. sage/tests/books/computational-mathematics-with-sagemath/float_doctest.py +477 -0
  16. sage/tests/books/computational-mathematics-with-sagemath/graphique_doctest.py +254 -0
  17. sage/tests/books/computational-mathematics-with-sagemath/graphtheory_doctest.py +418 -0
  18. sage/tests/books/computational-mathematics-with-sagemath/integration_doctest.py +290 -0
  19. sage/tests/books/computational-mathematics-with-sagemath/linalg_doctest.py +454 -0
  20. sage/tests/books/computational-mathematics-with-sagemath/linsolve_doctest.py +421 -0
  21. sage/tests/books/computational-mathematics-with-sagemath/lp_doctest.py +234 -0
  22. sage/tests/books/computational-mathematics-with-sagemath/mpoly_doctest.py +560 -0
  23. sage/tests/books/computational-mathematics-with-sagemath/nonlinear_doctest.py +490 -0
  24. sage/tests/books/computational-mathematics-with-sagemath/numbertheory_doctest.py +155 -0
  25. sage/tests/books/computational-mathematics-with-sagemath/polynomes_doctest.py +405 -0
  26. sage/tests/books/computational-mathematics-with-sagemath/premierspas_doctest.py +180 -0
  27. sage/tests/books/computational-mathematics-with-sagemath/programmation_doctest.py +662 -0
  28. sage/tests/books/computational-mathematics-with-sagemath/recequadiff_doctest.py +392 -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 +264 -0
  31. sage/tests/books/computational-mathematics-with-sagemath/sol/combinat_doctest.py +217 -0
  32. sage/tests/books/computational-mathematics-with-sagemath/sol/domaines_doctest.py +59 -0
  33. sage/tests/books/computational-mathematics-with-sagemath/sol/float_doctest.py +141 -0
  34. sage/tests/books/computational-mathematics-with-sagemath/sol/graphique_doctest.py +105 -0
  35. sage/tests/books/computational-mathematics-with-sagemath/sol/graphtheory_doctest.py +53 -0
  36. sage/tests/books/computational-mathematics-with-sagemath/sol/integration_doctest.py +56 -0
  37. sage/tests/books/computational-mathematics-with-sagemath/sol/linalg_doctest.py +56 -0
  38. sage/tests/books/computational-mathematics-with-sagemath/sol/linsolve_doctest.py +25 -0
  39. sage/tests/books/computational-mathematics-with-sagemath/sol/lp_doctest.py +47 -0
  40. sage/tests/books/computational-mathematics-with-sagemath/sol/mpoly_doctest.py +115 -0
  41. sage/tests/books/computational-mathematics-with-sagemath/sol/nonlinear_doctest.py +111 -0
  42. sage/tests/books/computational-mathematics-with-sagemath/sol/numbertheory_doctest.py +167 -0
  43. sage/tests/books/computational-mathematics-with-sagemath/sol/polynomes_doctest.py +107 -0
  44. sage/tests/books/computational-mathematics-with-sagemath/sol/recequadiff_doctest.py +58 -0
  45. sage/tests/books/judson-abstract-algebra/__init__.py +1 -0
  46. sage/tests/books/judson-abstract-algebra/actions-sage-exercises.py +51 -0
  47. sage/tests/books/judson-abstract-algebra/actions-sage.py +173 -0
  48. sage/tests/books/judson-abstract-algebra/algcodes-sage.py +130 -0
  49. sage/tests/books/judson-abstract-algebra/boolean-sage.py +269 -0
  50. sage/tests/books/judson-abstract-algebra/cosets-sage-exercises.py +87 -0
  51. sage/tests/books/judson-abstract-algebra/cosets-sage.py +170 -0
  52. sage/tests/books/judson-abstract-algebra/crypt-sage.py +151 -0
  53. sage/tests/books/judson-abstract-algebra/cyclic-sage.py +450 -0
  54. sage/tests/books/judson-abstract-algebra/domains-sage.py +163 -0
  55. sage/tests/books/judson-abstract-algebra/fields-sage.py +299 -0
  56. sage/tests/books/judson-abstract-algebra/finite-sage.py +108 -0
  57. sage/tests/books/judson-abstract-algebra/galois-sage.py +484 -0
  58. sage/tests/books/judson-abstract-algebra/groups-sage.py +280 -0
  59. sage/tests/books/judson-abstract-algebra/homomorph-sage-exercises.py +65 -0
  60. sage/tests/books/judson-abstract-algebra/homomorph-sage.py +200 -0
  61. sage/tests/books/judson-abstract-algebra/integers-sage.py +197 -0
  62. sage/tests/books/judson-abstract-algebra/isomorph-sage.py +172 -0
  63. sage/tests/books/judson-abstract-algebra/normal-sage.py +133 -0
  64. sage/tests/books/judson-abstract-algebra/permute-sage.py +319 -0
  65. sage/tests/books/judson-abstract-algebra/poly-sage.py +300 -0
  66. sage/tests/books/judson-abstract-algebra/rings-sage.py +413 -0
  67. sage/tests/books/judson-abstract-algebra/sets-sage.py +163 -0
  68. sage/tests/books/judson-abstract-algebra/struct-sage.py +63 -0
  69. sage/tests/books/judson-abstract-algebra/sylow-sage.py +250 -0
  70. sage/tests/books/judson-abstract-algebra/vect-sage-exercises.py +48 -0
  71. sage/tests/books/judson-abstract-algebra/vect-sage.py +211 -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.29.data}/scripts/sage-cachegrind +0 -0
  79. {passagemath_repl-10.5.28.data → passagemath_repl-10.5.29.data}/scripts/sage-callgrind +0 -0
  80. {passagemath_repl-10.5.28.data → passagemath_repl-10.5.29.data}/scripts/sage-cleaner +0 -0
  81. {passagemath_repl-10.5.28.data → passagemath_repl-10.5.29.data}/scripts/sage-coverage +0 -0
  82. {passagemath_repl-10.5.28.data → passagemath_repl-10.5.29.data}/scripts/sage-eval +0 -0
  83. {passagemath_repl-10.5.28.data → passagemath_repl-10.5.29.data}/scripts/sage-fixdoctests +0 -0
  84. {passagemath_repl-10.5.28.data → passagemath_repl-10.5.29.data}/scripts/sage-inline-fortran +0 -0
  85. {passagemath_repl-10.5.28.data → passagemath_repl-10.5.29.data}/scripts/sage-ipynb2rst +0 -0
  86. {passagemath_repl-10.5.28.data → passagemath_repl-10.5.29.data}/scripts/sage-ipython +0 -0
  87. {passagemath_repl-10.5.28.data → passagemath_repl-10.5.29.data}/scripts/sage-massif +0 -0
  88. {passagemath_repl-10.5.28.data → passagemath_repl-10.5.29.data}/scripts/sage-notebook +0 -0
  89. {passagemath_repl-10.5.28.data → passagemath_repl-10.5.29.data}/scripts/sage-omega +0 -0
  90. {passagemath_repl-10.5.28.data → passagemath_repl-10.5.29.data}/scripts/sage-preparse +0 -0
  91. {passagemath_repl-10.5.28.data → passagemath_repl-10.5.29.data}/scripts/sage-run +0 -0
  92. {passagemath_repl-10.5.28.data → passagemath_repl-10.5.29.data}/scripts/sage-run-cython +0 -0
  93. {passagemath_repl-10.5.28.data → passagemath_repl-10.5.29.data}/scripts/sage-runtests +0 -0
  94. {passagemath_repl-10.5.28.data → passagemath_repl-10.5.29.data}/scripts/sage-startuptime.py +0 -0
  95. {passagemath_repl-10.5.28.data → passagemath_repl-10.5.29.data}/scripts/sage-valgrind +0 -0
  96. {passagemath_repl-10.5.28.dist-info → passagemath_repl-10.5.29.dist-info}/WHEEL +0 -0
@@ -0,0 +1,392 @@
1
+ # sage_setup: distribution = sagemath-repl
2
+ """
3
+ This file (./recequadiff_doctest.sage) was *autogenerated* from ./recequadiff.tex,
4
+ with sagetex.sty version 2011/05/27 v2.3.1.
5
+ It contains the contents of all the sageexample environments from this file.
6
+ You should be able to doctest this file with:
7
+ sage -t ./recequadiff_doctest.sage
8
+ It is always safe to delete this file; it is not used in typesetting your
9
+ document.
10
+
11
+ Sage example in ./recequadiff.tex, line 182::
12
+
13
+ sage: x = var('x')
14
+ sage: y = function('y')(x)
15
+
16
+ Sage example in ./recequadiff.tex, line 295::
17
+
18
+ sage: x = var('x'); y = function('y')(x)
19
+
20
+ Sage example in ./recequadiff.tex, line 298::
21
+
22
+ sage: desolve(diff(y,x) + 3*y == exp(x), y, show_method=True)
23
+ [1/4*(4*_C + e^(4*x))*e^(-3*x), 'linear']
24
+
25
+ Sage example in ./recequadiff.tex, line 320::
26
+
27
+ sage: desolve(y*diff(y,x) == x, y, show_method=True)
28
+ [1/2*y(x)^2 == 1/2*x^2 + _C, 'separable']
29
+
30
+ Sage example in ./recequadiff.tex, line 332::
31
+
32
+ sage: desolve(diff(y,x) == exp(x+y), y, show_method=True)
33
+ [-(e^(x + y(x)) + 1)*e^(-y(x)) == _C, 'exact']
34
+
35
+ Sage example in ./recequadiff.tex, line 350::
36
+
37
+ sage: desolve(diff(y,x)-y == x*y^4, y, show_method=True)
38
+ [e^x/(-1/3*(3*x - 1)*e^(3*x) + _C)^(1/3), 'bernoulli']
39
+
40
+ Sage example in ./recequadiff.tex, line 371::
41
+
42
+ sage: desolve(x^2*diff(y,x) == y^2+x*y+x^2, y, show_method=True)
43
+ [_C*x == e^(arctan(y(x)/x)), 'homogeneous']
44
+
45
+ Sage example in ./recequadiff.tex, line 399::
46
+
47
+ sage: desolve(diff(y,x) == (cos(y)-2*x)/(y+x*sin(y)), y,
48
+ ....: show_method=True)
49
+ [x^2 - x*cos(y(x)) + 1/2*y(x)^2 == _C, 'exact']
50
+
51
+ Sage example in ./recequadiff.tex, line 431::
52
+
53
+ sage: desolve(diff(y,x) == x*y^2+y/x-1/x^2, y,
54
+ ....: contrib_ode=True, show_method=True)[1]
55
+ 'riccati'
56
+
57
+ Sage example in ./recequadiff.tex, line 459::
58
+
59
+ sage: diffeq = y == x*diff(y,x)-diff(y,x)^2
60
+ sage: solution,method = desolve(diffeq,
61
+ ....: y,
62
+ ....: contrib_ode=True,
63
+ ....: show_method=True)
64
+ sage: solution
65
+ [y(x) == -_C^2 + _C*x, y(x) == 1/4*x^2]
66
+ sage: method in ["clairaut", "clairault"]
67
+ True
68
+
69
+ Sage example in ./recequadiff.tex, line 487::
70
+
71
+ sage: x = var('x'); y = function('y')(x)
72
+
73
+ Sage example in ./recequadiff.tex, line 491::
74
+
75
+ sage: DE = diff(y,x)+2*y == x**2-2*x+3
76
+ sage: desolve(DE, y)
77
+ 1/4*((2*x^2 - 2*x + 1)*e^(2*x) - 2*(2*x - 1)*e^(2*x) + 4*_C
78
+ + 6*e^(2*x))*e^(-2*x)
79
+
80
+ Sage example in ./recequadiff.tex, line 499::
81
+
82
+ sage: desolve(DE, y).expand()
83
+ 1/2*x^2 + _C*e^(-2*x) - 3/2*x + 9/4
84
+
85
+ Sage example in ./recequadiff.tex, line 518::
86
+
87
+ sage: desolve(DE, y, show_method=True)[1]
88
+ 'linear'
89
+
90
+ Sage example in ./recequadiff.tex, line 526::
91
+
92
+ sage: desolve(DE, y, ics=[0,1]).expand()
93
+ 1/2*x^2 - 3/2*x - 5/4*e^(-2*x) + 9/4
94
+
95
+ Sage example in ./recequadiff.tex, line 541::
96
+
97
+ sage: x = var('x'); y = function('y')(x)
98
+ sage: desolve(diff(y,x)*log(y) == y*sin(x), y, show_method=True)
99
+ [1/2*log(y(x))^2 == _C - cos(x), 'separable']
100
+
101
+ Sage example in ./recequadiff.tex, line 552::
102
+
103
+ sage: ed = desolve(diff(y,x)*log(y) == y*sin(x), y); ed
104
+ 1/2*log(y(x))^2 == _C - cos(x)
105
+
106
+ Sage example in ./recequadiff.tex, line 565::
107
+
108
+ sage: solve(ed, y)
109
+ [y(x) == e^(-sqrt(2*_C - 2*cos(x))), y(x) == e^(sqrt(2*_C - 2*cos(x)))]
110
+
111
+ Sage example in ./recequadiff.tex, line 581::
112
+
113
+ sage: solve(ed, y)[0].substitute(_C==5).rhs()
114
+ Traceback (most recent call last):
115
+ ...
116
+ NameError: name '_C' is not defined
117
+
118
+ Sage example in ./recequadiff.tex, line 593::
119
+
120
+ sage: ed.variables()
121
+ (_C, x)
122
+
123
+ Sage example in ./recequadiff.tex, line 604::
124
+
125
+ sage: c = ed.variables()[0]
126
+ sage: solve(ed, y)[0].substitute(c == 5).rhs()
127
+ e^(-sqrt(-2*cos(x) + 10))
128
+
129
+ Sage example in ./recequadiff.tex, line 624::
130
+
131
+ sage: plot(solve(ed, y)[0].substitute(c == 2).rhs(), x, -3, 3)
132
+ Graphics object consisting of 1 graphics primitive
133
+
134
+ Sage example in ./recequadiff.tex, line 640::
135
+
136
+ sage: P = Graphics()
137
+ sage: for k in range(1,20,2):
138
+ ....: P += plot(solve(ed, y)[0].substitute(c==1+k/4).rhs(), x, -3, 3)
139
+
140
+ Sage example in ./recequadiff.tex, line 660::
141
+
142
+ sage: P = Graphics()
143
+ sage: for j in [0,1]:
144
+ ....: for k in range(1,10,2):
145
+ ....: f = solve(ed,y)[j].substitute(c==2+0.25*k).rhs()
146
+ ....: P += plot(f, x, -3, 3)
147
+ sage: P
148
+ Graphics object consisting of 10 graphics primitives
149
+
150
+ Sage example in ./recequadiff.tex, line 731::
151
+
152
+ sage: u = function('u')(x)
153
+ sage: y = x*u
154
+ sage: DE = x*diff(y,x) == y + sqrt(x**2 + y**2)
155
+
156
+ Sage example in ./recequadiff.tex, line 746::
157
+
158
+ sage: forget()
159
+
160
+ Sage example in ./recequadiff.tex, line 750::
161
+
162
+ sage: assume(x>0)
163
+ sage: desolve(DE, u)
164
+ x == _C*e^arcsinh(u(x))
165
+
166
+ Sage example in ./recequadiff.tex, line 773::
167
+
168
+ sage: S = desolve(DE,u)._maxima_().ev(logarc=True).sage().solve(u); S
169
+ [u(x) == -(sqrt(u(x)^2 + 1)*_C - x)/_C]
170
+
171
+ Sage example in ./recequadiff.tex, line 792::
172
+
173
+ sage: solu = (x-S[0]*c)^2; solu
174
+ (_C*u(x) - x)^2 == (u(x)^2 + 1)*_C^2
175
+ sage: sol = solu.solve(u); sol
176
+ [u(x) == -1/2*(_C^2 - x^2)/(_C*x)]
177
+
178
+ Sage example in ./recequadiff.tex, line 801::
179
+
180
+ sage: y(x) = x*sol[0].rhs(); y(x)
181
+ -1/2*(_C^2 - x^2)/_C
182
+
183
+ Sage example in ./recequadiff.tex, line 820::
184
+
185
+ sage: c = y(x).variables()[0]
186
+ sage: P = Graphics()
187
+ sage: for k in range(-19,19,2):
188
+ ....: P += plot(y(x).substitute(c == 1/k), x, 0, 3)
189
+ sage: P
190
+ Graphics object consisting of 19 graphics primitives
191
+
192
+ Sage example in ./recequadiff.tex, line 870::
193
+
194
+ sage: x = var('x'); y = function('y')(x); a, b = var('a, b')
195
+ sage: DE = diff(y,x) - a*y == -b*y**2
196
+ sage: sol = desolve(DE,[y,x]); sol
197
+ -(log(b*y(x) - a) - log(y(x)))/a == _C + x
198
+
199
+ Sage example in ./recequadiff.tex, line 880::
200
+
201
+ sage: Sol = solve(sol, y)[0]; Sol
202
+ log(y(x)) == _C*a + a*x + log(b*y(x) - a)
203
+
204
+ Sage example in ./recequadiff.tex, line 892::
205
+
206
+ sage: Sol(x) = Sol.lhs()-Sol.rhs(); Sol(x)
207
+ -_C*a - a*x - log(b*y(x) - a) + log(y(x))
208
+ sage: Sol = Sol.simplify_log(); Sol(x)
209
+ -_C*a - a*x + log(y(x)/(b*y(x) - a))
210
+ sage: solve(Sol, y)[0].simplify()
211
+ y(x) == a*e^(_C*a + a*x)/(b*e^(_C*a + a*x) - 1)
212
+
213
+ Sage example in ./recequadiff.tex, line 928::
214
+
215
+ sage: x = var('x'); y = function('y')(x)
216
+ sage: DE = diff(y,x,2)+3*y == x^2-7*x+31
217
+ sage: desolve(DE, y).expand()
218
+ 1/3*x^2 + _K2*cos(sqrt(3)*x) + _K1*sin(sqrt(3)*x) - 7/3*x + 91/9
219
+
220
+ Sage example in ./recequadiff.tex, line 938::
221
+
222
+ sage: desolve(DE, y, ics=[0,1,2]).expand()
223
+ 1/3*x^2 + 13/9*sqrt(3)*sin(sqrt(3)*x) - 7/3*x - 82/9*cos(sqrt(3)*x) + 91/9
224
+
225
+ Sage example in ./recequadiff.tex, line 948::
226
+
227
+ sage: desolve(DE, y, ics=[0,1,-1,0]).expand()
228
+ 1/3*x^2 - 7/3*x - 82/9*cos(sqrt(3))*sin(sqrt(3)*x)/sin(sqrt(3))
229
+ + 115/9*sin(sqrt(3)*x)/sin(sqrt(3)) - 82/9*cos(sqrt(3)*x) + 91/9
230
+
231
+ Sage example in ./recequadiff.tex, line 1022::
232
+
233
+ sage: x, t = var('x, t'); f = function('f')(x); g = function('g')(t)
234
+ sage: z = f*g
235
+ sage: eq(x,t) = diff(z,x,2) == diff(z,t); eq(x,t)
236
+ g(t)*diff(f(x), x, x) == f(x)*diff(g(t), t)
237
+
238
+ Sage example in ./recequadiff.tex, line 1042::
239
+
240
+ sage: eqn = eq/z; eqn(x,t)
241
+ diff(f(x), x, x)/f(x) == diff(g(t), t)/g(t)
242
+
243
+ Sage example in ./recequadiff.tex, line 1061::
244
+
245
+ sage: k = var('k')
246
+ sage: eq1(x,t) = eqn(x,t).lhs() == k; eq2(x,t) = eqn(x,t).rhs() == k
247
+
248
+ Sage example in ./recequadiff.tex, line 1069::
249
+
250
+ sage: g(t) = desolve(eq2(x,t),[g,t]); g(t)
251
+ _C*e^(k*t)
252
+
253
+ Sage example in ./recequadiff.tex, line 1092::
254
+
255
+ sage: assume(k>0); desolve(eq1,[f,x])
256
+ _K1*e^(sqrt(k)*x) + _K2*e^(-sqrt(k)*x)
257
+
258
+ Sage example in ./recequadiff.tex, line 1176::
259
+
260
+ sage: x, s = var('x, s'); f = function('f')(x)
261
+ sage: f(x) = sin(x); f.laplace(x,s)
262
+ x |--> 1/(s^2 + 1)
263
+
264
+ Sage example in ./recequadiff.tex, line 1191::
265
+
266
+ sage: X(s) = 1/(s^2-3*s-4)/(s^2+1) + (s-4)/(s^2-3*s-4)
267
+ sage: X(s).inverse_laplace(s, x)
268
+ 3/34*cos(x) + 1/85*e^(4*x) + 9/10*e^(-x) - 5/34*sin(x)
269
+
270
+ Sage example in ./recequadiff.tex, line 1206::
271
+
272
+ sage: X(s).partial_fraction()
273
+ 1/34*(3*s - 5)/(s^2 + 1) + 9/10/(s + 1) + 1/85/(s - 4)
274
+
275
+ Sage example in ./recequadiff.tex, line 1221::
276
+
277
+ sage: x = var('x'); y = function('y')(x)
278
+ sage: eq = diff(y,x,x) - 3*diff(y,x) - 4*y - sin(x) == 0
279
+ sage: desolve_laplace(eq, y)
280
+ 1/85*(17*y(0) + 17*D[0](y)(0) + 1)*e^(4*x) + 1/10*(8*y(0)
281
+ - 2*D[0](y)(0) - 1)*e^(-x) + 3/34*cos(x) - 5/34*sin(x)
282
+ sage: desolve_laplace(eq, y, ics=[0,1,-1])
283
+ 3/34*cos(x) + 1/85*e^(4*x) + 9/10*e^(-x) - 5/34*sin(x)
284
+
285
+ Sage example in ./recequadiff.tex, line 1279::
286
+
287
+ sage: x = var('x'); y1 = function('y1')(x)
288
+ sage: y2 = function('y2')(x); y3 = function('y3')(x)
289
+ sage: y = vector([y1, y2, y3])
290
+ sage: A = matrix([[2,-2,0],[-2,0,2],[0,2,2]])
291
+ sage: system = [diff(y[i], x) - (A * y)[i] for i in range(3)]
292
+ sage: desolve_system(system, [y1, y2, y3], ics=[0,2,1,-2])
293
+ [y1(x) == e^(4*x) + e^(-2*x),
294
+ y2(x) == -e^(4*x) + 2*e^(-2*x),
295
+ y3(x) == -e^(4*x) - e^(-2*x)]
296
+
297
+ Sage example in ./recequadiff.tex, line 1328::
298
+
299
+ sage: x = var('x'); y1 = function('y1')(x); y2 = function('y2')(x)
300
+ sage: y = vector([y1,y2])
301
+ sage: A = matrix([[3,-4],[1,3]])
302
+ sage: system = [diff(y[i], x) - (A * y)[i] for i in range(2)]
303
+ sage: desolve_system(system, [y1, y2], ics=[0,2,0])
304
+ [y1(x) == 2*cos(2*x)*e^(3*x), y2(x) == e^(3*x)*sin(2*x)]
305
+
306
+ Sage example in ./recequadiff.tex, line 1385::
307
+
308
+ sage: x = var('x'); u1 = function('u1')(x); u2 = function('u2')(x)
309
+ sage: u3 = function('u3')(x); u4 = function('u4')(x)
310
+ sage: u = vector([u1,u2,u3,u4])
311
+ sage: A = matrix([[0,0,1,0],[0,0,0,1],[2,-6,1,3],[-2,6,1,-1]])
312
+ sage: system = [diff(u[i], x) - (A*u)[i] for i in range(4)]
313
+ sage: sol = desolve_system(system, [u1, u2, u3, u4])
314
+
315
+ Sage example in ./recequadiff.tex, line 1399::
316
+
317
+ sage: sol[0]
318
+ u1(x) == 1/12*(2*u1(0) - 6*u2(0) + 5*u3(0) + 3*u4(0))*e^(2*x)
319
+ + 1/24*(2*u1(0) - 6*u2(0) - u3(0) + 3*u4(0))*e^(-4*x) + 3/4*u1(0)
320
+ + 3/4*u2(0) - 3/8*u3(0) - 3/8*u4(0)
321
+ sage: sol[1]
322
+ u2(x) == -1/12*(2*u1(0) - 6*u2(0) - u3(0) - 3*u4(0))*e^(2*x)
323
+ - 1/24*(2*u1(0) - 6*u2(0) - u3(0) + 3*u4(0))*e^(-4*x) + 1/4*u1(0)
324
+ + 1/4*u2(0) - 1/8*u3(0) - 1/8*u4(0)
325
+
326
+ Sage example in ./recequadiff.tex, line 1557::
327
+
328
+ sage: x = var('x'); f = function('f')(x)
329
+ sage: f(x) = 3.83*x*(1 - x/100000)
330
+ sage: def u(n):
331
+ ....: if n==0: return(20000)
332
+ ....: else: return f(u(n-1))
333
+
334
+ Sage example in ./recequadiff.tex, line 1568::
335
+
336
+ sage: def v(n):
337
+ ....: V = 20000;
338
+ ....: for k in [1..n]:
339
+ ....: V = f(V)
340
+ ....: return V
341
+
342
+ Sage example in ./recequadiff.tex, line 1582::
343
+
344
+ sage: def cloud(u, n):
345
+ ....: L = [[0,u(0)]];
346
+ ....: for k in [1..n]:
347
+ ....: L += [[k,u(k)]]
348
+ ....: points(L).show()
349
+
350
+ Sage example in ./recequadiff.tex, line 1598::
351
+
352
+ sage: cloud(u,50)
353
+
354
+ Sage example in ./recequadiff.tex, line 1619::
355
+
356
+ sage: def snail(f, x, u0, n, xmin, xmax):
357
+ ....: u = u0
358
+ ....: P = plot(x, x, xmin, xmax, color='gray')
359
+ ....: for i in range(n):
360
+ ....: P += line([[u,u],[u,f(u)],[f(u),f(u)]], color = 'red')
361
+ ....: u = f(u)
362
+ ....: P += f.plot(x, xmin, xmax, color='blue')
363
+ ....: P.show()
364
+
365
+ Sage example in ./recequadiff.tex, line 1637::
366
+
367
+ sage: f(x) = 3.83*x*(1 - x/100000)
368
+ sage: snail(f,x,20000,100,0,100000)
369
+
370
+ Sage example in ./recequadiff.tex, line 1687::
371
+
372
+ sage: from sympy import Function
373
+ sage: from sympy.abc import n
374
+ sage: u = Function('u')
375
+
376
+ Sage example in ./recequadiff.tex, line 1700::
377
+
378
+ sage: f = u(n+2)-(3/2)*u(n+1)+(1/2)*u(n)
379
+
380
+ Sage example in ./recequadiff.tex, line 1707::
381
+
382
+ sage: from sympy import rsolve
383
+ sage: rsolve(f, u(n), {u(0):-1,u(1):1}) == 3 - 4*2**(-n)
384
+ True
385
+
386
+ Sage example in ./recequadiff.tex, line 1798::
387
+
388
+ sage: from sympy import rsolve_hyper
389
+ sage: from sympy.abc import n
390
+ sage: rsolve_hyper([-2,1],2**(n+2),n)
391
+ 2**n*C0 + 2**(n + 1)*n
392
+ """
@@ -0,0 +1 @@
1
+ # sage_setup: distribution = sagemath-repl
@@ -0,0 +1,264 @@
1
+ # sage_setup: distribution = sagemath-repl
2
+ """
3
+ This file (./sol/calculus_doctest.sage) was *autogenerated* from ./sol/calculus.tex,
4
+ with sagetex.sty version 2011/05/27 v2.3.1.
5
+ It contains the contents of all the sageexample environments from this file.
6
+ You should be able to doctest this file with:
7
+ sage -t ./sol/calculus_doctest.sage
8
+ It is always safe to delete this file; it is not used in typesetting your
9
+ document.
10
+
11
+ Sage example in ./sol/calculus.tex, line 3::
12
+
13
+ sage: reset()
14
+
15
+ Sage example in ./sol/calculus.tex, line 10::
16
+
17
+ sage: n = var('n'); pmax = 4; s = [n + 1]
18
+ sage: for p in [1..pmax]:
19
+ ....: s += [factor(((n+1)^(p+1) - sum(binomial(p+1, j) * s[j]
20
+ ....: for j in [0..p-1])) / (p+1))]
21
+ sage: s
22
+ [n + 1,
23
+ 1/2*(n + 1)*n,
24
+ 1/6*(2*n + 1)*(n + 1)*n,
25
+ 1/4*(n + 1)^2*n^2,
26
+ 1/30*(3*n^2 + 3*n - 1)*(2*n + 1)*(n + 1)*n]
27
+
28
+ Sage example in ./sol/calculus.tex, line 42::
29
+
30
+ sage: x, h, a = var('x, h, a'); f = function('f')
31
+ sage: g(x) = taylor(f(x), x, a, 3)
32
+ sage: phi(h) = (g(a+3*h) - 3*g(a+2*h) + 3*g(a+h) - g(a)) / h^3; phi(h)
33
+ diff(f(a), a, a, a)
34
+
35
+ Sage example in ./sol/calculus.tex, line 75::
36
+
37
+ sage: n = 7; x, h, a = var('x h a'); f = function('f')
38
+ sage: g(x) = taylor(f(x), x, a, n)
39
+ sage: sum((-1)^(n-k) * binomial(n,k) * g(a+k*h) for k in (0..n)) / h^n
40
+ diff(f(a), a, a, a, a, a, a, a)
41
+
42
+ Sage example in ./sol/calculus.tex, line 100::
43
+
44
+ sage: theta = 12*arctan(1/38) + 20*arctan(1/57) \
45
+ ....: + 7*arctan(1/239) + 24*arctan(1/268)
46
+ sage: tan(theta).trig_expand().trig_simplify()
47
+ 1
48
+
49
+ Sage example in ./sol/calculus.tex, line 110::
50
+
51
+ sage: 12*(1/38) + 20*(1/57) + 7*(1/239) + 24*(1/268)
52
+ 37735/48039
53
+
54
+ Sage example in ./sol/calculus.tex, line 135::
55
+
56
+ sage: x = var('x'); f(x) = taylor(arctan(x), x, 0, 21)
57
+ sage: approx = 4 * (12 * f(1/38) + 20 * f(1/57)
58
+ ....: + 7 * f(1/239) + 24 * f(1/268))
59
+ sage: approx.n(digits = 50); pi.n(digits = 50)
60
+ 3.1415926535897932384626433832795028851616168852864
61
+ 3.1415926535897932384626433832795028841971693993751
62
+ sage: approx.n(digits = 50) - pi.n(digits = 50)
63
+ 9.6444748591132486785420917537404705292978817080880e-37
64
+
65
+ Sage example in ./sol/calculus.tex, line 182::
66
+
67
+ sage: n = var('n'); phi = lambda x: n*pi + pi/2 - arctan(1/x)
68
+ sage: x = n*pi
69
+ sage: for i in range(4):
70
+ ....: x = taylor(phi(x), n, infinity, 2*i); x
71
+ 1/2*pi + pi*n
72
+ 1/2*pi + pi*n - 1/(pi*n) + 1/2/(pi*n^2)
73
+ 1/2*pi + pi*n - 1/(pi*n) + 1/2/(pi*n^2)
74
+ - 1/12*(3*pi^2 + 8)/(pi^3*n^3) + 1/8*(pi^2 + 8)/(pi^3*n^4)
75
+ 1/2*pi + pi*n - 1/(pi*n) + 1/2/(pi*n^2)
76
+ - 1/12*(3*pi^2 + 8)/(pi^3*n^3) + 1/8*(pi^2 + 8)/(pi^3*n^4)
77
+ - 1/240*(15*pi^4 + 240*pi^2 + 208)/(pi^5*n^5)
78
+ + 1/96*(3*pi^4 + 80*pi^2 + 208)/(pi^5*n^6)
79
+
80
+ Sage example in ./sol/calculus.tex, line 239::
81
+
82
+ sage: h = var('h'); f(x, y) = x * y * (x^2 - y^2) / (x^2 + y^2)
83
+ sage: D1f(x, y) = diff(f(x,y), x); limit((D1f(0,h) - 0) / h, h=0)
84
+ -1
85
+ sage: D2f(x, y) = diff(f(x,y), y); limit((D2f(h,0) - 0) / h, h=0)
86
+ 1
87
+ sage: g = plot3d(f(x, y), (x, -3, 3), (y, -3, 3))
88
+
89
+ Sage example in ./sol/calculus.tex, line 285::
90
+
91
+ sage: n, t = var('n, t')
92
+ sage: v(n) = (4/(8*n+1)-2/(8*n+4)-1/(8*n+5)-1/(8*n+6))*1/16^n
93
+ sage: assume(8*n+1>0)
94
+ sage: f(t) = 4*sqrt(2)-8*t^3-4*sqrt(2)*t^4-8*t^5
95
+ sage: u(n) = integrate(f(t) * t^(8*n), t, 0, 1/sqrt(2))
96
+ sage: (u(n)-v(n)).canonicalize_radical()
97
+ 0
98
+
99
+ Sage example in ./sol/calculus.tex, line 317::
100
+
101
+ sage: t = var('t'); J = integrate(f(t) / (1-t^8), t, 0, 1/sqrt(2))
102
+ sage: J.canonicalize_radical()
103
+ pi + 2*log(sqrt(2) + 1) + 2*log(sqrt(2) - 1)
104
+
105
+ Sage example in ./sol/calculus.tex, line 325::
106
+
107
+ sage: J.simplify_log().canonicalize_radical()
108
+ pi
109
+
110
+ Sage example in ./sol/calculus.tex, line 337::
111
+
112
+ sage: l = sum(v(n) for n in (0..40)); l.n(digits=60)
113
+ 3.14159265358979323846264338327950288419716939937510581474759
114
+ sage: pi.n(digits=60)
115
+ 3.14159265358979323846264338327950288419716939937510582097494
116
+ sage: print("%e" % (l-pi).n(digits=60))
117
+ -6.227358e-54
118
+
119
+ Sage example in ./sol/calculus.tex, line 369::
120
+
121
+ sage: x = var('x'); ps = lambda f, g : integral(f * g, x, -pi, pi)
122
+ sage: n = 5; a = var('a0, a1, a2, a3, a4, a5')
123
+ sage: P = sum(a[k] * x^k for k in (0..n))
124
+ sage: equ = [ps(P - sin(x), x^k) for k in (0..n)]
125
+ sage: sol = solve(equ, a)
126
+ sage: P = sum(sol[0][k].rhs() * x^k for k in (0..n)); P
127
+ 105/8*(pi^4 - 153*pi^2 + 1485)*x/pi^6 - 315/4*(pi^4 - 125*pi^2 +
128
+ 1155)*x^3/pi^8 + 693/8*(pi^4 - 105*pi^2 + 945)*x^5/pi^10
129
+ sage: g = plot(P,x,-6,6,color='red') + plot(sin(x),x,-6,6,color='blue')
130
+ sage: g.show(ymin = -1.5, ymax = 1.5)
131
+
132
+ Sage example in ./sol/calculus.tex, line 430::
133
+
134
+ sage: p, e = var('p, e')
135
+ sage: theta1, theta2, theta3 = var('theta1, theta2, theta3')
136
+ sage: r(theta) = p / (1 - e * cos(theta))
137
+ sage: r1 = r(theta1); r2 = r(theta2); r3 = r(theta3)
138
+ sage: R1 = vector([r1 * cos(theta1), r1 * sin(theta1), 0])
139
+ sage: R2 = vector([r2 * cos(theta2), r2 * sin(theta2), 0])
140
+ sage: R3 = vector([r3 * cos(theta3), r3 * sin(theta3), 0])
141
+
142
+ Sage example in ./sol/calculus.tex, line 446::
143
+
144
+ sage: D = R1.cross_product(R2)+R2.cross_product(R3)+R3.cross_product(R1)
145
+ sage: S = (r1 - r3) * R2 + (r3 - r2) * R1 + (r2 - r1) * R3
146
+ sage: i = vector([1, 0, 0]); V = S + e * i.cross_product(D)
147
+ sage: V.simplify_full()
148
+ (0, 0, 0)
149
+
150
+ Sage example in ./sol/calculus.tex, line 466::
151
+
152
+ sage: S.cross_product(D).simplify_full()[1:3]
153
+ (0, 0)
154
+
155
+ Sage example in ./sol/calculus.tex, line 479::
156
+
157
+ sage: N = r3 * R1.cross_product(R2) + r1 * R2.cross_product(R3)\
158
+ ....: + r2 * R3.cross_product(R1)
159
+ sage: W = p * S + e * i.cross_product(N)
160
+ sage: W.simplify_full()
161
+ (0, 0, 0)
162
+
163
+ Sage example in ./sol/calculus.tex, line 504::
164
+
165
+ sage: R1=vector([0,1,0]); R2=vector([2,2,0]); R3=vector([3.5,0,0])
166
+ sage: r1 = R1.norm(); r2 = R2.norm(); r3 = R3.norm()
167
+ sage: D = R1.cross_product(R2) + R2.cross_product(R3) \
168
+ ....: + R3.cross_product(R1)
169
+ sage: S = (r1 - r3) * R2 + (r3 - r2) * R1 + (r2 - r1) * R3
170
+ sage: N = r3 * R1.cross_product(R2) + r1 * R2.cross_product(R3) \
171
+ ....: + r2 * R3.cross_product(R1)
172
+ sage: e = S.norm() / D.norm(); p = N.norm() / D.norm()
173
+ sage: a = p/(1-e^2); c = a * e; b = sqrt(a^2 - c^2)
174
+ sage: X = S.cross_product(D); i = X / X.norm()
175
+ sage: phi = atan2(i[1], i[0]) * 180 / pi.n()
176
+ sage: print("%.3f %.3f %.3f %.3f %.3f %.3f" % (a, b, c, e, p, phi))
177
+ 2.360 1.326 1.952 0.827 0.746 17.917
178
+
179
+ Sage example in ./sol/calculus.tex, line 544::
180
+
181
+ sage: A = matrix(QQ, [[ 2, -3, 2, -12, 33],
182
+ ....: [ 6, 1, 26, -16, 69],
183
+ ....: [10, -29, -18, -53, 32],
184
+ ....: [ 2, 0, 8, -18, 84]])
185
+ sage: A.right_kernel()
186
+ Vector space of degree 5 and dimension 2 over Rational Field
187
+ Basis matrix:
188
+ [ 1 0 -7/34 5/17 1/17]
189
+ [ 0 1 -3/34 -10/17 -2/17]
190
+
191
+ Sage example in ./sol/calculus.tex, line 571::
192
+
193
+ sage: H = A.echelon_form(); H
194
+ [ 1 0 4 0 -3]
195
+ [ 0 1 2 0 7]
196
+ [ 0 0 0 1 -5]
197
+ [ 0 0 0 0 0]
198
+
199
+ Sage example in ./sol/calculus.tex, line 608::
200
+
201
+ sage: A.column_space()
202
+ Vector space of degree 4 and dimension 3 over Rational Field
203
+ Basis matrix:
204
+ [ 1 0 0 1139/350]
205
+ [ 0 1 0 -9/50]
206
+ [ 0 0 1 -12/35]
207
+
208
+ Sage example in ./sol/calculus.tex, line 624::
209
+
210
+ sage: S.<x, y, z, t> = QQ[]
211
+ sage: C = matrix(S, 4, 1, [x, y, z, t])
212
+ sage: B = block_matrix([A, C], ncols=2)
213
+ sage: C = B.echelon_form()
214
+ sage: C[3,5]*350
215
+ -1139*x + 63*y + 120*z + 350*t
216
+
217
+ Sage example in ./sol/calculus.tex, line 643::
218
+
219
+ sage: K = A.left_kernel(); K
220
+ Vector space of degree 4 and dimension 1 over Rational Field
221
+ Basis matrix:
222
+ [ 1 -63/1139 -120/1139 -350/1139]
223
+
224
+ Sage example in ./sol/calculus.tex, line 653::
225
+
226
+ sage: matrix(K.0).right_kernel()
227
+ Vector space of degree 4 and dimension 3 over Rational Field
228
+ Basis matrix:
229
+ [ 1 0 0 1139/350]
230
+ [ 0 1 0 -9/50]
231
+ [ 0 0 1 -12/35]
232
+
233
+ Sage example in ./sol/calculus.tex, line 668::
234
+
235
+ sage: A = matrix(QQ, [[-2, 1, 1], [8, 1, -5], [4, 3, -3]])
236
+ sage: C = matrix(QQ, [[1, 2, -1], [2, -1, -1], [-5, 0, 3]])
237
+
238
+ Sage example in ./sol/calculus.tex, line 680::
239
+
240
+ sage: B = C.solve_left(A); B
241
+ [ 0 -1 0]
242
+ [ 2 3 0]
243
+ [ 2 1 0]
244
+
245
+ Sage example in ./sol/calculus.tex, line 691::
246
+
247
+ sage: C.left_kernel()
248
+ Vector space of degree 3 and dimension 1 over Rational Field
249
+ Basis matrix:
250
+ [1 2 1]
251
+
252
+ Sage example in ./sol/calculus.tex, line 699::
253
+
254
+ sage: x, y, z = var('x, y, z'); v = matrix([[1, 2, 1]])
255
+ sage: B = B + (x*v).stack(y*v).stack(z*v); B
256
+ [ x 2*x - 1 x]
257
+ [ y + 2 2*y + 3 y]
258
+ [ z + 2 2*z + 1 z]
259
+
260
+ Sage example in ./sol/calculus.tex, line 708::
261
+
262
+ sage: A == B*C
263
+ True
264
+ """