@@ -14,58 +14,61 @@ Originally, **SymbolicNumericIntegration.jl** expected only univariate expressio
1414
1515To install SymbolicNumericIntegration.jl, use the Julia package manager:
1616
17- ``` julia
17+ ```
1818using Pkg
1919Pkg.add("SymbolicNumericIntegration")
2020```
2121
2222Examples:
2323
24- ``` julia
24+ ```
2525julia> using SymbolicNumericIntegration
26- using Symbolics
26+ julia> using Symbolics
2727
2828julia> @variables x a b
2929
30- julia > integrate ( 3 x ^ 3 + 2 x - 5 )
30+ # if `detailed = true` (default), the output is a tuple of (solution, unsolved portion, err )
3131
32- julia> integrate (( 5 + 2 x) ^- 1 )
32+ julia> integrate(3x^3 + 2x - 5 )
3333(x^2 + (3//4)*(x^4) - (5x), 0, 0)
3434
35- julia> integrate (x ^ 2 / ( 16 + x ^ 2 ); detailed = false )
35+ julia> integrate((5 + 2x)^-1 )
3636((1//2)*log((5//2) + x), 0, 0.0)
3737
3838# `detailed = false` simplifies the output to just the resulting integral
3939
40- julia> integrate (x^ 2 * log (x ); detailed = false )
40+ julia> integrate(x^2 / (16 + x^2 ); detailed = false)
4141x + 4atan((-1//4)*x)
4242
43- julia> integrate (sec (x) * tan (x); detailed = false )
43+ julia> integrate(x^2 * log (x); detailed = false)
4444(1//3)*(x^3)*log(x) - (1//9)*(x^3)
4545
46- julia> integrate (sin (a * x), x ; detailed = false , symbolic = true )
46+ julia> integrate(sec(x) * tan(x) ; detailed = false)
4747sec(x)
4848
49- # Here, a is a symbolic constant; therefore, we need to explicitly
50- # define the independent variable (say, x). Also, we set
49+ # Symbolic integration. Here, a is a symbolic constant; therefore, we need
50+ # to explicitly define the independent variable (say, x). Also, we set
5151# `symbolic = true` to force using the symbolic solver
5252
53- julia> integrate (x ^ 2 * cos (a * x), x; detailed = false , symbolic = true )
53+ julia> integrate(sin (a * x), x; detailed = false, symbolic = true)
5454(-cos(a*x)) / a
5555
56- julia> integrate (cosh (a * x) * exp (b * x), x; detailed = false , symbolic = true )
56+ julia> integrate(x^2 * cos(a * x), x; detailed = false, symbolic = true)
5757((a^2)*(x^2)*sin(a*x) + 2.0a*x*cos(a*x) - 2.0sin(a*x)) / (a^3)
5858
59+ julia> integrate(log(log(a * x)) / x, x; detailed = false, symbolic = true)
60+ log(a*x)*log(log(a*x)) - log(a*x)
61+
5962# multiple symbolic constants
6063
61- julia> integrate (log ( log ( a * x)) / x , x; detailed = false , symbolic = true )
64+ julia> integrate(cosh( a * x) * exp(b * x) , x; detailed = false, symbolic = true)
6265(a*sinh(a*x)*exp(b*x) - b*cosh(a*x)*exp(b*x)) / (a^2 - (b^2))
6366
64- julia> integrate (x * sin (a * x), (x, 0 , 1 ); symbolic = true , detailed = false )
65- log (a* x)* log (log (a* x)) - log (a* x)
66-
6767# definite integration, passing a tuple of (x, lower bound, higher bound) in the
6868# second argument
69+
70+ julia> integrate(x * sin(a * x), (x, 0, 1); symbolic = true, detailed = false)
71+ (sin(a) - a*cos(a)) / (a^2)
6972```
7073
7174SymbolicNumericIntegration.jl exports some special integral functions (defined over Complex numbers) and uses them in solving integrals:
@@ -98,7 +101,7 @@ integrate(eq, x; kwargs...)
98101
99102Additionally, 12 test suites from the * Rule-based Integrator* ([ Rubi] ( https://rulebasedintegration.org/ ) ) are included in the ` /test ` directory. For example, we can test the first one as below. * Axiom* refers to the format of the test files)
100103
101- ``` julia
104+ ```
102105using SymbolicNumericIntegration
103106include("test/axiom.jl") # note, you may need to use the correct path
104107
0 commit comments