Skip to content

Commit 18999b3

Browse files
updated to 0.6.3; homotopy method available by setting homotopy=true (experimental)
1 parent 3a54555 commit 18999b3

File tree

218 files changed

+91935
-16
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

218 files changed

+91935
-16
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "SymbolicNumericIntegration"
22
uuid = "78aadeae-fbc0-11eb-17b6-c7ec0477ba9e"
33
authors = ["Shahriar Iravanian <[email protected]>"]
4-
version = "0.6.2"
4+
version = "0.6.3"
55

66
[deps]
77
DataDrivenDiffEq = "2445eb08-9709-466a-b3fc-47e12bd697a2"

src/SymbolicNumericIntegration.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# module SymbolicNumericIntegration
1+
module SymbolicNumericIntegration
22

33
using SymbolicUtils
44
using SymbolicUtils: istree, operation, arguments
@@ -15,6 +15,8 @@ export find_roots
1515

1616
include("rules.jl")
1717
include("candidates.jl")
18+
include("homotopy.jl")
19+
1820
include("integral.jl")
1921

2022
export integrate, generate_basis
@@ -25,4 +27,4 @@ include("integration_by_parts.jl")
2527
include("logger.jl")
2628
include("prune.jl")
2729

28-
# end # module
30+
end # module

src/candidates.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ function generate_basis(eq, x)
88
q = t / coef(t, x)
99
f = kernel(q)
1010
C₁ = closure(f, x) # find_candidates(f, x)
11-
# C₂ = find_candidates_nonsolvable(q * inverse(f), x)
12-
C₂ = generate_by_parts(q * inverse(f), x)
11+
C₂ = find_candidates_nonsolvable(q * inverse(f), x)
12+
# C₂ = generate_by_parts(q * inverse(f), x)
1313

1414
for c₁ in C₁
1515
enqueue_expr_ex!(S, c₁, x)

src/integral.jl

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Base.signbit(z::Complex{T}) where T<:Number = signbit(real(z))
2525
function integrate(eq, x=nothing; abstol=1e-6, num_steps=2, num_trials=5, radius=1.0,
2626
show_basis=false, opt = STLSQ(exp.(-10:1:0)), bypass=false,
2727
symbolic=true, bypart=true, max_basis=110,
28-
verbose=false, complex_plane=true, prune_basis=false)
28+
verbose=false, complex_plane=true, prune_basis=false, homotopy=false)
2929
eq = expand(eq)
3030
eq = apply_div_rule(eq)
3131

@@ -54,15 +54,15 @@ function integrate(eq, x=nothing; abstol=1e-6, num_steps=2, num_trials=5, radius
5454

5555
s₁, u₁, ϵ = integrate_sum(eq, x, l; bypass, abstol, num_trials, num_steps,
5656
radius, show_basis, opt, symbolic,
57-
max_basis, verbose, complex_plane, prune_basis)
57+
max_basis, verbose, complex_plane, prune_basis, homotopy)
5858

5959
if isequal(u₁, 0) || !bypart
6060
return s₁, u₁, ϵ
6161
else
6262
s₂, u₂, ϵ = try_integration_by_parts(u₁, x, l; abstol, num_trials, num_steps,
6363
radius, show_basis, opt, symbolic,
6464
max_basis, verbose, complex_plane,
65-
prune_basis)
65+
prune_basis, homotopy)
6666
return s₁ + s₂, u₂, ϵ
6767
end
6868
end
@@ -149,9 +149,9 @@ end
149149
function integrate_term(eq, x, l; kwargs...)
150150
args = Dict(kwargs)
151151
abstol, num_steps, num_trials, show_basis, symbolic, verbose, max_basis,
152-
radius, prune_basis = args[:abstol], args[:num_steps], args[:num_trials],
153-
args[:show_basis], args[:symbolic], args[:verbose], args[:max_basis],
154-
args[:radius], args[:prune_basis]
152+
radius, prune_basis, homotopy = args[:abstol], args[:num_steps],
153+
args[:num_trials], args[:show_basis], args[:symbolic], args[:verbose],
154+
args[:max_basis], args[:radius], args[:prune_basis], args[:homotopy]
155155

