m2m模型翻译
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

498 lines
20 KiB

6 months ago
  1. """
  2. This code is automatically generated. Never edit it manually.
  3. For details of generating the code see `rubi_parsing_guide.md` in `parsetools`.
  4. """
  5. from sympy.external import import_module
  6. matchpy = import_module("matchpy")
  7. if matchpy:
  8. from matchpy import Pattern, ReplacementRule, CustomConstraint, is_match
  9. from sympy.integrals.rubi.utility_function import (
  10. Int, Sum, Set, With, Module, Scan, MapAnd, FalseQ,
  11. ZeroQ, NegativeQ, NonzeroQ, FreeQ, NFreeQ, List, Log, PositiveQ,
  12. PositiveIntegerQ, NegativeIntegerQ, IntegerQ, IntegersQ,
  13. ComplexNumberQ, PureComplexNumberQ, RealNumericQ, PositiveOrZeroQ,
  14. NegativeOrZeroQ, FractionOrNegativeQ, NegQ, Equal, Unequal, IntPart,
  15. FracPart, RationalQ, ProductQ, SumQ, NonsumQ, Subst, First, Rest,
  16. SqrtNumberQ, SqrtNumberSumQ, LinearQ, Sqrt, ArcCosh, Coefficient,
  17. Denominator, Hypergeometric2F1, Not, Simplify, FractionalPart,
  18. IntegerPart, AppellF1, EllipticPi, EllipticE, EllipticF, ArcTan,
  19. ArcCot, ArcCoth, ArcTanh, ArcSin, ArcSinh, ArcCos, ArcCsc, ArcSec,
  20. ArcCsch, ArcSech, Sinh, Tanh, Cosh, Sech, Csch, Coth, LessEqual, Less,
  21. Greater, GreaterEqual, FractionQ, IntLinearcQ, Expand, IndependentQ,
  22. PowerQ, IntegerPowerQ, PositiveIntegerPowerQ, FractionalPowerQ, AtomQ,
  23. ExpQ, LogQ, Head, MemberQ, TrigQ, SinQ, CosQ, TanQ, CotQ, SecQ, CscQ,
  24. Sin, Cos, Tan, Cot, Sec, Csc, HyperbolicQ, SinhQ, CoshQ, TanhQ, CothQ,
  25. SechQ, CschQ, InverseTrigQ, SinCosQ, SinhCoshQ, LeafCount, Numerator,
  26. NumberQ, NumericQ, Length, ListQ, Im, Re, InverseHyperbolicQ,
  27. InverseFunctionQ, TrigHyperbolicFreeQ, InverseFunctionFreeQ, RealQ,
  28. EqQ, FractionalPowerFreeQ, ComplexFreeQ, PolynomialQ, FactorSquareFree,
  29. PowerOfLinearQ, Exponent, QuadraticQ, LinearPairQ, BinomialParts,
  30. TrinomialParts, PolyQ, EvenQ, OddQ, PerfectSquareQ, NiceSqrtAuxQ,
  31. NiceSqrtQ, Together, PosAux, PosQ, CoefficientList, ReplaceAll,
  32. ExpandLinearProduct, GCD, ContentFactor, NumericFactor,
  33. NonnumericFactors, MakeAssocList, GensymSubst, KernelSubst,
  34. ExpandExpression, Apart, SmartApart, MatchQ,
  35. PolynomialQuotientRemainder, FreeFactors, NonfreeFactors,
  36. RemoveContentAux, RemoveContent, FreeTerms, NonfreeTerms,
  37. ExpandAlgebraicFunction, CollectReciprocals, ExpandCleanup,
  38. AlgebraicFunctionQ, Coeff, LeadTerm, RemainingTerms, LeadFactor,
  39. RemainingFactors, LeadBase, LeadDegree, Numer, Denom, hypergeom, Expon,
  40. MergeMonomials, PolynomialDivide, BinomialQ, TrinomialQ,
  41. GeneralizedBinomialQ, GeneralizedTrinomialQ, FactorSquareFreeList,
  42. PerfectPowerTest, SquareFreeFactorTest, RationalFunctionQ,
  43. RationalFunctionFactors, NonrationalFunctionFactors, Reverse,
  44. RationalFunctionExponents, RationalFunctionExpand, ExpandIntegrand,
  45. SimplerQ, SimplerSqrtQ, SumSimplerQ, BinomialDegree, TrinomialDegree,
  46. CancelCommonFactors, SimplerIntegrandQ, GeneralizedBinomialDegree,
  47. GeneralizedBinomialParts, GeneralizedTrinomialDegree,
  48. GeneralizedTrinomialParts, MonomialQ, MonomialSumQ,
  49. MinimumMonomialExponent, MonomialExponent, LinearMatchQ,
  50. PowerOfLinearMatchQ, QuadraticMatchQ, CubicMatchQ, BinomialMatchQ,
  51. TrinomialMatchQ, GeneralizedBinomialMatchQ, GeneralizedTrinomialMatchQ,
  52. QuotientOfLinearsMatchQ, PolynomialTermQ, PolynomialTerms,
  53. NonpolynomialTerms, PseudoBinomialParts, NormalizePseudoBinomial,
  54. PseudoBinomialPairQ, PseudoBinomialQ, PolynomialGCD, PolyGCD,
  55. AlgebraicFunctionFactors, NonalgebraicFunctionFactors,
  56. QuotientOfLinearsP, QuotientOfLinearsParts, QuotientOfLinearsQ,
  57. Flatten, Sort, AbsurdNumberQ, AbsurdNumberFactors,
  58. NonabsurdNumberFactors, SumSimplerAuxQ, Prepend, Drop,
  59. CombineExponents, FactorInteger, FactorAbsurdNumber,
  60. SubstForInverseFunction, SubstForFractionalPower,
  61. SubstForFractionalPowerOfQuotientOfLinears,
  62. FractionalPowerOfQuotientOfLinears, SubstForFractionalPowerQ,
  63. SubstForFractionalPowerAuxQ, FractionalPowerOfSquareQ,
  64. FractionalPowerSubexpressionQ, Apply, FactorNumericGcd,
  65. MergeableFactorQ, MergeFactor, MergeFactors, TrigSimplifyQ,
  66. TrigSimplify, TrigSimplifyRecur, Order, FactorOrder, Smallest,
  67. OrderedQ, MinimumDegree, PositiveFactors, Sign, NonpositiveFactors,
  68. PolynomialInAuxQ, PolynomialInQ, ExponentInAux, ExponentIn,
  69. PolynomialInSubstAux, PolynomialInSubst, Distrib, DistributeDegree,
  70. FunctionOfPower, DivideDegreesOfFactors, MonomialFactor, FullSimplify,
  71. FunctionOfLinearSubst, FunctionOfLinear, NormalizeIntegrand,
  72. NormalizeIntegrandAux, NormalizeIntegrandFactor,
  73. NormalizeIntegrandFactorBase, NormalizeTogether,
  74. NormalizeLeadTermSigns, AbsorbMinusSign, NormalizeSumFactors,
  75. SignOfFactor, NormalizePowerOfLinear, SimplifyIntegrand, SimplifyTerm,
  76. TogetherSimplify, SmartSimplify, SubstForExpn, ExpandToSum, UnifySum,
  77. UnifyTerms, UnifyTerm, CalculusQ, FunctionOfInverseLinear,
  78. PureFunctionOfSinhQ, PureFunctionOfTanhQ, PureFunctionOfCoshQ,
  79. IntegerQuotientQ, OddQuotientQ, EvenQuotientQ, FindTrigFactor,
  80. FunctionOfSinhQ, FunctionOfCoshQ, OddHyperbolicPowerQ, FunctionOfTanhQ,
  81. FunctionOfTanhWeight, FunctionOfHyperbolicQ, SmartNumerator,
  82. SmartDenominator, SubstForAux, ActivateTrig, ExpandTrig, TrigExpand,
  83. SubstForTrig, SubstForHyperbolic, InertTrigFreeQ, LCM,
  84. SubstForFractionalPowerOfLinear, FractionalPowerOfLinear,
  85. InverseFunctionOfLinear, InertTrigQ, InertReciprocalQ, DeactivateTrig,
  86. FixInertTrigFunction, DeactivateTrigAux, PowerOfInertTrigSumQ,
  87. PiecewiseLinearQ, KnownTrigIntegrandQ, KnownSineIntegrandQ,
  88. KnownTangentIntegrandQ, KnownCotangentIntegrandQ,
  89. KnownSecantIntegrandQ, TryPureTanSubst, TryTanhSubst, TryPureTanhSubst,
  90. AbsurdNumberGCD, AbsurdNumberGCDList, ExpandTrigExpand,
  91. ExpandTrigReduce, ExpandTrigReduceAux, NormalizeTrig, TrigToExp,
  92. ExpandTrigToExp, TrigReduce, FunctionOfTrig, AlgebraicTrigFunctionQ,
  93. FunctionOfHyperbolic, FunctionOfQ, FunctionOfExpnQ, PureFunctionOfSinQ,
  94. PureFunctionOfCosQ, PureFunctionOfTanQ, PureFunctionOfCotQ,
  95. FunctionOfCosQ, FunctionOfSinQ, OddTrigPowerQ, FunctionOfTanQ,
  96. FunctionOfTanWeight, FunctionOfTrigQ, FunctionOfDensePolynomialsQ,
  97. FunctionOfLog, PowerVariableExpn, PowerVariableDegree,
  98. PowerVariableSubst, EulerIntegrandQ, FunctionOfSquareRootOfQuadratic,
  99. SquareRootOfQuadraticSubst, Divides, EasyDQ, ProductOfLinearPowersQ,
  100. Rt, NthRoot, AtomBaseQ, SumBaseQ, NegSumBaseQ, AllNegTermQ,
  101. SomeNegTermQ, TrigSquareQ, RtAux, TrigSquare, IntSum, IntTerm, Map2,
  102. ConstantFactor, SameQ, ReplacePart, CommonFactors,
  103. MostMainFactorPosition, FunctionOfExponentialQ, FunctionOfExponential,
  104. FunctionOfExponentialFunction, FunctionOfExponentialFunctionAux,
  105. FunctionOfExponentialTest, FunctionOfExponentialTestAux, stdev,
  106. rubi_test, If, IntQuadraticQ, IntBinomialQ, RectifyTangent,
  107. RectifyCotangent, Inequality, Condition, Simp, SimpHelp, SplitProduct,
  108. SplitSum, SubstFor, SubstForAux, FresnelS, FresnelC, Erfc, Erfi, Gamma,
  109. FunctionOfTrigOfLinearQ, ElementaryFunctionQ, Complex, UnsameQ,
  110. _SimpFixFactor, SimpFixFactor, _FixSimplify, FixSimplify,
  111. _SimplifyAntiderivativeSum, SimplifyAntiderivativeSum,
  112. _SimplifyAntiderivative, SimplifyAntiderivative, _TrigSimplifyAux,
  113. TrigSimplifyAux, Cancel, Part, PolyLog, D, Dist, Sum_doit, PolynomialQuotient, Floor,
  114. PolynomialRemainder, Factor, PolyLog, CosIntegral, SinIntegral, LogIntegral, SinhIntegral,
  115. CoshIntegral, Rule, Erf, PolyGamma, ExpIntegralEi, ExpIntegralE, LogGamma , UtilityOperator, Factorial,
  116. Zeta, ProductLog, DerivativeDivides, HypergeometricPFQ, IntHide, OneQ, Null, rubi_exp as exp, rubi_log as log, Discriminant,
  117. Negative, Quotient
  118. )
  119. from sympy.core.add import Add
  120. from sympy.core.mod import Mod
  121. from sympy.core.mul import Mul
  122. from sympy.core import EulerGamma
  123. from sympy.core.numbers import (Float, I, Integer)
  124. from sympy.core.power import Pow
  125. from sympy.core.singleton import S
  126. from sympy.functions.elementary.complexes import (Abs, sign)
  127. from sympy.functions.elementary.miscellaneous import sqrt
  128. from sympy.integrals.integrals import Integral
  129. from sympy.logic.boolalg import (And, Or)
  130. from sympy.simplify.simplify import simplify
  131. from sympy.integrals.rubi.symbol import WC
  132. from sympy.core.symbol import symbols, Symbol
  133. from sympy.functions import (sin, cos, tan, cot, csc, sec, sqrt, erf)
  134. from sympy.functions.elementary.hyperbolic import (acosh, asinh, atanh, acoth, acsch, asech, cosh, sinh, tanh, coth, sech, csch)
  135. from sympy.functions.elementary.trigonometric import (atan, acsc, asin, acot, acos, asec, atan2)
  136. from sympy.core.numbers import pi as Pi
  137. A_, B_, C_, F_, G_, H_, a_, b_, c_, d_, e_, f_, g_, h_, i_, j_, k_, l_, m_, n_, p_, q_, r_, t_, u_, v_, s_, w_, x_, y_, z_ = [WC(i) for i in 'ABCFGHabcdefghijklmnpqrtuvswxyz']
  138. a1_, a2_, b1_, b2_, c1_, c2_, d1_, d2_, n1_, n2_, e1_, e2_, f1_, f2_, g1_, g2_, n1_, n2_, n3_, Pq_, Pm_, Px_, Qm_, Qr_, Qx_, jn_, mn_, non2_, RFx_, RGx_ = [WC(i) for i in ['a1', 'a2', 'b1', 'b2', 'c1', 'c2', 'd1', 'd2', 'n1', 'n2', 'e1', 'e2', 'f1', 'f2', 'g1', 'g2', 'n1', 'n2', 'n3', 'Pq', 'Pm', 'Px', 'Qm', 'Qr', 'Qx', 'jn', 'mn', 'non2', 'RFx', 'RGx']]
  139. i, ii, Pqq, Q, R, r, C, k, u = symbols('i ii Pqq Q R r C k u')
  140. _UseGamma = False
  141. ShowSteps = False
  142. StepCounter = None
  143. def piecewise_linear():
  144. from sympy.integrals.rubi.constraints import cons1092, cons19, cons1093, cons89, cons90, cons1094, cons91, cons25, cons74, cons68, cons4, cons1095, cons216, cons685, cons102, cons103, cons1096, cons1097, cons33, cons96, cons358, cons1098, cons21, cons1099, cons2, cons3
  145. pattern1885 = Pattern(Integral(u_**WC('m', S(1)), x_), cons19, cons1092)
  146. rule1885 = ReplacementRule(pattern1885, With1885)
  147. pattern1886 = Pattern(Integral(v_/u_, x_), cons1093, CustomConstraint(With1886))
  148. rule1886 = ReplacementRule(pattern1886, replacement1886)
  149. pattern1887 = Pattern(Integral(v_**n_/u_, x_), cons1093, cons89, cons90, cons1094, CustomConstraint(With1887))
  150. rule1887 = ReplacementRule(pattern1887, replacement1887)
  151. pattern1888 = Pattern(Integral(S(1)/(u_*v_), x_), cons1093, CustomConstraint(With1888))
  152. rule1888 = ReplacementRule(pattern1888, replacement1888)
  153. pattern1889 = Pattern(Integral(S(1)/(u_*sqrt(v_)), x_), cons1093, CustomConstraint(With1889))
  154. rule1889 = ReplacementRule(pattern1889, replacement1889)
  155. pattern1890 = Pattern(Integral(S(1)/(u_*sqrt(v_)), x_), cons1093, CustomConstraint(With1890))
  156. rule1890 = ReplacementRule(pattern1890, replacement1890)
  157. pattern1891 = Pattern(Integral(v_**n_/u_, x_), cons1093, cons89, cons91, CustomConstraint(With1891))
  158. rule1891 = ReplacementRule(pattern1891, replacement1891)
  159. pattern1892 = Pattern(Integral(v_**n_/u_, x_), cons1093, cons25, CustomConstraint(With1892))
  160. rule1892 = ReplacementRule(pattern1892, replacement1892)
  161. pattern1893 = Pattern(Integral(S(1)/(sqrt(u_)*sqrt(v_)), x_), cons1093, CustomConstraint(With1893))
  162. rule1893 = ReplacementRule(pattern1893, replacement1893)
  163. pattern1894 = Pattern(Integral(S(1)/(sqrt(u_)*sqrt(v_)), x_), cons1093, CustomConstraint(With1894))
  164. rule1894 = ReplacementRule(pattern1894, replacement1894)
  165. pattern1895 = Pattern(Integral(u_**m_*v_**n_, x_), cons19, cons4, cons1093, cons74, cons68, CustomConstraint(With1895))
  166. rule1895 = ReplacementRule(pattern1895, replacement1895)
  167. pattern1896 = Pattern(Integral(u_**m_*v_**WC('n', S(1)), x_), cons19, cons4, cons1093, cons68, cons1095, CustomConstraint(With1896))
  168. rule1896 = ReplacementRule(pattern1896, replacement1896)
  169. pattern1897 = Pattern(Integral(u_**m_*v_**WC('n', S(1)), x_), cons1093, cons216, cons89, cons90, cons685, cons102, cons103, CustomConstraint(With1897))
  170. rule1897 = ReplacementRule(pattern1897, replacement1897)
  171. pattern1898 = Pattern(Integral(u_**m_*v_**n_, x_), cons1093, cons685, cons1096, cons1097, CustomConstraint(With1898))
  172. rule1898 = ReplacementRule(pattern1898, replacement1898)
  173. pattern1899 = Pattern(Integral(u_**m_*v_**n_, x_), cons1093, cons216, cons33, cons96, CustomConstraint(With1899))
  174. rule1899 = ReplacementRule(pattern1899, replacement1899)
  175. pattern1900 = Pattern(Integral(u_**m_*v_**n_, x_), cons1093, cons358, cons1098, CustomConstraint(With1900))
  176. rule1900 = ReplacementRule(pattern1900, replacement1900)
  177. pattern1901 = Pattern(Integral(u_**m_*v_**n_, x_), cons1093, cons21, cons25, CustomConstraint(With1901))
  178. rule1901 = ReplacementRule(pattern1901, replacement1901)
  179. pattern1902 = Pattern(Integral(u_**WC('n', S(1))*log(x_*WC('b', S(1)) + WC('a', S(0))), x_), cons2, cons3, cons1092, cons1099, cons89, cons90)
  180. rule1902 = ReplacementRule(pattern1902, With1902)
  181. pattern1903 = Pattern(Integral(u_**WC('n', S(1))*(x_*WC('b', S(1)) + WC('a', S(0)))**WC('m', S(1))*log(x_*WC('b', S(1)) + WC('a', S(0))), x_), cons2, cons3, cons19, cons1092, cons1099, cons89, cons90, cons68)
  182. rule1903 = ReplacementRule(pattern1903, With1903)
  183. return [rule1885, rule1886, rule1887, rule1888, rule1889, rule1890, rule1891, rule1892, rule1893, rule1894, rule1895, rule1896, rule1897, rule1898, rule1899, rule1900, rule1901, rule1902, rule1903, ]
  184. def With1885(m, u, x):
  185. c = D(u, x)
  186. return Dist(S(1)/c, Subst(Int(x**m, x), x, u), x)
  187. def With1886(u, v, x):
  188. if isinstance(x, (int, Integer, float, Float)):
  189. return False
  190. a = D(u, x)
  191. b = D(v, x)
  192. if NonzeroQ(-a*v + b*u):
  193. return True
  194. return False
  195. def replacement1886(u, v, x):
  196. a = D(u, x)
  197. b = D(v, x)
  198. return -Dist((-a*v + b*u)/a, Int(S(1)/u, x), x) + Simp(b*x/a, x)
  199. def With1887(n, u, v, x):
  200. if isinstance(x, (int, Integer, float, Float)):
  201. return False
  202. a = D(u, x)
  203. b = D(v, x)
  204. if NonzeroQ(-a*v + b*u):
  205. return True
  206. return False
  207. def replacement1887(n, u, v, x):
  208. a = D(u, x)
  209. b = D(v, x)
  210. return -Dist((-a*v + b*u)/a, Int(v**(n + S(-1))/u, x), x) + Simp(v**n/(a*n), x)
  211. def With1888(u, v, x):
  212. if isinstance(x, (int, Integer, float, Float)):
  213. return False
  214. a = D(u, x)
  215. b = D(v, x)
  216. if NonzeroQ(-a*v + b*u):
  217. return True
  218. return False
  219. def replacement1888(u, v, x):
  220. a = D(u, x)
  221. b = D(v, x)
  222. return -Dist(a/(-a*v + b*u), Int(S(1)/u, x), x) + Dist(b/(-a*v + b*u), Int(S(1)/v, x), x)
  223. def With1889(u, v, x):
  224. if isinstance(x, (int, Integer, float, Float)):
  225. return False
  226. a = D(u, x)
  227. b = D(v, x)
  228. if And(NonzeroQ(-a*v + b*u), PosQ((-a*v + b*u)/a)):
  229. return True
  230. return False
  231. def replacement1889(u, v, x):
  232. a = D(u, x)
  233. b = D(v, x)
  234. return Simp(S(2)*ArcTan(sqrt(v)/Rt((-a*v + b*u)/a, S(2)))/(a*Rt((-a*v + b*u)/a, S(2))), x)
  235. def With1890(u, v, x):
  236. if isinstance(x, (int, Integer, float, Float)):
  237. return False
  238. a = D(u, x)
  239. b = D(v, x)
  240. if And(NonzeroQ(-a*v + b*u), NegQ((-a*v + b*u)/a)):
  241. return True
  242. return False
  243. def replacement1890(u, v, x):
  244. a = D(u, x)
  245. b = D(v, x)
  246. return Simp(-S(2)*atanh(sqrt(v)/Rt(-(-a*v + b*u)/a, S(2)))/(a*Rt(-(-a*v + b*u)/a, S(2))), x)
  247. def With1891(n, u, v, x):
  248. if isinstance(x, (int, Integer, float, Float)):
  249. return False
  250. a = D(u, x)
  251. b = D(v, x)
  252. if NonzeroQ(-a*v + b*u):
  253. return True
  254. return False
  255. def replacement1891(n, u, v, x):
  256. a = D(u, x)
  257. b = D(v, x)
  258. return -Dist(a/(-a*v + b*u), Int(v**(n + S(1))/u, x), x) + Simp(v**(n + S(1))/((n + S(1))*(-a*v + b*u)), x)
  259. def With1892(n, u, v, x):
  260. if isinstance(x, (int, Integer, float, Float)):
  261. return False
  262. a = D(u, x)
  263. b = D(v, x)
  264. if NonzeroQ(-a*v + b*u):
  265. return True
  266. return False
  267. def replacement1892(n, u, v, x):
  268. a = D(u, x)
  269. b = D(v, x)
  270. return Simp(v**(n + S(1))*Hypergeometric2F1(S(1), n + S(1), n + S(2), -a*v/(-a*v + b*u))/((n + S(1))*(-a*v + b*u)), x)
  271. def With1893(u, v, x):
  272. if isinstance(x, (int, Integer, float, Float)):
  273. return False
  274. a = D(u, x)
  275. b = D(v, x)
  276. if And(NonzeroQ(-a*v + b*u), PosQ(a*b)):
  277. return True
  278. return False
  279. def replacement1893(u, v, x):
  280. a = D(u, x)
  281. b = D(v, x)
  282. return Simp(S(2)*atanh(sqrt(u)*Rt(a*b, S(2))/(a*sqrt(v)))/Rt(a*b, S(2)), x)
  283. def With1894(u, v, x):
  284. if isinstance(x, (int, Integer, float, Float)):
  285. return False
  286. a = D(u, x)
  287. b = D(v, x)
  288. if And(NonzeroQ(-a*v + b*u), NegQ(a*b)):
  289. return True
  290. return False
  291. def replacement1894(u, v, x):
  292. a = D(u, x)
  293. b = D(v, x)
  294. return Simp(S(2)*ArcTan(sqrt(u)*Rt(-a*b, S(2))/(a*sqrt(v)))/Rt(-a*b, S(2)), x)
  295. def With1895(m, n, u, v, x):
  296. if isinstance(x, (int, Integer, float, Float)):
  297. return False
  298. a = D(u, x)
  299. b = D(v, x)
  300. if NonzeroQ(-a*v + b*u):
  301. return True
  302. return False
  303. def replacement1895(m, n, u, v, x):
  304. a = D(u, x)
  305. b = D(v, x)
  306. return -Simp(u**(m + S(1))*v**(n + S(1))/((m + S(1))*(-a*v + b*u)), x)
  307. def With1896(m, n, u, v, x):
  308. if isinstance(x, (int, Integer, float, Float)):
  309. return False
  310. a = D(u, x)
  311. b = D(v, x)
  312. if NonzeroQ(-a*v + b*u):
  313. return True
  314. return False
  315. def replacement1896(m, n, u, v, x):
  316. a = D(u, x)
  317. b = D(v, x)
  318. return -Dist(b*n/(a*(m + S(1))), Int(u**(m + S(1))*v**(n + S(-1)), x), x) + Simp(u**(m + S(1))*v**n/(a*(m + S(1))), x)
  319. def With1897(m, n, u, v, x):
  320. if isinstance(x, (int, Integer, float, Float)):
  321. return False
  322. a = D(u, x)
  323. b = D(v, x)
  324. if NonzeroQ(-a*v + b*u):
  325. return True
  326. return False
  327. def replacement1897(m, n, u, v, x):
  328. a = D(u, x)
  329. b = D(v, x)
  330. return -Dist(n*(-a*v + b*u)/(a*(m + n + S(1))), Int(u**m*v**(n + S(-1)), x), x) + Simp(u**(m + S(1))*v**n/(a*(m + n + S(1))), x)
  331. def With1898(m, n, u, v, x):
  332. if isinstance(x, (int, Integer, float, Float)):
  333. return False
  334. a = D(u, x)
  335. b = D(v, x)
  336. if NonzeroQ(-a*v + b*u):
  337. return True
  338. return False
  339. def replacement1898(m, n, u, v, x):
  340. a = D(u, x)
  341. b = D(v, x)
  342. return -Dist(n*(-a*v + b*u)/(a*(m + n + S(1))), Int(u**m*v**(n + S(-1)), x), x) + Simp(u**(m + S(1))*v**n/(a*(m + n + S(1))), x)
  343. def With1899(m, n, u, v, x):
  344. if isinstance(x, (int, Integer, float, Float)):
  345. return False
  346. a = D(u, x)
  347. b = D(v, x)
  348. if NonzeroQ(-a*v + b*u):
  349. return True
  350. return False
  351. def replacement1899(m, n, u, v, x):
  352. a = D(u, x)
  353. b = D(v, x)
  354. return Dist(b*(m + n + S(2))/((m + S(1))*(-a*v + b*u)), Int(u**(m + S(1))*v**n, x), x) - Simp(u**(m + S(1))*v**(n + S(1))/((m + S(1))*(-a*v + b*u)), x)
  355. def With1900(m, n, u, v, x):
  356. if isinstance(x, (int, Integer, float, Float)):
  357. return False
  358. a = D(u, x)
  359. b = D(v, x)
  360. if NonzeroQ(-a*v + b*u):
  361. return True
  362. return False
  363. def replacement1900(m, n, u, v, x):
  364. a = D(u, x)
  365. b = D(v, x)
  366. return Dist(b*(m + n + S(2))/((m + S(1))*(-a*v + b*u)), Int(u**(m + S(1))*v**n, x), x) - Simp(u**(m + S(1))*v**(n + S(1))/((m + S(1))*(-a*v + b*u)), x)
  367. def With1901(m, n, u, v, x):
  368. if isinstance(x, (int, Integer, float, Float)):
  369. return False
  370. a = D(u, x)
  371. b = D(v, x)
  372. if NonzeroQ(-a*v + b*u):
  373. return True
  374. return False
  375. def replacement1901(m, n, u, v, x):
  376. a = D(u, x)
  377. b = D(v, x)
  378. return Simp(u**m*v**(n + S(1))*(b*u/(-a*v + b*u))**(-m)*Hypergeometric2F1(-m, n + S(1), n + S(2), -a*v/(-a*v + b*u))/(b*(n + S(1))), x)
  379. def With1902(a, b, n, u, x):
  380. c = D(u, x)
  381. return -Dist(c*n/b, Int(u**(n + S(-1))*(a + b*x)*log(a + b*x), x), x) - Int(u**n, x) + Simp(u**n*(a + b*x)*log(a + b*x)/b, x)
  382. def With1903(a, b, m, n, u, x):
  383. c = D(u, x)
  384. return -Dist(c*n/(b*(m + S(1))), Int(u**(n + S(-1))*(a + b*x)**(m + S(1))*log(a + b*x), x), x) - Dist(S(1)/(m + S(1)), Int(u**n*(a + b*x)**m, x), x) + Simp(u**n*(a + b*x)**(m + S(1))*log(a + b*x)/(b*(m + S(1))), x)