Skip to content

Commit 2c62205

Browse files
improved documetation
1 parent 89127c4 commit 2c62205

File tree

2 files changed

+19
-5
lines changed

2 files changed

+19
-5
lines changed

docs/src/index.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ julia> integrate(3x^3 + 2x - 5)
3535
julia> integrate((5 + 2x)^-1)
3636
((1//2)*log((5//2) + x), 0, 0.0)
3737

38-
# detailed simplifies the output to just the resulting integral
38+
# `detailed = false` simplifies the output to just the resulting integral
3939

4040
julia> integrate(x^2 / (16 + x^2); detailed = false)
4141
x + 4atan((-1//4)*x)
@@ -48,7 +48,7 @@ sec(x)
4848

4949
# Here, a is a symbolic constant; therefore, we need to explicitly
5050
# define the independent variable (say, x). Also, we set
51-
# `symbolic=true` to force using the symbolic solver
51+
# `symbolic = true` to force using the symbolic solver
5252

5353
julia> integrate(sin(a * x), x; detailed = false, symbolic = true)
5454
(-cos(a*x)) / a
@@ -63,6 +63,12 @@ julia> integrate(cosh(a * x) * exp(b * x), x; detailed = false, symbolic = true)
6363

6464
julia> integrate(log(log(a * x)) / x, x; detailed = false, symbolic = true)
6565
log(a*x)*log(log(a*x)) - log(a*x)
66+
67+
# definite integration, passing a tuple of (x, lower bound, higher bound) in the
68+
# 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)
6672
```
6773

6874
SymbolicNumericIntegration.jl exports some special integral functions (defined over Complex numbers) and uses them in solving integrals:

src/integral.jl

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,25 @@ Base.signbit(x::SymbolicUtils.Sym{Number}) = false
1010
is the main entry point to integrate a univariate expression `eq` with respect to `x' (optional).
1111
1212
```julia
13-
integrate(x * sin(2x))
13+
julia> using Symbolics, SymbolNumericIntegration
1414
15-
# output
15+
julia> @variables x a
1616
17+
julia> integrate(x * sin(2x))
1718
((1//4)*sin(2x) - (1//2)*x*cos(2x), 0, 0)
19+
20+
julia> integrate(x * sin(a*x), x; symbolic=true, detailed=false)
21+
(sin(a*x) - a*x*cos(a*x)) / (a^2)
22+
23+
julia> integrate(x * sin(a*x), (x, 0, 1); symbolic=true, detailed=false)
24+
(sin(a) - a*cos(a)) / (a^2)
1825
```
1926
2027
Arguments:
2128
----------
2229
- `eq`: a univariate expression
23-
- `x`: the independent variable (optional)
30+
- `x`: independent variable (optional if `eq` is univariate) or a tuple
31+
of (independent variable, lower bound, upper bound) for definite integration.
2432
2533
Keyword Arguments:
2634
------------------

0 commit comments

Comments
 (0)