156156
attempt(l, "Integrating term", eq)
157157

@@ -164,9 +164,12 @@ function integrate_term(eq, x, l; kwargs...)
164164
# note that the order of the operations is important!
165165
# first, collecing hints, then applying transformation rules, and finally finding the basis.
166166

167-
# basis = generate_basis(eq, x)
168-
# basis = generate_by_parts(eq, x)
169-
basis = generate_homotopy(eq, x)
167+
if homotopy
168+
basis = generate_homotopy(eq, x)
169+
else
170+
basis = generate_basis(eq, x)
171+
end
172+
# basis = generate_by_parts(eq, x)
170173

171174
if show_basis
172175
inform(l, "Generating basis (|β| = $(length(basis)))", basis)
Lines changed: 284 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,284 @@
1+
-- Axiom integration test file: "0 Independent test suites\Apostol Problems.input"
2+
3+
lst: '[
4+
5+
-- Tom M. Apostol - Calculus, Volume I, Second Edition (1967)
6+
7+
-- Section 5.8 Exercises (p. 216-217)
8+
9+
-- Exercises 1 - 10
10+
[sqrt(1+2*x),x,1,1/3*(1+2*x)^(3/2)],
11+
[x*sqrt(1+3*x),x,2,-2/27*(1+3*x)^(3/2)+2/45*(1+3*x)^(5/2)],
12+
[x^2*sqrt(1+x),x,2,2/3*(1+x)^(3/2)-4/5*(1+x)^(5/2)+2/7*(1+x)^(7/2)],
13+
[x/sqrt(2-3*x),x,2,2/27*(2-3*x)^(3/2)-4/9*sqrt(2-3*x)],
14+
[(1+x)/(2+2*x+x^2)^3,x,1,(-1/4)/(2+2*x+x^2)^2],
15+
[sin(x)^3,x,2,-cos(x)+1/3*cos(x)^3],
16+
[(-1+z)^(1/3)*z,z,2,3/4*(-1+z)^(4/3)+3/7*(-1+z)^(7/3)],
17+
[cos(x)/sin(x)^3,x,2,-1/2*csc(x)^2],
18+
[cos(2*x)*sqrt(4-sin(2*x)),x,2,-1/3*(4-sin(2*x))^(3/2)],
19+
[sin(x)/(3+cos(x))^2,x,2,1/(3+cos(x))],
20+
21+
-- Exercises 11 - 20
22+
[sin(x)/sqrt(cos(x)^3),x,3,2*cos(x)/sqrt(cos(x)^3)],
23+
[sin(sqrt(1+x))/sqrt(1+x),x,3,-2*cos(sqrt(1+x))],
24+
[x^(-1+n)*sin(x^n),x,2,-cos(x^n)/n],
25+
[x^5/sqrt(1-x^6),x,1,-1/3*sqrt(1-x^6)],
26+
[t*(1+t)^(1/4),t,2,-4/5*(1+t)^(5/4)+4/9*(1+t)^(9/4)],
27+
[1/(1+x^2)^(3/2),x,1,x/sqrt(1+x^2)],
28+
[x^2*(27+8*x^3)^(2/3),x,1,1/40*(27+8*x^3)^(5/3)],
29+
[(cos(x)+sin(x))/(-cos(x)+sin(x))^(1/3),x,1,3/2*(-cos(x)+sin(x))^(2/3)],
30+
[x/sqrt(1+x^2+(1+x^2)^(3/2)),x,3,2*sqrt((1+x^2)*(1+sqrt(1+x^2)))/sqrt(1+x^2)],
31+
[x/(sqrt(1+x^2)*sqrt(1+sqrt(1+x^2))),x,1,2*sqrt(1+sqrt(1+x^2))],
32+
[(1-2*x+x^2)^(1/5)/(1-x),x,2,-5/2*(1-2*x+x^2)^(1/5)],
33+
34+
-- Section 5.10 Exercises (p. 220-222)
35+
36+
-- Exercises 1 - 6
37+
[x*sin(x),x,2,-x*cos(x)+sin(x)],
38+
[x^2*sin(x),x,3,2*cos(x)-x^2*cos(x)+2*x*sin(x)],
39+
[x^3*cos(x),x,4,-6*cos(x)+3*x^2*cos(x)-6*x*sin(x)+x^3*sin(x)],
40+
[x^3*sin(x),x,4,6*x*cos(x)-x^3*cos(x)-6*sin(x)+3*x^2*sin(x)],
41+
[cos(x)*sin(x),x,2,1/2*sin(x)^2],
42+
[x*cos(x)*sin(x),x,3,-1/4*x+1/4*cos(x)*sin(x)+1/2*x*sin(x)^2],
43+
44+
-- Exercises 7 - 10
45+
[sin(x)^2,x,2,1/2*x-1/2*cos(x)*sin(x)],
46+
[sin(x)^3,x,2,-cos(x)+1/3*cos(x)^3],
47+
[sin(x)^4,x,3,3/8*x-3/8*cos(x)*sin(x)-1/4*cos(x)*sin(x)^3],
48+
[sin(x)^5,x,2,-cos(x)+2/3*cos(x)^3-1/5*cos(x)^5],
49+
[sin(x)^6,x,4,5/16*x-5/16*cos(x)*sin(x)-5/24*cos(x)*sin(x)^3-1/6*cos(x)*sin(x)^5],
50+
51+
-- Exercise 11
52+
[x*sin(x)^2,x,2,1/4*x^2-1/2*x*cos(x)*sin(x)+1/4*sin(x)^2],
53+
[x*sin(x)^3,x,3,-2/3*x*cos(x)+2/3*sin(x)-1/3*x*cos(x)*sin(x)^2+1/9*sin(x)^3],
54+
[x^2*sin(x)^2,x,4,-1/4*x+1/6*x^3+1/4*cos(x)*sin(x)-1/2*x^2*cos(x)*sin(x)+1/2*x*sin(x)^2],
55+
56+
-- Exercise 13
57+
[cos(x)^2,x,2,1/2*x+1/2*cos(x)*sin(x)],
58+
[cos(x)^3,x,2,sin(x)-1/3*sin(x)^3],
59+
[cos(x)^4,x,3,3/8*x+3/8*cos(x)*sin(x)+1/4*cos(x)^3*sin(x)],
60+
61+
-- Exercises 15 - 17
62+
[(a^2-x^2)^(5/2),x,5,5/24*a^2*x*(a^2-x^2)^(3/2)+1/6*x*(a^2-x^2)^(5/2)+5/16*a^6*atan(x/sqrt(a^2-x^2))+5/16*a^4*x*sqrt(a^2-x^2)],
63+
[x^5/sqrt(5+x^2),x,3,-10/3*(5+x^2)^(3/2)+1/5*(5+x^2)^(5/2)+25*sqrt(5+x^2)],
64+
[t^3/(4+t^3)^(1/2),t,2,2/5*t*sqrt(4+t^3)-8/5*2^(2/3)*(2^(2/3)+t)*elliptic_f(asin((t+2^(2/3)*(1-sqrt(3)))/(t+2^(2/3)*(1+sqrt(3)))),-7-4*sqrt(3))*sqrt(2+sqrt(3))*sqrt((2*2^(1/3)-2^(2/3)*t+t^2)/(t+2^(2/3)*(1+sqrt(3)))^2)/(3^(1/4)*sqrt(4+t^3)*sqrt((2^(2/3)+t)/(t+2^(2/3)*(1+sqrt(3)))^2))],
65+
66+
-- Exercises 18 - 19
67+
[tan(x)^2,x,2,-x+tan(x)],
68+
[tan(x)^4,x,3,x-tan(x)+1/3*tan(x)^3],
69+
[cot(x)^2,x,2,-x-cot(x)],
70+
[cot(x)^4,x,3,x+cot(x)-1/3*cot(x)^3],
71+
72+
-- Section 5.11 Miscellaneous review exercises (p. 222-225)
73+
74+
-- Exercises 11 - 20
75+
[(2+3*x)*sin(5*x),x,2,-1/5*(2+3*x)*cos(5*x)+3/25*sin(5*x)],
76+
[x*sqrt(1+x^2),x,1,1/3*(1+x^2)^(3/2)],
77+
[x*(-1+x^2)^9,x,1,1/20*(1-x^2)^10],
78+
[(3+2*x)/(7+6*x)^3,x,1,-1/8*(3+2*x)^2/(7+6*x)^2],
79+
[x^4*(1+x^5)^5,x,1,1/30*(1+x^5)^6],
80+
[(1-x)^20*x^4,x,2,-1/21*(1-x)^21+2/11*(1-x)^22-6/23*(1-x)^23+1/6*(1-x)^24-1/25*(1-x)^25],
81+
[sin(1/x)/x^2,x,2,cos(1/x)],
82+
[sin((-1+x)^(1/4)),x,5,24*(-1+x)^(1/4)*cos((-1+x)^(1/4))-4*(-1+x)^(3/4)*cos((-1+x)^(1/4))-24*sin((-1+x)^(1/4))+12*sin((-1+x)^(1/4))*sqrt(-1+x)],
83+
[x*cos(x^2)*sin(x^2),x,1,1/4*sin(x^2)^2],
84+
[sin(2*x)*sqrt(1+3*cos(x)^2),x,3,-2/9*(4-3*sin(x)^2)^(3/2)],
85+
86+
-- Section 6.9 Exercises (p. 236-238)
87+
88+
-- Exercises 16 - 21
89+
[1/(2+3*x),x,1,1/3*log(2+3*x)],
90+
[log(x)^2,x,2,2*x-2*x*log(x)+x*log(x)^2],
91+
[x*log(x),x,1,-1/4*x^2+1/2*x^2*log(x)],
92+
[x*log(x)^2,x,2,1/4*x^2-1/2*x^2*log(x)+1/2*x^2*log(x)^2],
93+
[1/(1+t),t,1,log(1+t)],
94+
[cot(x),x,1,log(sin(x))],
95+
96+
-- Exercises 22 - 27
97+
[x^n*log(a*x),x,1,-x^(1+n)/(1+n)^2+x^(1+n)*log(a*x)/(1+n)],
98+
[x^2*log(x)^2,x,2,2/27*x^3-2/9*x^3*log(x)+1/3*x^3*log(x)^2],
99+
[1/(x*log(x)),x,2,log(log(x))],
100+
[log(1-t)/(1-t),t,2,-1/2*log(1-t)^2],
101+
[log(x)/(x*sqrt(1+log(x))),x,3,2/3*(1+log(x))^(3/2)-2*sqrt(1+log(x))],
102+
[x^3*log(x)^3,x,3,-3/128*x^4+3/32*x^4*log(x)-3/16*x^4*log(x)^2+1/4*x^4*log(x)^3],
103+
104+
-- Section 6.16 Differentiation and integration formulas involving exponentials (p. 245-248)
105+
106+
-- Example 1
107+
[%e^(x^3)*x^2,x,1,1/3*%e^(x^3)],
108+
109+
-- Example 2
110+
[2^sqrt(x)/sqrt(x),x,1,2^(1+sqrt(x))/log(2)],
111+
112+
-- Example 3
113+
[%e^(2*sin(x))*cos(x),x,2,1/2*%e^(2*sin(x))],
114+
115+
-- Example 4
116+
[%e^x*sin(x),x,1,-1/2*%e^x*cos(x)+1/2*%e^x*sin(x)],
117+
[%e^x*cos(x),x,1,1/2*%e^x*cos(x)+1/2*%e^x*sin(x)],
118+
119+
-- Example 5
120+
[1/(1+%e^x),x,4,x-log(1+%e^x)],
121+
122+
-- Section 6.17 Exercises (p. 248-250)
123+
124+
-- Exercises 13 - 18
125+
[%e^x*x,x,2,-%e^x+%e^x*x],
126+
[x/%e^x,x,2,(-1)/%e^x-x/%e^x],
127+
[%e^x*x^2,x,3,2*%e^x-2*%e^x*x+%e^x*x^2],
128+
[x^2/%e^(2*x),x,3,(-1/4)/%e^(2*x)-1/2*x/%e^(2*x)-1/2*x^2/%e^(2*x)],
129+
[%e^sqrt(x),x,3,-2*%e^sqrt(x)+2*%e^sqrt(x)*sqrt(x)],
130+
[x^3/%e^(x^2),x,2,(-1/2)/%e^(x^2)-1/2*x^2/%e^(x^2)],
131+
132+
-- Exercise 20
133+
[%e^(a*x)*cos(b*x),x,1,%e^(a*x)*a*cos(b*x)/(a^2+b^2)+%e^(a*x)*b*sin(b*x)/(a^2+b^2)],
134+
[%e^(a*x)*sin(b*x),x,1,-%e^(a*x)*b*cos(b*x)/(a^2+b^2)+%e^(a*x)*a*sin(b*x)/(a^2+b^2)],
135+
136+
-- Section 6.22 Exercises (p. 256-258)
137+
138+
-- Exercises 6 - 10
139+
[acot(x),x,2,x*acot(x)+1/2*log(1+x^2)],
140+
[asec(x),x,4,x*asec(x)-atanh(sqrt(1+(-1)/x^2))],
141+
[acsc(x),x,4,x*acsc(x)+atanh(sqrt(1+(-1)/x^2))],
142+
[asin(x)^2,x,3,-2*x+x*asin(x)^2+2*asin(x)*sqrt(1-x^2)],
143+
[asin(x)/x^2,x,4,-asin(x)/x-atanh(sqrt(1-x^2))],
144+
145+
-- Exercises 29 - 37
146+
[1/sqrt(a^2-x^2),x,2,atan(x/sqrt(a^2-x^2))],
147+
[1/sqrt(1-2*x-x^2),x,2,asin((1+x)/sqrt(2))],
148+
[1/(a^2+x^2),x,1,atan(x/a)/a],
149+
[1/(a+b*x^2),x,1,atan(x*sqrt(b)/sqrt(a))/(sqrt(a)*sqrt(b))],
150+
[1/(2-x+x^2),x,2,-2*atan((1-2*x)/sqrt(7))/sqrt(7)],
151+
[x*atan(x),x,3,-1/2*x+1/2*atan(x)+1/2*x^2*atan(x)],
152+
[x^2*acos(x),x,4,1/9*(1-x^2)^(3/2)+1/3*x^3*acos(x)-1/3*sqrt(1-x^2)],
153+
[x*atan(x)^2,x,5,-x*atan(x)+1/2*atan(x)^2+1/2*x^2*atan(x)^2+1/2*log(1+x^2)],
154+
[atan(sqrt(x)),x,4,atan(sqrt(x))+x*atan(sqrt(x))-sqrt(x)],
155+
156+
-- Exercises 38 - 47
157+
[atan(sqrt(x))/((1+x)*sqrt(x)),x,1,atan(sqrt(x))^2],
158+
[sqrt(1-x^2),x,2,1/2*asin(x)+1/2*x*sqrt(1-x^2)],
159+
[%e^atan(x)*x/(1+x^2)^(3/2),x,1,-1/2*%e^atan(x)*(1-x)/sqrt(1+x^2)],
160+
[%e^atan(x)/(1+x^2)^(3/2),x,1,1/2*%e^atan(x)*(1+x)/sqrt(1+x^2)],
161+
[x^2/(1+x^2)^2,x,2,-1/2*x/(1+x^2)+1/2*atan(x)],
162+
[%e^x/(1+%e^(2*x)),x,2,atan(%e^x)],
163+
[acot(%e^x)/%e^x,x,5,-x-acot(%e^x)/%e^x+1/2*log(1+%e^(2*x))],
164+
[((a+x)/(a-x))^(1/2),x,3,2*a*atan(sqrt((a+x)/(a-x)))-(a-x)*sqrt((a+x)/(a-x))],
165+
[sqrt((b-x)*(-a+x)),x,4,-1/8*(a-b)^2*atan(1/2*(a+b-2*x)/sqrt(-a*b+(a+b)*x-x^2))-1/4*(a+b-2*x)*sqrt(-a*b+(a+b)*x-x^2)],
166+
[1/sqrt((b-x)*(-a+x)),x,3,-atan(1/2*(a+b-2*x)/sqrt(-a*b+(a+b)*x-x^2))],
167+
168+
-- Section 6.23 Integration by partial fractions (p. 258-264)
169+
170+
-- Example 1
171+
[(3+5*x)/(-3+2*x+x^2),x,3,2*log(1-x)+3*log(3+x)],
172+
173+
-- Example 2
174+
[(5+2*x)/(-3+2*x+x^2),x,3,7/4*log(1-x)+1/4*log(3+x)],
175+
[(3*x+x^3)/(-3-2*x+x^2),x,6,2*x+1/2*x^2+9*log(3-x)+log(1+x)],
176+
177+
-- Example 3
178+
[(-1+5*x+2*x^2)/(-2*x+x^2+x^3),x,3,2*log(1-x)+1/2*log(x)-1/2*log(2+x)],
179+
180+
-- Example 4
181+
[(3+2*x+x^2)/((-1+x)*(1+x)^2),x,2,1/(1+x)+3/2*log(1-x)-1/2*log(1+x)],
182+
183+
-- Example 5
184+
[(-2+2*x+3*x^2)/(-1+x^3),x,5,log(1-x^3)+4*atan((1+2*x)/sqrt(3))/sqrt(3)],
185+
186+
-- Example 6
187+
[(2-x+2*x^2-x^3+x^4)/((-1+x)*(2+x^2)^2),x,6,1/2/(2+x^2)+1/3*log(1-x)+1/3*log(2+x^2)-1/3*atan(x/sqrt(2))/sqrt(2)],
188+
189+
-- Section 6.24 Integrals which can be transformed into integrals of rational functions (p. 264-266)
190+
191+
-- Example 1
192+
[1/(cos(x)+sin(x)),x,2,-atanh((cos(x)-sin(x))/sqrt(2))/sqrt(2)],
193+
194+
-- Example 2
195+
[x/(4-x^2+sqrt(4-x^2)),x,3,-log(1+sqrt(4-x^2))],
196+
197+
-- Section 6.25 Exercises (p. 267-268)
198+
199+
-- Exercises 1 - 10
200+
[(3+2*x)/((-2+x)*(5+x)),x,2,log(2-x)+log(5+x)],
201+
[x/((1+x)*(2+x)*(3+x)),x,2,-1/2*log(1+x)+2*log(2+x)-3/2*log(3+x)],
202+
[x/(2-3*x+x^3),x,2,1/3/(1-x)+2/9*log(1-x)-2/9*log(2+x)],
203+
[(-6+2*x+x^4)/(-2*x+x^2+x^3),x,3,-x+1/2*x^2-log(1-x)+3*log(x)+log(2+x)],
204+
[(7+8*x^3)/((1+x)*(1+2*x)^3),x,2,(-3)/(1+2*x)^2+3/(1+2*x)+log(1+x)],
205+
[(1+x+4*x^2)/(-1+x^3),x,3,2*log(1-x)+log(1+x+x^2)],
206+
[x^4/(4+5*x^2+x^4),x,4,x-8/3*atan(1/2*x)+1/3*atan(x)],
207+
[(2+x)/(x+x^2),x,2,2*log(x)-log(1+x)],
208+
[1/(x*(1+x^2)^2),x,3,1/2/(1+x^2)+log(x)-1/2*log(1+x^2)],
209+
[1/((1+x)*(2+x)^2*(3+x)^3),x,2,1/(2+x)+1/4/(3+x)^2+5/4/(3+x)+1/8*log(1+x)+2*log(2+x)-17/8*log(3+x)],
210+
211+
-- Exercises 11 - 20
212+
[x/(1+x)^2,x,2,1/(1+x)+log(1+x)],
213+
[1/(-x+x^3),x,5,-log(x)+1/2*log(1-x^2)],
214+
[x^2/(-6+x+x^2),x,4,x+4/5*log(2-x)-9/5*log(3+x)],
215+
[(2+x)/(4-4*x+x^2),x,3,4/(2-x)+log(2-x)],
216+
[1/((4-4*x+x^2)*(5-4*x+x^2)),x,4,1/(2-x)+atan(2-x)],
217+
[(-3+x)/(2*x+3*x^2+x^3),x,3,-3/2*log(x)+4*log(1+x)-5/2*log(2+x)],
218+
[1/(-1+x^2)^2,x,2,1/2*x/(1-x^2)+1/2*atanh(x)],
219+
[(1+x)/(-1+x^3),x,3,2/3*log(1-x)-1/3*log(1+x+x^2)],
220+
[(1+x^4)/(x*(1+x^2)^2),x,3,1/(1+x^2)+log(x)],
221+
[1/(-2*x^3+x^4),x,3,1/4/x^2+1/4/x+1/8*log(2-x)-1/8*log(x)],
222+
223+
-- Exercises 21 - 30
224+
[(1-x^3)/(x*(1+x^2)),x,5,-x+atan(x)+log(x)-1/2*log(1+x^2)],
225+
[1/(-1+x^4),x,3,-1/2*atan(x)-1/2*atanh(x)],
226+
[1/(1+x^4),x,9,-1/2*atan(1-x*sqrt(2))/sqrt(2)+1/2*atan(1+x*sqrt(2))/sqrt(2)-1/4*log(1+x^2-x*sqrt(2))/sqrt(2)+1/4*log(1+x^2+x*sqrt(2))/sqrt(2)],
227+
[x^2/(2+2*x+x^2)^2,x,3,-1/2*x*(2+x)/(2+2*x+x^2)+atan(1+x)],
228+
[(-1+4*x^5)/(1+x+x^5)^2,x,1,-x/(1+x+x^5)],
229+
[1/(5-cos(x)+2*sin(x)),x,3,1/2*x/sqrt(5)+atan((2*cos(x)+sin(x))/(5-cos(x)+2*sin(x)+2*sqrt(5)))/sqrt(5)],
230+
[1/(1+a*cos(x)),x,2,2*atan(sqrt(1-a)*tan(1/2*x)/sqrt(1+a))/sqrt(1-a^2)],
231+
[1/(1+2*cos(x)),x,2,-log(-sin(1/2*x)+cos(1/2*x)*sqrt(3))/sqrt(3)+log(sin(1/2*x)+cos(1/2*x)*sqrt(3))/sqrt(3)],
232+
[1/(1+1/2*cos(x)),x,1,2*x/sqrt(3)-4*atan(sin(x)/(2+cos(x)+sqrt(3)))/sqrt(3)],
233+
[sin(x)^2/(1+sin(x)^2),x,3,x-x/sqrt(2)-atan(cos(x)*sin(x)/(1+sin(x)^2+sqrt(2)))/sqrt(2)],
234+
[1/(b^2*cos(x)^2+a^2*sin(x)^2),x,2,atan(a*tan(x)/b)/(a*b)],
235+
236+
-- Exercises 31 - 40
237+
[1/(b*cos(x)+a*sin(x))^2,x,1,sin(x)/(b*(b*cos(x)+a*sin(x)))],
238+
[sin(x)/(1+cos(x)+sin(x)),x,3,1/2*x-1/2*log(1+cos(x)+sin(x))-1/2*log(1+tan(1/2*x))],
239+
[sqrt(3-x^2),x,2,3/2*asin(x/sqrt(3))+1/2*x*sqrt(3-x^2)],
240+
[x/sqrt(3-x^2),x,1,-sqrt(3-x^2)],
241+
[sqrt(3-x^2)/x,x,4,-atanh(sqrt(3-x^2)/sqrt(3))*sqrt(3)+sqrt(3-x^2)],
242+
[sqrt(x+x^2)/x,x,3,atanh(x/sqrt(x+x^2))+sqrt(x+x^2)],
243+
[sqrt(5+x^2),x,2,5/2*asinh(x/sqrt(5))+1/2*x*sqrt(5+x^2)],
244+
[x/sqrt(1+x+x^2),x,3,-1/2*asinh((1+2*x)/sqrt(3))+sqrt(1+x+x^2)],
245+
[1/sqrt(x+x^2),x,2,2*atanh(x/sqrt(x+x^2))],
246+
[sqrt(2-x-x^2)/x^2,x,6,asin(1/3*(-1-2*x))+1/2*atanh(1/2*(4-x)/(sqrt(2)*sqrt(2-x-x^2)))/sqrt(2)-sqrt(2-x-x^2)/x],
247+
248+
-- Section 6.26 Miscellaneous review exercises (p. 268-271)
249+
250+
-- Exercise 1
251+
[log(t)/(1+t),t,2,log(t)*log(1+t)+polylog(2,-t)],
252+
253+
-- Exercise 4
254+
[log(%e^cos(x)),x,3,-x*cos(x)+x*log(%e^cos(x))+sin(x)],
255+
256+
-- Exercise 6
257+
[%e^t/t,t,1,Ei(t)],
258+
[%e^(a*t)/t,t,1,Ei(a*t)],
259+
[%e^t/t^2,t,2,-%e^t/t+Ei(t)],
260+
[%e^(1/t),t,2,%e^(1/t)*t-Ei(1/t)],
261+
262+
-- Exercise 12
263+
[1/(%e^t*(-1-a+t)),t,1,%e^(-1-a)*Ei(1+a-t)],
264+
[%e^(t^2)*t/(1+t^2),t,2,1/2*Ei(1+t^2)/%e],
265+
[%e^t/(1+t)^2,t,2,-%e^t/(1+t)+Ei(1+t)/%e],
266+
[%e^t*log(1+t),t,2,-Ei(1+t)/%e+%e^t*log(1+t)],
267+
268+
-- Exercise 25
269+
[t/%e^t,t,2,(-1)/%e^t-t/%e^t],
270+
[t^2/%e^t,t,3,(-2)/%e^t-2*t/%e^t-t^2/%e^t],
271+
[t^3/%e^t,t,4,(-6)/%e^t-6*t/%e^t-3*t^2/%e^t-t^3/%e^t],
272+
273+
-- Exercise 26
274+
[(b1*cos(x)+a1*sin(x))/(b*cos(x)+a*sin(x)),x,1,(a*a1+b*b1)*x/(a^2+b^2)-(a1*b-a*b1)*log(b*cos(x)+a*sin(x))/(a^2+b^2)],
275+
276+
-- Exercise 28
277+
[1/log(t),t,1,Li(t)],
278+
[1/log(t)^2,t,2,Li(t)-t/log(t)],
279+
[log(t)^(-1-n),t,2,-GAMMA(-n,-log(t))*(-log(t))^n/log(t)^n],
280+
[%e^(2*t)/(-1+t),t,1,%e^2*Ei(-2*(1-t))],
281+
[%e^(2*x)/(2-3*x+x^2),x,4,%e^4*Ei(-4+2*x)-%e^2*Ei(-2+2*x)],
282+
283+
-- Exercise 30
284+
[1/(1+t^3)^(1/2),t,1,2*(1+t)*elliptic_f(asin((1+t-sqrt(3))/(1+t+sqrt(3))),-7-4*sqrt(3))*sqrt(2+sqrt(3))*sqrt((1-t+t^2)/(1+t+sqrt(3))^2)/(3^(1/4)*sqrt(1+t^3)*sqrt((1+t)/(1+t+sqrt(3))^2))]]

0 commit comments

Comments
 (0)