@@ -22,53 +22,53 @@ Pkg.add("SymbolicNumericIntegration")
22
22
Examples:
23
23
24
24
``` julia
25
- julia > using SymbolicNumericIntegration
26
- julia > using Symbolics
25
+ using Symbolics
26
+ using SymbolicNumericIntegration
27
27
28
- julia > @variables x a b
28
+ @variables x a b
29
29
30
30
# if `detailed = true` (default), the output is a tuple of (solution, unsolved portion, err)
31
31
32
- julia > integrate (3 x^ 3 + 2 x - 5 )
33
- (x^ 2 + (3 // 4 ) * (x^ 4 ) - (5 x), 0 , 0 )
32
+ integrate (3 x^ 3 + 2 x - 5 )
33
+ (x^ 2 + (3 // 4 ) * (x^ 4 ) - (5 x), 0 , 0 )
34
34
35
- julia > integrate ((5 + 2 x)^- 1 )
36
- ((1 // 2 ) * log ((5 // 2 ) + x), 0 , 0.0 )
35
+ integrate ((5 + 2 x)^- 1 )
36
+ ((1 // 2 ) * log ((5 // 2 ) + x), 0 , 0.0 )
37
37
38
38
# `detailed = false` simplifies the output to just the resulting integral
39
39
40
- julia > integrate (x^ 2 / (16 + x^ 2 ); detailed = false )
41
- x + 4 atan ((- 1 // 4 ) * x)
40
+ integrate (x^ 2 / (16 + x^ 2 ); detailed = false )
41
+ x + 4 atan ((- 1 // 4 ) * x)
42
42
43
- julia > integrate (x^ 2 * log (x); detailed = false )
44
- (1 // 3 ) * (x^ 3 )* log (x) - (1 // 9 ) * (x^ 3 )
43
+ integrate (x^ 2 * log (x); detailed = false )
44
+ (1 // 3 ) * (x^ 3 ) * log (x) - (1 // 9 ) * (x^ 3 )
45
45
46
- julia > integrate (sec (x) * tan (x); detailed = false )
46
+ integrate (sec (x) * tan (x); detailed = false )
47
47
sec (x)
48
48
49
49
# Symbolic integration. Here, a is a symbolic constant; therefore, we need
50
50
# to explicitly define the independent variable (say, x). Also, we set
51
51
# `symbolic = true` to force using the symbolic solver
52
52
53
- julia > integrate (sin (a * x), x; detailed = false , symbolic = true )
54
- (- cos (a* x)) / a
53
+ integrate (sin (a * x), x; detailed = false , symbolic = true )
54
+ (- cos (a * x)) / a
55
55
56
- julia > integrate (x^ 2 * cos (a * x), x; detailed = false , symbolic = true )
57
- ((a^ 2 )* (x^ 2 )* sin (a* x) + 2.0 a* x * cos (a* x) - 2.0 sin (a* x)) / (a^ 3 )
56
+ integrate (x^ 2 * cos (a * x), x; detailed = false , symbolic = true )
57
+ ((a^ 2 ) * (x^ 2 ) * sin (a * x) + 2.0 a * x * cos (a * x) - 2.0 sin (a * x)) / (a^ 3 )
58
58
59
- julia > integrate (log (log (a * x)) / x, x; detailed = false , symbolic = true )
60
- log (a* x) * log (log (a* x)) - log (a* x)
59
+ integrate (log (log (a * x)) / x, x; detailed = false , symbolic = true )
60
+ log (a * x) * log (log (a * x)) - log (a * x)
61
61
62
62
# multiple symbolic constants
63
63
64
- julia > integrate (cosh (a * x) * exp (b * x), x; detailed = false , symbolic = true )
65
- (a* sinh (a* x) * exp (b* x) - b* cosh (a* x) * exp (b* x)) / (a^ 2 - (b^ 2 ))
64
+ integrate (cosh (a * x) * exp (b * x), x; detailed = false , symbolic = true )
65
+ (a * sinh (a * x) * exp (b * x) - b * cosh (a * x) * exp (b * x)) / (a^ 2 - (b^ 2 ))
66
66
67
67
# definite integration, passing a tuple of (x, lower bound, higher bound) in the
68
68
# second argument
69
69
70
- julia > integrate (x * sin (a * x), (x, 0 , 1 ); symbolic = true , detailed = false )
71
- (sin (a) - a* cos (a)) / (a^ 2 )
70
+ integrate (x * sin (a * x), (x, 0 , 1 ); symbolic = true , detailed = false )
71
+ (sin (a) - a * cos (a)) / (a^ 2 )
72
72
```
73
73
74
74
SymbolicNumericIntegration.jl exports some special integral functions (defined over Complex numbers) and uses them in solving integrals:
@@ -81,13 +81,13 @@ SymbolicNumericIntegration.jl exports some special integral functions (defined o
81
81
For examples:
82
82
83
83
``` julia
84
- julia > integrate (exp (x + 1 ) / (x + 1 ))
84
+ integrate (exp (x + 1 ) / (x + 1 ))
85
85
(SymbolicNumericIntegration. Ei (1 + x), 0 , 0.0 )
86
86
87
- julia > integrate (x * cos (a* x^ 2 - 1 ) / (a* x^ 2 - 1 ), x; detailed= false , symbolic= true )
88
- ((1 // 2 ) * SymbolicNumericIntegration. Ci (a* (x^ 2 ) - 1 )) / a
87
+ integrate (x * cos (a * x^ 2 - 1 ) / (a * x^ 2 - 1 ), x; detailed = false , symbolic = true )
88
+ ((1 // 2 ) * SymbolicNumericIntegration. Ci (a * (x^ 2 ) - 1 )) / a
89
89
90
- julia > integrate (1 / (x* log (log (x))), x; detailed= false , symbolic= true )
90
+ integrate (1 / (x * log (log (x))), x; detailed = false , symbolic = true )
91
91
SymbolicNumericIntegration. Li (log (x))
92
92
```
93
93
@@ -213,4 +213,4 @@ file and the
213
213
[project]($link_project)
214
214
file.
215
215
""")
216
- ```
216
+ ```
0 commit comments