Skip to content

Commit 58e3694

Browse files
docs formatted
1 parent 0cc7236 commit 58e3694

File tree

2 files changed

+26
-22
lines changed

2 files changed

+26
-22
lines changed

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,20 @@ the documentation, which contains the unreleased features.
2020

2121
## Example
2222

23-
```julia
23+
```
2424
julia> using SymbolicNumericIntegration
25-
using Symbolics
25+
julia> using Symbolics
2626
2727
julia> @variables x a b
2828
2929
julia> integrate(3x^3 + 2x - 5)
30+
(x^2 + (3//4)*(x^4) - (5//1)*x, 0, 0)
3031
3132
julia> integrate(exp(a * x), x; symbolic = true)
32-
(x^2 + (3//4)*(x^4) - (5//1)*x, 0, 0)
33+
(exp(a*x) / a, 0, 0)
3334
3435
julia> integrate(sin(a * x) * cos(b * x), x; symbolic = true, detailed = false)
35-
(exp(a*x) / a, 0, 0)
36+
(-a*cos(a*x)*cos(b*x) - b*sin(a*x)*sin(b*x)) / (a^2 - (b^2))
3637
```
3738

3839
# Citation

docs/src/index.md

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,58 +14,61 @@ Originally, **SymbolicNumericIntegration.jl** expected only univariate expressio
1414

1515
To install SymbolicNumericIntegration.jl, use the Julia package manager:
1616

17-
```julia
17+
```
1818
using Pkg
1919
Pkg.add("SymbolicNumericIntegration")
2020
```
2121

2222
Examples:
2323

24-
```julia
24+
```
2525
julia> using SymbolicNumericIntegration
26-
using Symbolics
26+
julia> using Symbolics
2727
2828
julia> @variables x a b
2929
30-
julia> integrate(3x^3 + 2x - 5)
30+
# if `detailed = true` (default), the output is a tuple of (solution, unsolved portion, err)
3131
32-
julia> integrate((5 + 2x)^-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)
4141
x + 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)
4747
sec(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

7174
SymbolicNumericIntegration.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

99102
Additionally, 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+
```
102105
using SymbolicNumericIntegration
103106
include("test/axiom.jl") # note, you may need to use the correct path
104107

0 commit comments

Comments
 (0)