@@ -77,7 +77,7 @@ function generate_homotopy(eq, x)
7777
7878 S += expand ((1 + h₁) * (1 + h₂))
7979 end
80-
80+
8181 S = simplify (S)
8282
8383 unique ([one (x); [equivalent (t, x) for t in terms (S)]])
@@ -91,8 +91,8 @@ function ∂(x)
9191end
9292
9393partial_int_rules = [
94- # trigonometric functions
95- @rule 𝛷 (sin (~ x)) => (cos (~ x), ∂ (~ x))
94+ # trigonometric functions
95+ @rule 𝛷 (sin (~ x)) => (cos (~ x), ∂ (~ x))
9696 @rule 𝛷 (cos (~ x)) => (sin (~ x), ∂ (~ x))
9797 @rule 𝛷 (tan (~ x)) => (log (cos (~ x)), ∂ (~ x))
9898 @rule 𝛷 (csc (~ x)) => (log (csc (~ x) + cot (~ x)), ∂ (~ x))
@@ -119,12 +119,12 @@ partial_int_rules = [
119119 @rule 𝛷 (^ (csch (~ x), - 1 )) => (cosh (~ x), ∂ (~ x))
120120 @rule 𝛷 (^ (sech (~ x), - 1 )) => (sinh (~ x), ∂ (~ x))
121121 @rule 𝛷 (^ (coth (~ x), - 1 )) => (log (cosh (~ x)), ∂ (~ x))
122- # inverse trigonometric functions
122+ # inverse trigonometric functions
123123 @rule 𝛷 (asin (~ x)) => (~ x * asin (~ x) + sqrt (1 - ~ x * ~ x), ∂ (~ x))
124124 @rule 𝛷 (acos (~ x)) => (~ x * acos (~ x) + sqrt (1 - ~ x * ~ x), ∂ (~ x))
125125 @rule 𝛷 (atan (~ x)) => (~ x * atan (~ x) + log (~ x * ~ x + 1 ), ∂ (~ x))
126- @rule 𝛷 (acsc (~ x)) => (~ x * acsc (~ x) + atanh (1 - ^ (~ x,- 2 )), ∂ (~ x))
127- @rule 𝛷 (asec (~ x)) => (~ x * asec (~ x) + acosh (~ x), ∂ (~ x))
126+ @rule 𝛷 (acsc (~ x)) => (~ x * acsc (~ x) + atanh (1 - ^ (~ x, - 2 )), ∂ (~ x))
127+ @rule 𝛷 (asec (~ x)) => (~ x * asec (~ x) + acosh (~ x), ∂ (~ x))
128128 @rule 𝛷 (acot (~ x)) => (~ x * acot (~ x) + log (~ x * ~ x + 1 ), ∂ (~ x))
129129 # inverse hyperbolic functions
130130 @rule 𝛷 (asinh (~ x)) => (~ x * asinh (~ x) + sqrt (~ x * ~ x + 1 ), ∂ (~ x))
@@ -134,19 +134,25 @@ partial_int_rules = [
134134 @rule 𝛷 (asech (~ x)) => (asech (~ x), ∂ (~ x))
135135 @rule 𝛷 (acoth (~ x)) => (~ x * acot (~ x) + log (~ x + 1 ), ∂ (~ x))
136136 # logarithmic and exponential functions
137- @rule 𝛷 (log (~ x)) => (~ x + ~ x * log (~ x) + sum (candidate_pow_minus (~ x, - 1 ); init = one (~ x)), ∂ (~ x))
137+ @rule 𝛷 (log (~ x)) => (~ x + ~ x * log (~ x) +
138+ sum (candidate_pow_minus (~ x, - 1 ); init = one (~ x)),
139+ ∂ (~ x))
138140 @rule 𝛷 (exp (~ x)) => (exp (~ x), ∂ (~ x))
139141 @rule 𝛷 (^ (exp (~ x), ~ k:: is_neg )) => (^ (exp (- ~ x), - ~ k), ∂ (~ x))
140142 # square-root functions
141- @rule 𝛷 (^ (~ x, ~ k:: is_abs_half )) => (sum (candidate_sqrt (~ x, ~ k); init = one (~ x)), 1 );
143+ @rule 𝛷 (^ (~ x, ~ k:: is_abs_half )) => (sum (candidate_sqrt (~ x, ~ k);
144+ init = one (~ x)), 1 );
142145 @rule 𝛷 (sqrt (~ x)) => (sum (candidate_sqrt (~ x, 0.5 ); init = one (~ x)), 1 );
143- @rule 𝛷 (^ (sqrt (~ x), - 1 )) => 𝛷 (^ (~ x, - 0.5 ))
144- # rational functions
145- @rule 𝛷 (^ (~ x:: is_poly , ~ k:: is_neg )) => (sum (candidate_pow_minus (~ x, ~ k); init = one (~ x)), 1 )
146+ @rule 𝛷 (^ (sqrt (~ x), - 1 )) => 𝛷 (^ (~ x, - 0.5 ))
147+ # rational functions
148+ @rule 𝛷 (^ (~ x:: is_poly , ~ k:: is_neg )) => (sum (candidate_pow_minus (~ x,
149+ ~ k);
150+ init = one (~ x)), 1 )
146151 @rule 𝛷 (^ (~ x, - 1 )) => (log (~ x), ∂ (~ x))
147- @rule 𝛷 (^ (~ x, ~ k:: is_neg_int )) => (sum (^ (~ x, i) for i in (~ k + 1 ): - 1 ), ∂ (~ x))
152+ @rule 𝛷 (^ (~ x, ~ k:: is_neg_int )) => (sum (^ (~ x, i) for i in (~ k + 1 ): - 1 ),
153+ ∂ (~ x))
148154 @rule 𝛷 (1 / ~ x) => 𝛷 (^ (~ x, - 1 ))
149- @rule 𝛷 (^ (~ x, ~ k)) => (^ (~ x, ~ k + 1 ), ∂ (~ x))
155+ @rule 𝛷 (^ (~ x, ~ k)) => (^ (~ x, ~ k + 1 ), ∂ (~ x))
150156 @rule 𝛷 (1 ) => (𝑥, 1 )
151157 @rule 𝛷 (~ x) => ((~ x + ^ (~ x, 2 )), ∂ (~ x))]
152158
0 commit comments