@@ -22,51 +22,50 @@ Pkg.add("SymbolicNumericIntegration")
2222Examples:
2323
2424``` julia
25- julia> using Symbolics
2625julia> using SymbolicNumericIntegration
26+ using Symbolics
2727
2828julia> @variables x a b
2929
3030julia> integrate (3 x^ 3 + 2 x - 5 )
31- (x^ 2 + (3 // 4 )* (x^ 4 ) - (5 x), 0 , 0 )
3231
3332julia> integrate ((5 + 2 x)^- 1 )
33+ (x^ 2 + (3 // 4 )* (x^ 4 ) - (5 x), 0 , 0 )
34+
35+ julia> integrate (x^ 2 / (16 + x^ 2 ); detailed = false )
3436((1 // 2 )* log ((5 // 2 ) + x), 0 , 0.0 )
3537
3638# `detailed = false` simplifies the output to just the resulting integral
3739
38- julia> integrate (x^ 2 / ( 16 + x ^ 2 ); detailed = false )
40+ julia> integrate (x^ 2 * log (x ); detailed = false )
3941x + 4 atan ((- 1 // 4 )* x)
4042
41- julia> integrate (x ^ 2 * log (x); detailed = false )
43+ julia> integrate (sec (x) * tan (x); detailed = false )
4244(1 // 3 )* (x^ 3 )* log (x) - (1 // 9 )* (x^ 3 )
4345
44- julia> integrate (sec (x) * tan (x) ; detailed = false )
46+ julia> integrate (sin (a * x), x ; detailed = false , symbolic = true )
4547sec (x)
4648
4749# Here, a is a symbolic constant; therefore, we need to explicitly
4850# define the independent variable (say, x). Also, we set
4951# `symbolic = true` to force using the symbolic solver
5052
51- julia> integrate (sin (a * x), x; detailed = false , symbolic = true )
53+ julia> integrate (x ^ 2 * cos (a * x), x; detailed = false , symbolic = true )
5254(- cos (a* x)) / a
5355
54- julia> integrate (x ^ 2 * cos (a * x), x; detailed = false , symbolic = true )
56+ julia> integrate (cosh (a * x) * exp (b * x), x; detailed = false , symbolic = true )
5557((a^ 2 )* (x^ 2 )* sin (a* x) + 2.0 a* x* cos (a* x) - 2.0 sin (a* x)) / (a^ 3 )
5658
5759# multiple symbolic constants
5860
59- julia> integrate (cosh ( a * x) * exp (b * x) , x; detailed = false , symbolic = true )
61+ julia> integrate (log ( log ( a * x)) / x , x; detailed = false , symbolic = true )
6062(a* sinh (a* x)* exp (b* x) - b* cosh (a* x)* exp (b* x)) / (a^ 2 - (b^ 2 ))
6163
62- julia> integrate (log ( log ( a * x)) / x, x; detailed = false , symbolic = true )
64+ julia> integrate (x * sin ( a * x), ( x, 0 , 1 ); symbolic = true , detailed = false )
6365log (a* x)* log (log (a* x)) - log (a* x)
6466
6567# definite integration, passing a tuple of (x, lower bound, higher bound) in the
6668# second argument
67-
68- julia> integrate (x * sin (a * x), (x, 0 , 1 ); symbolic = true , detailed = false )
69- (sin (a) - a* cos (a)) / (a^ 2 )
7069```
7170
7271SymbolicNumericIntegration.jl exports some special integral functions (defined over Complex numbers) and uses them in solving integrals:
0 commit comments