package org.matheclipse.core.integrate.rubi42;
import static org.matheclipse.core.expression.F.*;
import static org.matheclipse.core.integrate.rubi42.UtilityFunctionCtors.*;
import static org.matheclipse.core.integrate.rubi42.UtilityFunctions.*;
import org.matheclipse.core.interfaces.IAST;
import org.matheclipse.core.interfaces.IExpr;
import org.matheclipse.core.interfaces.ISymbol;
/**
* UtilityFunctions rules from the Rubi -
* rule-based integrator.
*
*/
public class UtilityFunctions1 {
public static IAST RULES = List(
SetDelayed(LE($p(u),$p(v)),
And(And(RealNumericQ(u),RealNumericQ(v)),LessEqual(Re(N(u)),Re(N(v))))),
SetDelayed(LE($p(u),$p(v),$p(w)),
And(LE(u,v),LE(v,w))),
SetDelayed(GT($p(u),$p(v)),
And(And(RealNumericQ(u),RealNumericQ(v)),Greater(Re(N(u)),Re(N(v))))),
SetDelayed(GT($p(u),$p(v),$p(w)),
And(GT(u,v),GT(v,w))),
SetDelayed(GE($p(u),$p(v)),
And(And(RealNumericQ(u),RealNumericQ(v)),GreaterEqual(Re(N(u)),Re(N(v))))),
SetDelayed(GE($p(u),$p(v),$p(w)),
And(GE(u,v),GE(v,w))),
SetDelayed(IndependentQ($p(u),$p(x)),
FreeQ(u,x)),
SetDelayed(FreeFactors($p(u),$p(x)),
If(ProductQ(u),Map(Function(If(FreeQ(Slot1,x),Slot1,C1)),u),If(FreeQ(u,x),u,C1))),
SetDelayed(NonfreeFactors($p(u),$p(x)),
If(ProductQ(u),Map(Function(If(FreeQ(Slot1,x),C1,Slot1)),u),If(FreeQ(u,x),C1,u))),
SetDelayed(SplitFreeFactors($p(u),$p(x)),
If(ProductQ(u),Map(Function(If(FreeQ(Slot1,x),List(Slot1,C1),List(C1,Slot1))),u),If(FreeQ(u,x),List(u,C1),List(C1,u)))),
SetDelayed(FreeTerms($p(u),$p(x)),
If(SumQ(u),Map(Function(If(FreeQ(Slot1,x),Slot1,C0)),u),If(FreeQ(u,x),u,C0))),
SetDelayed(NonfreeTerms($p(u),$p(x)),
If(SumQ(u),Map(Function(If(FreeQ(Slot1,x),C0,Slot1)),u),If(FreeQ(u,x),C0,u))),
SetDelayed(LinearQ($p(u),$p(x,SymbolHead)),
PolyQ(u,x,C1)),
SetDelayed(PowerOfLinearQ(Power($p(u),$p(m,true)),$p(x,SymbolHead)),
And(And(FreeQ(m,x),PolynomialQ(u,x)),If(IntegerQ(m),MatchQ(FactorSquareFree(u),Condition(Power($p(w),$p(n,true)),And(FreeQ(n,x),LinearQ(w,x)))),LinearQ(u,x)))),
SetDelayed(QuadraticQ($p(u),$p(x,SymbolHead)),
PolyQ(u,x,C2)),
SetDelayed(PolyQ($p(u),$p(x,SymbolHead),$p(n,IntegerHead)),
If(ListQ(u),Catch(CompoundExpression(Scan(Function(If(Not(PolyQ(Slot1,x,n)),Throw(False))),u),True)),And(PolynomialQ(u,x),Equal(Exponent(u,x),n)))),
SetDelayed(LinearPairQ($p(u),$p(v),$p(x,SymbolHead)),
And(And(And(LinearQ(u,x),LinearQ(v,x)),NonzeroQ(Plus(u,Times(CN1,x)))),ZeroQ(Plus(Times(Coefficient(u,x,C0),Coefficient(v,x,C1)),Times(CN1,Coefficient(u,x,C1),Coefficient(v,x,C0)))))),
SetDelayed(BinomialQ($p(u),$p(x,SymbolHead)),
If(ListQ(u),Catch(CompoundExpression(Scan(Function(If(Not(BinomialQ(Slot1,x)),Throw(False))),u),True)),NotFalseQ(BinomialTest(u,x)))),
SetDelayed(BinomialQ($p(u),$p(x,SymbolHead),$p(n)),
If(ListQ(u),Catch(CompoundExpression(Scan(Function(If(Not(BinomialQ(Slot1,x,n)),Throw(False))),u),True)),$(Function(And(NotFalseQ(Slot1),SameQ(Part(Slot1,C3),n))),BinomialTest(u,x)))),
SetDelayed(GeneralizedBinomialQ($p(u),$p(x,SymbolHead)),
If(ListQ(u),Catch(CompoundExpression(Scan(Function(If(Not(GeneralizedBinomialQ(Slot1,x)),Throw(False))),u),True)),NotFalseQ(GeneralizedBinomialTest(u,x)))),
SetDelayed(TrinomialQ($p(u),$p(x,SymbolHead)),
If(ListQ(u),Catch(CompoundExpression(Scan(Function(If(Not(TrinomialQ(Slot1,x)),Throw(False))),u),True)),And(And(NotFalseQ(TrinomialTest(u,x)),Not(QuadraticQ(u,x))),Not(MatchQ(u,Condition(Power($p(w),C2),BinomialQ(w,x))))))),
SetDelayed(GeneralizedTrinomialQ($p(u),$p(x,SymbolHead)),
If(ListQ(u),Catch(CompoundExpression(Scan(Function(If(Not(GeneralizedTrinomialQ(Slot1,x)),Throw(False))),u),True)),NotFalseQ(GeneralizedTrinomialTest(u,x)))),
SetDelayed(MonomialQ($p(u),$p(x,SymbolHead)),
If(ListQ(u),Catch(CompoundExpression(Scan(Function(If(MonomialQ(Slot1,x),Null,Throw(False))),u),True)),MatchQ(u,Condition(Times($p(a,true),Power(x,$p(n,true))),FreeQ(List(a,n),x))))),
SetDelayed(MonomialSumQ($p(u),$p(x,SymbolHead)),
And(SumQ(u),Catch(CompoundExpression(Scan(Function(If(Or(FreeQ(Slot1,x),MonomialQ(Slot1,x)),Null,Throw(False))),u),True)))),
SetDelayed(MinimumMonomialExponent($p(u),$p(x,SymbolHead)),
Module(List(Set(n,MonomialExponent(First(u),x))),CompoundExpression(Scan(Function(If(PosQ(Plus(n,Times(CN1,MonomialExponent(Slot1,x)))),Set(n,MonomialExponent(Slot1,x)))),u),n))),
SetDelayed(MonomialExponent(Times(Power($p(x),$p(n,true)),$p(a,true)),$p(x,SymbolHead)),
Condition(n,FreeQ(List(a,n),x))),
SetDelayed(LinearMatchQ($p(u),$p(x,SymbolHead)),
If(ListQ(u),Catch(CompoundExpression(Scan(Function(If(Not(LinearMatchQ(Slot1,x)),Throw(False))),u),True)),MatchQ(u,Condition(Plus($p(a,true),Times($p(b,true),x)),FreeQ(List(a,b),x))))),
SetDelayed(PowerOfLinearMatchQ($p(u),$p(x,SymbolHead)),
If(ListQ(u),Catch(CompoundExpression(Scan(Function(If(Not(PowerOfLinearMatchQ(Slot1,x)),Throw(False))),u),True)),MatchQ(u,Condition(Power(Plus($p(a,true),Times($p(b,true),x)),$p(m,true)),FreeQ(List(a,b,m),x))))),
SetDelayed(QuadraticMatchQ($p(u),$p(x,SymbolHead)),
If(ListQ(u),Catch(CompoundExpression(Scan(Function(If(Not(QuadraticMatchQ(Slot1,x)),Throw(False))),u),True)),Or(MatchQ(u,Condition(Plus($p(a,true),Times($p(b,true),x),Times($p(c,true),Power(x,C2))),FreeQ(List(a,b,c),x))),MatchQ(u,Condition(Plus($p(a,true),Times($p(c,true),Power(x,C2))),FreeQ(List(a,c),x)))))),
SetDelayed(CubicMatchQ($p(u),$p(x,SymbolHead)),
If(ListQ(u),Catch(CompoundExpression(Scan(Function(If(Not(CubicMatchQ(Slot1,x)),Throw(False))),u),True)),Or(Or(Or(MatchQ(u,Condition(Plus($p(a,true),Times($p(b,true),x),Times($p(c,true),Power(x,C2)),Times($p(d,true),Power(x,C3))),FreeQ(List(a,b,c,d),x))),MatchQ(u,Condition(Plus($p(a,true),Times($p(b,true),x),Times($p(d,true),Power(x,C3))),FreeQ(List(a,b,d),x)))),MatchQ(u,Condition(Plus($p(a,true),Times($p(c,true),Power(x,C2)),Times($p(d,true),Power(x,C3))),FreeQ(List(a,c,d),x)))),MatchQ(u,Condition(Plus($p(a,true),Times($p(d,true),Power(x,C3))),FreeQ(List(a,d),x)))))),
SetDelayed(BinomialMatchQ($p(u),$p(x,SymbolHead)),
If(ListQ(u),Catch(CompoundExpression(Scan(Function(If(Not(BinomialMatchQ(Slot1,x)),Throw(False))),u),True)),MatchQ(u,Condition(Plus($p(a,true),Times($p(b,true),Power(x,$p(n,true)))),FreeQ(List(a,b,n),x))))),
SetDelayed(GeneralizedBinomialMatchQ($p(u),$p(x,SymbolHead)),
If(ListQ(u),Catch(CompoundExpression(Scan(Function(If(Not(GeneralizedBinomialMatchQ(Slot1,x)),Throw(False))),u),True)),MatchQ(u,Condition(Plus(Times($p(a,true),Power(x,$p(q,true))),Times($p(b,true),Power(x,$p(n,true)))),FreeQ(List(a,b,n,q),x))))),
SetDelayed(TrinomialMatchQ($p(u),$p(x,SymbolHead)),
If(ListQ(u),Catch(CompoundExpression(Scan(Function(If(Not(TrinomialMatchQ(Slot1,x)),Throw(False))),u),True)),MatchQ(u,Condition(Plus($p(a,true),Times($p(b,true),Power(x,$p(n,true))),Times($p(c,true),Power(x,$p(j,true)))),And(FreeQ(List(a,b,c,n),x),ZeroQ(Plus(j,Times(CN1,C2,n)))))))),
SetDelayed(GeneralizedTrinomialMatchQ($p(u),$p(x,SymbolHead)),
If(ListQ(u),Catch(CompoundExpression(Scan(Function(If(Not(GeneralizedTrinomialMatchQ(Slot1,x)),Throw(False))),u),True)),MatchQ(u,Condition(Plus(Times($p(a,true),Power(x,$p(q,true))),Times($p(b,true),Power(x,$p(n,true))),Times($p(c,true),Power(x,$p(r,true)))),And(FreeQ(List(a,b,c,n,q),x),ZeroQ(Plus(r,Times(CN1,Plus(Times(C2,n),Times(CN1,q)))))))))),
SetDelayed(QuotientOfLinearsMatchQ($p(u),$p(x,SymbolHead)),
If(ListQ(u),Catch(CompoundExpression(Scan(Function(If(Not(QuotientOfLinearsMatchQ(Slot1,x)),Throw(False))),u),True)),MatchQ(u,Condition(Times($p(e,true),Plus($p(a,true),Times($p(b,true),x)),Power(Plus($p(c,true),Times($p(d,true),x)),CN1)),FreeQ(List(a,b,c,d,e),x))))),
SetDelayed(PolynomialTermQ($p(u),$p(x,SymbolHead)),
Or(FreeQ(u,x),MatchQ(u,Condition(Times($p(a,true),Power(x,$p(n,true))),And(And(FreeQ(a,x),IntegerQ(n)),Greater(n,C0)))))),
SetDelayed(PolynomialTerms($p(u),$p(x,SymbolHead)),
Map(Function(If(PolynomialTermQ(Slot1,x),Slot1,C0)),u)),
SetDelayed(NonpolynomialTerms($p(u),$p(x,SymbolHead)),
Map(Function(If(PolynomialTermQ(Slot1,x),C0,Slot1)),u)),
SetDelayed(BinomialDegree($p(u),$p(x,SymbolHead)),
Part(BinomialTest(u,x),C3)),
SetDelayed(BinomialTest($p(u),$p(x,SymbolHead)),
If(PolynomialQ(u,x),If(Greater(Exponent(u,x),C0),Module(List(Set($s("lst"),Exponent(u,x,$s("List")))),If(Equal(Length($s("lst")),C1),List(C0,Coefficient(u,x,Exponent(u,x)),Exponent(u,x)),If(And(Equal(Length($s("lst")),C2),Equal(Part($s("lst"),C1),C0)),List(Coefficient(u,x,C0),Coefficient(u,x,Exponent(u,x)),Exponent(u,x)),False))),False),If(PowerQ(u),If(And(SameQ(Part(u,C1),x),FreeQ(Part(u,C2),x)),List(C0,C1,Part(u,C2)),False),Module(List($s("lst1"),$s("lst2")),If(ProductQ(u),If(FreeQ(First(u),x),CompoundExpression(Set($s("lst2"),BinomialTest(Rest(u),x)),If(FalseQ($s("lst2")),False,List(Times(First(u),Part($s("lst2"),C1)),Times(First(u),Part($s("lst2"),C2)),Part($s("lst2"),C3)))),If(FreeQ(Rest(u),x),CompoundExpression(Set($s("lst1"),BinomialTest(First(u),x)),If(FalseQ($s("lst1")),False,List(Times(Rest(u),Part($s("lst1"),C1)),Times(Rest(u),Part($s("lst1"),C2)),Part($s("lst1"),C3)))),CompoundExpression(CompoundExpression(Set($s("lst1"),BinomialTest(First(u),x)),Set($s("lst2"),BinomialTest(Rest(u),x))),If(Or(FalseQ($s("lst1")),FalseQ($s("lst2"))),False,Module(List(a,b,c,d,m,n),CompoundExpression(CompoundExpression(Set(List(a,b,m),$s("lst1")),Set(List(c,d,n),$s("lst2"))),If(ZeroQ(a),If(ZeroQ(c),List(C0,Times(b,d),Plus(m,n)),If(ZeroQ(Plus(m,n)),List(Times(b,d),Times(b,c),m),False)),If(ZeroQ(c),If(ZeroQ(Plus(m,n)),List(Times(b,d),Times(a,d),n),False),If(And(ZeroQ(Plus(m,Times(CN1,n))),ZeroQ(Plus(Times(a,d),Times(b,c)))),List(Times(a,c),Times(b,d),Times(C2,m)),False))))))))),If(SumQ(u),If(FreeQ(First(u),x),CompoundExpression(Set($s("lst2"),BinomialTest(Rest(u),x)),If(FalseQ($s("lst2")),False,List(Plus(First(u),Part($s("lst2"),C1)),Part($s("lst2"),C2),Part($s("lst2"),C3)))),If(FreeQ(Rest(u),x),CompoundExpression(Set($s("lst1"),BinomialTest(First(u),x)),If(FalseQ($s("lst1")),False,List(Plus(Rest(u),Part($s("lst1"),C1)),Part($s("lst1"),C2),Part($s("lst1"),C3)))),CompoundExpression(CompoundExpression(Set($s("lst1"),BinomialTest(First(u),x)),Set($s("lst2"),BinomialTest(Rest(u),x))),If(Or(FalseQ($s("lst1")),FalseQ($s("lst2"))),False,If(ZeroQ(Plus(Part($s("lst1"),C3),Times(CN1,Part($s("lst2"),C3)))),List(Plus(Part($s("lst1"),C1),Part($s("lst2"),C1)),Plus(Part($s("lst1"),C2),Part($s("lst2"),C2)),Part($s("lst1"),C3)),False))))),False)))))),
SetDelayed(GeneralizedBinomialDegree($p(u),$p(x,SymbolHead)),
$(Function(Plus(Part(Slot1,C3),Times(CN1,Part(Slot1,C4)))),GeneralizedBinomialTest(u,x))),
SetDelayed(GeneralizedBinomialTest(Plus(Times(Power($p(x),$p(q,true)),$p(a,true)),Times(Power($p(x),$p(n,true)),$p(b,true))),$p(x,SymbolHead)),
Condition(List(a,b,n,q),And(FreeQ(List(a,b,n,q),x),PosQ(Plus(n,Times(CN1,q)))))),
SetDelayed(GeneralizedBinomialTest(Times($p(a),$p(u)),$p(x,SymbolHead)),
Condition(Module(List(Set($s("lst"),GeneralizedBinomialTest(u,x))),Condition(List(Times(a,Part($s("lst"),C1)),Times(a,Part($s("lst"),C2)),Part($s("lst"),C3),Part($s("lst"),C4)),NotFalseQ($s("lst")))),FreeQ(a,x))),
SetDelayed(GeneralizedBinomialTest(Times(Power($p(x),$p(m,true)),$p(u)),$p(x,SymbolHead)),
Condition(Module(List(Set($s("lst"),GeneralizedBinomialTest(u,x))),Condition(List(Part($s("lst"),C1),Part($s("lst"),C2),Plus(m,Part($s("lst"),C3)),Plus(m,Part($s("lst"),C4))),And(And(NotFalseQ($s("lst")),NonzeroQ(Plus(m,Part($s("lst"),C3)))),NonzeroQ(Plus(m,Part($s("lst"),C4)))))),FreeQ(m,x))),
SetDelayed(GeneralizedBinomialTest(Times(Power($p(x),$p(m,true)),$p(u)),$p(x,SymbolHead)),
Condition(Module(List(Set($s("lst"),BinomialTest(u,x))),Condition(List(Part($s("lst"),C1),Part($s("lst"),C2),Plus(m,Part($s("lst"),C3)),m),And(NotFalseQ($s("lst")),NonzeroQ(Plus(m,Part($s("lst"),C3)))))),FreeQ(m,x))),
SetDelayed(GeneralizedBinomialTest($p(u),$p(x,SymbolHead)),
False),
SetDelayed(TrinomialDegree($p(u),$p(x,SymbolHead)),
Part(TrinomialTest(u,x),C4)),
SetDelayed(TrinomialTest($p(u),$p(x,SymbolHead)),
If(PolynomialQ(u,x),Module(List(Set($s("lst"),CoefficientList(u,x))),If(Or(Or(Less(Length($s("lst")),C3),EvenQ(Length($s("lst")))),ZeroQ(Part($s("lst"),Times(C1D2,Plus(Length($s("lst")),C1))))),False,Catch(CompoundExpression(Scan(Function(If(ZeroQ(Slot1),Null,Throw(False))),Drop(Drop(Drop($s("lst"),List(Times(C1D2,Plus(Length($s("lst")),C1)))),C1),CN1)),List(First($s("lst")),Part($s("lst"),Times(C1D2,Plus(Length($s("lst")),C1))),Last($s("lst")),Times(C1D2,Plus(Length($s("lst")),Times(CN1,C1)))))))),If(PowerQ(u),If(ZeroQ(Plus(Part(u,C2),Times(CN1,C2))),Module(List(Set($s("lst"),BinomialTest(Part(u,C1),x))),If(FalseQ($s("lst")),False,List(Power(Part($s("lst"),C1),C2),Times(C2,Part($s("lst"),C1),Part($s("lst"),C2)),Power(Part($s("lst"),C2),C2),Part($s("lst"),C3)))),False),Module(List($s("lst1"),$s("lst2")),If(ProductQ(u),If(FreeQ(First(u),x),CompoundExpression(Set($s("lst2"),TrinomialTest(Rest(u),x)),If(FalseQ($s("lst2")),False,List(Times(First(u),Part($s("lst2"),C1)),Times(First(u),Part($s("lst2"),C2)),Times(First(u),Part($s("lst2"),C3)),Part($s("lst2"),C4)))),If(FreeQ(Rest(u),x),CompoundExpression(Set($s("lst1"),TrinomialTest(First(u),x)),If(FalseQ($s("lst1")),False,List(Times(Rest(u),Part($s("lst1"),C1)),Times(Rest(u),Part($s("lst1"),C2)),Times(Rest(u),Part($s("lst1"),C3)),Part($s("lst1"),C4)))),CompoundExpression(CompoundExpression(Set($s("lst1"),BinomialTest(First(u),x)),Set($s("lst2"),BinomialTest(Rest(u),x))),If(Or(FalseQ($s("lst1")),FalseQ($s("lst2"))),False,Module(List(a,b,c,d,m,n),CompoundExpression(CompoundExpression(Set(List(a,b,m),$s("lst1")),Set(List(c,d,n),$s("lst2"))),If(And(ZeroQ(Plus(m,Times(CN1,n))),NonzeroQ(Plus(Times(a,d),Times(b,c)))),List(Times(a,c),Plus(Times(a,d),Times(b,c)),Times(b,d),m),False))))))),If(SumQ(u),If(FreeQ(First(u),x),CompoundExpression(Set($s("lst2"),TrinomialTest(Rest(u),x)),If(FalseQ($s("lst2")),False,List(Plus(First(u),Part($s("lst2"),C1)),Part($s("lst2"),C2),Part($s("lst2"),C3),Part($s("lst2"),C4)))),If(FreeQ(Rest(u),x),CompoundExpression(Set($s("lst1"),TrinomialTest(First(u),x)),If(FalseQ($s("lst1")),False,List(Plus(Rest(u),Part($s("lst1"),C1)),Part($s("lst1"),C2),Part($s("lst1"),C3),Part($s("lst1"),C4)))),CompoundExpression(Set($s("lst1"),TrinomialTest(First(u),x)),If(FalseQ($s("lst1")),CompoundExpression(Set($s("lst1"),BinomialTest(First(u),x)),If(FalseQ($s("lst1")),False,CompoundExpression(Set($s("lst2"),TrinomialTest(Rest(u),x)),If(FalseQ($s("lst2")),CompoundExpression(Set($s("lst2"),BinomialTest(Rest(u),x)),If(FalseQ($s("lst2")),False,If(ZeroQ(Plus(Part($s("lst1"),C3),Times(CN1,C2,Part($s("lst2"),C3)))),List(Plus(Part($s("lst1"),C1),Part($s("lst2"),C1)),Part($s("lst2"),C2),Part($s("lst1"),C2),Part($s("lst2"),C3)),If(ZeroQ(Plus(Part($s("lst2"),C3),Times(CN1,C2,Part($s("lst1"),C3)))),List(Plus(Part($s("lst1"),C1),Part($s("lst2"),C1)),Part($s("lst1"),C2),Part($s("lst2"),C2),Part($s("lst1"),C3)),False)))),If(And(ZeroQ(Plus(Part($s("lst1"),C3),Times(CN1,Part($s("lst2"),C4)))),NonzeroQ(Plus(Part($s("lst1"),C2),Part($s("lst2"),C2)))),List(Plus(Part($s("lst1"),C1),Part($s("lst2"),C1)),Plus(Part($s("lst1"),C2),Part($s("lst2"),C2)),Part($s("lst2"),C3),Part($s("lst2"),C4)),If(And(ZeroQ(Plus(Part($s("lst1"),C3),Times(CN1,C2,Part($s("lst2"),C4)))),NonzeroQ(Plus(Part($s("lst1"),C2),Part($s("lst2"),C3)))),List(Plus(Part($s("lst1"),C1),Part($s("lst2"),C1)),Part($s("lst2"),C2),Plus(Part($s("lst1"),C2),Part($s("lst2"),C3)),Part($s("lst2"),C4)),False)))))),CompoundExpression(Set($s("lst2"),TrinomialTest(Rest(u),x)),If(FalseQ($s("lst2")),CompoundExpression(Set($s("lst2"),BinomialTest(Rest(u),x)),If(FalseQ($s("lst2")),False,If(And(ZeroQ(Plus(Part($s("lst2"),C3),Times(CN1,Part($s("lst1"),C4)))),NonzeroQ(Plus(Part($s("lst1"),C2),Part($s("lst2"),C2)))),List(Plus(Part($s("lst1"),C1),Part($s("lst2"),C1)),Plus(Part($s("lst1"),C2),Part($s("lst2"),C2)),Part($s("lst1"),C3),Part($s("lst1"),C4)),If(And(ZeroQ(Plus(Part($s("lst2"),C3),Times(CN1,C2,Part($s("lst1"),C4)))),NonzeroQ(Plus(Part($s("lst1"),C3),Part($s("lst2"),C2)))),List(Plus(Part($s("lst1"),C1),Part($s("lst2"),C1)),Part($s("lst1"),C2),Plus(Part($s("lst1"),C3),Part($s("lst2"),C2)),Part($s("lst1"),C4)),False)))),If(And(And(ZeroQ(Plus(Part($s("lst1"),C4),Times(CN1,Part($s("lst2"),C4)))),NonzeroQ(Plus(Part($s("lst1"),C2),Part($s("lst2"),C2)))),NonzeroQ(Plus(Part($s("lst1"),C3),Part($s("lst2"),C3)))),List(Plus(Part($s("lst1"),C1),Part($s("lst2"),C1)),Plus(Part($s("lst1"),C2),Part($s("lst2"),C2)),Plus(Part($s("lst1"),C3),Part($s("lst2"),C3)),Part($s("lst1"),C4)),False))))))),False)))))),
SetDelayed(GeneralizedTrinomialDegree($p(u),$p(x,SymbolHead)),
$(Function(Plus(Part(Slot1,C4),Times(CN1,Part(Slot1,C5)))),GeneralizedTrinomialTest(u,x))),
SetDelayed(GeneralizedTrinomialTest(Plus(Times(Power($p(x),$p(q,true)),$p(a,true)),Times(Power($p(x),$p(n,true)),$p(b,true)),Times(Power($p(x),$p(r,true)),$p(c,true))),$p(x,SymbolHead)),
Condition(List(a,b,c,n,q),And(FreeQ(List(a,b,c,n,q),x),ZeroQ(Plus(r,Times(CN1,Plus(Times(C2,n),Times(CN1,q)))))))),
SetDelayed(GeneralizedTrinomialTest(Times($p(a),$p(u)),$p(x,SymbolHead)),
Condition(Module(List(Set($s("lst"),GeneralizedTrinomialTest(u,x))),Condition(List(Times(a,Part($s("lst"),C1)),Times(a,Part($s("lst"),C2)),Times(a,Part($s("lst"),C3)),Part($s("lst"),C4),Part($s("lst"),C5)),NotFalseQ($s("lst")))),FreeQ(a,x))),
SetDelayed(GeneralizedTrinomialTest(Times(Power($p(x),$p(m,true)),$p(u)),$p(x,SymbolHead)),
Condition(Module(List(Set($s("lst"),GeneralizedTrinomialTest(u,x))),Condition(List(Part($s("lst"),C1),Part($s("lst"),C2),Part($s("lst"),C3),Plus(m,Part($s("lst"),C4)),Plus(m,Part($s("lst"),C5))),And(And(NotFalseQ($s("lst")),NonzeroQ(Plus(m,Part($s("lst"),C4)))),NonzeroQ(Plus(m,Part($s("lst"),C5)))))),FreeQ(m,x))),
SetDelayed(GeneralizedTrinomialTest(Times(Power($p(x),$p(m,true)),$p(u)),$p(x,SymbolHead)),
Condition(Module(List(Set($s("lst"),TrinomialTest(u,x))),Condition(List(Part($s("lst"),C1),Part($s("lst"),C2),Part($s("lst"),C3),Plus(m,Part($s("lst"),C4)),m),And(NotFalseQ($s("lst")),NonzeroQ(Plus(m,Part($s("lst"),C4)))))),FreeQ(m,x))),
SetDelayed(GeneralizedTrinomialTest($p(u),$p(x,SymbolHead)),
False),
SetDelayed(PerfectPowerTest($p(u),$p(x,SymbolHead)),
If(PolynomialQ(u,x),Module(List(Set($s("lst"),FactorSquareFreeList(u)),Set($s("gcd"),C0),Set(v,C1)),CompoundExpression(CompoundExpression(If(SameQ(Part($s("lst"),C1),List(C1,C1)),Set($s("lst"),Rest($s("lst")))),Scan(Function(Set($s("gcd"),GCD($s("gcd"),Part(Slot1,C2)))),$s("lst"))),If(Greater($s("gcd"),C1),CompoundExpression(Scan(Function(Set(v,Times(v,Power(Part(Slot1,C1),Times(Part(Slot1,C2),Power($s("gcd"),CN1)))))),$s("lst")),Power(Expand(v),$s("gcd"))),False))),False)),
SetDelayed(RationalFunctionQ($p(u),$p(x,SymbolHead)),
If(Or(AtomQ(u),FreeQ(u,x)),True,If(IntegerPowerQ(u),RationalFunctionQ(Part(u,C1),x),If(Or(ProductQ(u),SumQ(u)),Catch(CompoundExpression(Scan(Function(If(Not(RationalFunctionQ(Slot1,x)),Throw(False))),u),True)),False)))),
SetDelayed(RationalFunctionFactors($p(u),$p(x,SymbolHead)),
If(ProductQ(u),Map(Function(If(RationalFunctionQ(Slot1,x),Slot1,C1)),u),If(RationalFunctionQ(u,x),u,C1))),
SetDelayed(NonrationalFunctionFactors($p(u),$p(x,SymbolHead)),
If(ProductQ(u),Map(Function(If(RationalFunctionQ(Slot1,x),C1,Slot1)),u),If(RationalFunctionQ(u,x),C1,u))),
SetDelayed(RationalFunctionExponents($p(u),$p(x,SymbolHead)),
If(PolynomialQ(u,x),List(Exponent(u,x),C0),If(IntegerPowerQ(u),If(Greater(Part(u,C2),C0),Times(Part(u,C2),RationalFunctionExponents(Part(u,C1),x)),Times(CN1,Part(u,C2),Reverse(RationalFunctionExponents(Part(u,C1),x)))),If(ProductQ(u),Plus(RationalFunctionExponents(First(u),x),RationalFunctionExponents(Rest(u),x)),If(SumQ(u),Module(List(Set(v,Together(u))),If(SumQ(v),Module(List($s("lst1"),$s("lst2")),CompoundExpression(CompoundExpression(Set($s("lst1"),RationalFunctionExponents(First(u),x)),Set($s("lst2"),RationalFunctionExponents(Rest(u),x))),List(Max(Plus(Part($s("lst1"),C1),Part($s("lst2"),C2)),Plus(Part($s("lst2"),C1),Part($s("lst1"),C2))),Plus(Part($s("lst1"),C2),Part($s("lst2"),C2))))),RationalFunctionExponents(v,x))),List(C0,C0)))))),
SetDelayed(RationalFunctionExpand(Times(Power($p(v),$p(n)),$p(u)),$p(x,SymbolHead)),
Condition(Module(List(Set(w,RationalFunctionExpand(u,x))),If(SumQ(w),Map(Function(Times(Slot1,Power(v,n))),w),Times(w,Power(v,n)))),And(FractionQ(n),UnsameQ(v,x)))),
SetDelayed(RationalFunctionExpand($p(u),$p(x,SymbolHead)),
Module(List(v,w),CompoundExpression(Set(v,ExpandIntegrand(u,x)),If(And(UnsameQ(v,u),Not(MatchQ(u,Condition(Times(Power(x,$p(m,true)),Power(Plus($p(c),Times($p(d,true),x)),$p(p)),Power(Plus($p(a),Times($p(b,true),Power(x,$p(n)))),CN1)),And(And(FreeQ(List(a,b,c,d,p),x),IntegersQ(m,n)),Equal(m,Plus(n,Times(CN1,C1)))))))),v,CompoundExpression(CompoundExpression(Set(v,ExpandIntegrand(RationalFunctionFactors(u,x),x)),Set(w,NonrationalFunctionFactors(u,x))),If(SumQ(v),Map(Function(Times(Slot1,w)),v),Times(v,w))))))),
SetDelayed(AlgebraicFunctionQ($p(u),$p(x,SymbolHead)),
If(Or(AtomQ(u),FreeQ(u,x)),True,If(RationalPowerQ(u),AlgebraicFunctionQ(Part(u,C1),x),If(Or(ProductQ(u),SumQ(u)),Catch(CompoundExpression(Scan(Function(If(Not(AlgebraicFunctionQ(Slot1,x)),Throw(False))),u),True)),False)))),
SetDelayed(AlgebraicFunctionFactors($p(u),$p(x,SymbolHead)),
If(ProductQ(u),Map(Function(If(AlgebraicFunctionQ(Slot1,x),Slot1,C1)),u),If(AlgebraicFunctionQ(u,x),u,C1))),
SetDelayed(NonalgebraicFunctionFactors($p(u),$p(x,SymbolHead)),
If(ProductQ(u),Map(Function(If(AlgebraicFunctionQ(Slot1,x),C1,Slot1)),u),If(AlgebraicFunctionQ(u,x),C1,u))),
SetDelayed(QuotientOfLinearsQ($p(u),$p(x,SymbolHead)),
If(ListQ(u),Catch(CompoundExpression(Scan(Function(If(Not(QuotientOfLinearsQ(Slot1,x)),Throw(False))),u),True)),And(QuotientOfLinearsP(u,x),$(Function(And(NonzeroQ(Part(Slot1,C2)),NonzeroQ(Part(Slot1,C4)))),QuotientOfLinearsParts(u,x))))),
SetDelayed(QuotientOfLinearsP(Times($p(a),$p(u)),$p(x)),
Condition(QuotientOfLinearsP(u,x),FreeQ(a,x))),
SetDelayed(QuotientOfLinearsP(Plus($p(a),$p(u)),$p(x)),
Condition(QuotientOfLinearsP(u,x),FreeQ(a,x))),
SetDelayed(QuotientOfLinearsP(Power($p(u),CN1),$p(x)),
QuotientOfLinearsP(u,x)),
SetDelayed(QuotientOfLinearsP($p(u),$p(x)),
Condition(True,LinearQ(u,x))),
SetDelayed(QuotientOfLinearsP(Times(Power($p(v),CN1),$p(u)),$p(x)),
Condition(True,And(LinearQ(u,x),LinearQ(v,x)))),
SetDelayed(QuotientOfLinearsP($p(u),$p(x)),
Or(SameQ(u,x),FreeQ(u,x))),
SetDelayed(QuotientOfLinearsParts(Times($p(a),$p(u)),$p(x)),
Condition(Apply(Function(List(Times(a,Slot1),Times(a,Slot2),Slot(C3),Slot(C4))),QuotientOfLinearsParts(u,x)),FreeQ(a,x))),
SetDelayed(QuotientOfLinearsParts(Plus($p(a),$p(u)),$p(x)),
Condition(Apply(Function(List(Plus(Slot1,Times(a,Slot(C3))),Plus(Slot2,Times(a,Slot(C4))),Slot(C3),Slot(C4))),QuotientOfLinearsParts(u,x)),FreeQ(a,x))),
SetDelayed(QuotientOfLinearsParts(Power($p(u),CN1),$p(x)),
Apply(Function(List(Slot(C3),Slot(C4),Slot1,Slot2)),QuotientOfLinearsParts(u,x))),
SetDelayed(QuotientOfLinearsParts($p(u),$p(x)),
Condition(List(Coefficient(u,x,C0),Coefficient(u,x,C1),C1,C0),LinearQ(u,x))),
SetDelayed(QuotientOfLinearsParts(Times(Power($p(v),CN1),$p(u)),$p(x)),
Condition(List(Coefficient(u,x,C0),Coefficient(u,x,C1),Coefficient(v,x,C0),Coefficient(v,x,C1)),And(LinearQ(u,x),LinearQ(v,x)))),
SetDelayed(QuotientOfLinearsParts($p(u),$p(x)),
If(SameQ(u,x),List(C0,C1,C1,C0),If(FreeQ(u,x),List(u,C0,C1,C0),CompoundExpression(Print(stringx("QuotientOfLinearsParts error!")),List(u,C0,C1,C0))))),
SetDelayed(SubstForFractionalPowerOfQuotientOfLinears($p(u),$p(x,SymbolHead)),
Module(List(Set($s("lst"),FractionalPowerOfQuotientOfLinears(u,C1,False,x)),n,a,b,c,d,$s("tmp")),If(Or(FalseQ($s("lst")),FalseQ(Part($s("lst"),C2))),False,CompoundExpression(CompoundExpression(CompoundExpression(CompoundExpression(CompoundExpression(CompoundExpression(CompoundExpression(Set(n,Part($s("lst"),C1)),Set($s("tmp"),Part($s("lst"),C2))),Set($s("lst"),QuotientOfLinearsParts($s("tmp"),x))),Set(a,Part($s("lst"),C1))),Set(b,Part($s("lst"),C2))),Set(c,Part($s("lst"),C3))),Set(d,Part($s("lst"),C4))),If(ZeroQ(d),False,CompoundExpression(CompoundExpression(Set($s("lst"),Times(Power(x,Plus(n,Times(CN1,C1))),SubstForFractionalPower(u,$s("tmp"),n,Times(Plus(Times(CN1,a),Times(c,Power(x,n))),Power(Plus(b,Times(CN1,d,Power(x,n))),CN1)),x),Power(Power(Plus(b,Times(CN1,d,Power(x,n))),C2),CN1))),Set($s("lst"),SplitFreeFactors(Simplify($s("lst")),x))),List(Part($s("lst"),C2),n,$s("tmp"),Times(Part($s("lst"),C1),Plus(Times(b,c),Times(CN1,a,d)))))))))),
SetDelayed(SubstForFractionalPowerQ($p(u),$p(v),$p(x,SymbolHead)),
If(Or(AtomQ(u),FreeQ(u,x)),True,If(FractionalPowerQ(u),SubstForFractionalPowerAuxQ(u,v,x),Catch(CompoundExpression(Scan(Function(If(Not(SubstForFractionalPowerQ(Slot1,v,x)),Throw(False))),u),True))))),
SetDelayed(SubstForFractionalPowerAuxQ($p(u),$p(v),$p(x)),
If(AtomQ(u),False,If(And(FractionalPowerQ(u),ZeroQ(Plus(Part(u,C1),Times(CN1,v)))),True,Catch(CompoundExpression(Scan(Function(If(SubstForFractionalPowerAuxQ(Slot1,v,x),Throw(True))),u),False))))),
SetDelayed(FractionalPowerOfQuotientOfLinears($p(u),$p(n),$p(v),$p(x)),
If(Or(AtomQ(u),FreeQ(u,x)),List(n,v),If(CalculusQ(u),False,If(And(And(And(FractionalPowerQ(u),QuotientOfLinearsQ(Part(u,C1),x)),Not(LinearQ(Part(u,C1),x))),Or(FalseQ(v),ZeroQ(Plus(Part(u,C1),Times(CN1,v))))),List(LCM(Denominator(Part(u,C2)),n),Part(u,C1)),Catch(Module(List(Set($s("lst"),List(n,v))),CompoundExpression(Scan(Function(If(FalseQ(Set($s("lst"),FractionalPowerOfQuotientOfLinears(Slot1,Part($s("lst"),C1),Part($s("lst"),C2),x))),Throw(False))),u),$s("lst")))))))),
SetDelayed(SubstForInverseFunctionOfQuotientOfLinears($p(u),$p(x,SymbolHead)),
Module(List(Set($s("tmp"),InverseFunctionOfQuotientOfLinears(u,x)),h,a,b,c,d,$s("lst")),If(FalseQ($s("tmp")),False,CompoundExpression(CompoundExpression(CompoundExpression(CompoundExpression(CompoundExpression(CompoundExpression(Set(h,InverseFunction(Head($s("tmp")))),Set($s("lst"),QuotientOfLinearsParts(Part($s("tmp"),C1),x))),Set(a,Part($s("lst"),C1))),Set(b,Part($s("lst"),C2))),Set(c,Part($s("lst"),C3))),Set(d,Part($s("lst"),C4))),List(Times(SubstForInverseFunction(u,$s("tmp"),Times(Plus(Times(CN1,a),Times(c,$(h,x))),Power(Plus(b,Times(CN1,d,$(h,x))),CN1)),x),D($(h,x),x),Power(Power(Plus(b,Times(CN1,d,$(h,x))),C2),CN1)),$s("tmp"),Plus(Times(b,c),Times(CN1,a,d))))))),
SetDelayed(InverseFunctionOfQuotientOfLinears($p(u),$p(x,SymbolHead)),
If(Or(Or(AtomQ(u),CalculusQ(u)),FreeQ(u,x)),False,If(And(InverseFunctionQ(u),QuotientOfLinearsQ(Part(u,C1),x)),u,Module(List($s("tmp")),Catch(CompoundExpression(Scan(Function(If(NotFalseQ(Set($s("tmp"),InverseFunctionOfQuotientOfLinears(Slot1,x))),Throw($s("tmp")))),u),False)))))),
SetDelayed(SubstForFractionalPower($p(u),$p(v),$p(n),$p(w),$p(x,SymbolHead)),
If(AtomQ(u),If(SameQ(u,x),w,u),If(And(FractionalPowerQ(u),ZeroQ(Plus(Part(u,C1),Times(CN1,v)))),Power(x,Times(n,Part(u,C2))),Map(Function(SubstForFractionalPower(Slot1,v,n,w,x)),u)))),
SetDelayed(SubstForInverseFunction($p(u),$p(v),$p(x,SymbolHead)),
SubstForInverseFunction(u,v,Times(Plus(Times(CN1,Coefficient(Part(v,C1),x,C0)),$(InverseFunction(Head(v)),x)),Power(Coefficient(Part(v,C1),x,C1),CN1)),x)),
SetDelayed(SubstForInverseFunction($p(u),$p(v),$p(w),$p(x,SymbolHead)),
If(AtomQ(u),If(SameQ(u,x),w,u),If(And(SameQ(Head(u),Head(v)),ZeroQ(Plus(Part(u,C1),Times(CN1,Part(v,C1))))),x,Map(Function(SubstForInverseFunction(Slot1,v,w,x)),u)))),
SetDelayed(Gcd($p(m),$p(n)),
Condition(Module(List(Set($s("denr"),LCM(Denominator(m),Denominator(n)))),Times(Sign(n),GCD(Times(m,$s("denr")),Times(n,$s("denr"))),Power($s("denr"),CN1))),RationalQ(m,n))),
SetDelayed(CommonNumericFactors($p("lst")),
Module(List(Set($s("num"),Apply($s("GCD"),Map($s("Integrate::NumericFactor"),$s("lst"))))),Prepend(Map(Function(Times(Slot1,Power($s("num"),CN1))),$s("lst")),$s("num")))),
SetDelayed(NumericFactor($p(u)),
If(NumberQ(u),If(ZeroQ(Im(u)),u,If(ZeroQ(Re(u)),Im(u),C1)),If(PowerQ(u),If(And(RationalQ(Part(u,C1)),FractionQ(Part(u,C2))),If(Greater(Part(u,C2),C0),Power(Denominator(Part(u,C1)),CN1),Power(Denominator(Power(Part(u,C1),CN1)),CN1)),C1),If(ProductQ(u),Map($s("Integrate::NumericFactor"),u),If(SumQ(u),$(Function(If(SumQ(Slot1),C1,NumericFactor(Slot1))),ContentFactor(u)),C1))))),
SetDelayed(NonnumericFactors($p(u)),
If(NumberQ(u),If(ZeroQ(Im(u)),C1,If(ZeroQ(Re(u)),CI,u)),If(PowerQ(u),If(And(RationalQ(Part(u,C1)),FractionQ(Part(u,C2))),Times(u,Power(NumericFactor(u),CN1)),u),If(ProductQ(u),Map($s("Integrate::NonnumericFactors"),u),If(SumQ(u),$(Function(If(SumQ(Slot1),u,NonnumericFactors(Slot1))),ContentFactor(u)),u)))))
);
}
Ads help maintain this website.