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;
/**
* IntegrationRules rules from the Rubi -
* rule-based integrator.
*
*/
public class IntegrationRulesForMiscellaneousExpressions8 {
public static IAST RULES = List(
SetDelayed(PolynomialInSubstAux($p(u),$p(v),$p(x)),
If(SameQ(u,v),x,If(AtomQ(u),u,If(PowerQ(u),If(And(PowerQ(v),SameQ(Part(u,C1),Part(v,C1))),Power(x,Times(Part(u,C2),Power(Part(v,C2),CN1))),Power(PolynomialInSubstAux(Part(u,C1),v,x),Part(u,C2))),Map(Function(PolynomialInSubstAux(Slot1,v,x)),u))))),
SetDelayed(PolynomialDivide($p(u),$p(v),$p(x,SymbolHead)),
Module(List(Set($s("quo"),PolynomialQuotient(u,v,x)),Set($s("rem"),PolynomialRemainder(u,v,x)),$s("free"),$s("monomial")),CompoundExpression(CompoundExpression(CompoundExpression(CompoundExpression(CompoundExpression(CompoundExpression(CompoundExpression(Set($s("quo"),Apply($s("Plus"),Map(Function(Simp(Together(Times(Coefficient($s("quo"),x,Slot1),Power(x,Slot1))),x)),Exponent($s("quo"),x,$s("List"))))),Set($s("rem"),Together($s("rem")))),Set($s("free"),FreeFactors($s("rem"),x))),Set($s("rem"),NonfreeFactors($s("rem"),x))),Set($s("monomial"),Power(x,Exponent($s("rem"),x,$s("Min"))))),If(NegQ(Coefficient($s("rem"),x,C0)),Set($s("monomial"),Times(CN1,$s("monomial"))))),Set($s("rem"),Apply($s("Plus"),Map(Function(Simp(Together(Times(Coefficient($s("rem"),x,Slot1),Power(x,Slot1),Power($s("monomial"),CN1))),x)),Exponent($s("rem"),x,$s("List")))))),If(BinomialQ(v,x),Plus($s("quo"),Times($s("free"),$s("monomial"),$s("rem"),Power(ExpandToSum(v,x),CN1))),Plus($s("quo"),Times($s("free"),$s("monomial"),$s("rem"),Power(v,CN1))))))),
SetDelayed(PolynomialDivide($p(u),$p(v),$p(w),$p(x,SymbolHead)),
ReplaceAll(PolynomialDivide(PolynomialInSubst(u,w,x),PolynomialInSubst(v,w,x),x),List(Rule(x,w)))),
SetDelayed(ExpandToSum($p(u),$p(v),$p(x,SymbolHead)),
Module(List(Set(w,ExpandToSum(v,x))),If(SumQ(w),Map(Function(Times(u,Slot1)),w),Times(u,w)))),
SetDelayed(ExpandToSum($p(u),$p(x,SymbolHead)),
If(PolynomialQ(u,x),Apply($s("Plus"),Map(Function(Times(Coefficient(u,x,Slot1),Power(x,Slot1))),Exponent(u,x,$s("List")))),If(BinomialQ(u,x),$(Function(Plus(Part(Slot1,C1),Times(Part(Slot1,C2),Power(x,Part(Slot1,C3))))),BinomialTest(u,x)),If(TrinomialQ(u,x),$(Function(Plus(Part(Slot1,C1),Times(Part(Slot1,C2),Power(x,Part(Slot1,C4))),Times(Part(Slot1,C3),Power(x,Times(C2,Part(Slot1,C4)))))),TrinomialTest(u,x)),If(GeneralizedBinomialQ(u,x),$(Function(Plus(Times(Part(Slot1,C1),Power(x,Part(Slot1,C4))),Times(Part(Slot1,C2),Power(x,Part(Slot1,C3))))),GeneralizedBinomialTest(u,x)),If(GeneralizedTrinomialQ(u,x),$(Function(Plus(Times(Part(Slot1,C1),Power(x,Part(Slot1,C5))),Times(Part(Slot1,C2),Power(x,Part(Slot1,C4))),Times(Part(Slot1,C3),Power(x,Plus(Times(C2,Part(Slot1,C4)),Times(CN1,Part(Slot1,C5))))))),GeneralizedTrinomialTest(u,x)),CompoundExpression(Print(stringx("Warning: Unrecogized expression for expansion "),u),Expand(u,x)))))))),
SetDelayed(ExpandTrig($p(u),$p(x,SymbolHead)),
ActivateTrig(ExpandIntegrand(u,x))),
SetDelayed(ExpandTrig($p(u),$p(v),$p(x,SymbolHead)),
Module(List(Set(w,ExpandTrig(v,x)),Set(z,ActivateTrig(u))),If(SumQ(w),Map(Function(Times(z,Slot1)),w),Times(z,w)))),
SetDelayed(ExpandIntegrand($p(u),$p(v),$p(x,SymbolHead)),
Module(List(Set(w,ExpandIntegrand(v,x))),If(SumQ(w),Map(Function(Times(u,Slot1)),w),Times(u,w)))),
SetDelayed(ExpandIntegrand(Times(Power(Plus(Times($p(b,true),$p(x)),$p(a,true)),$p(m,true)),Power(Plus(Times($p(h,true),$p(x)),$p(g,true)),CN1),Power($p(f),Times(Power(Plus(Times($p(d,true),$p(x)),$p(c,true)),$p(n,true)),$p(e,true)))),$p(x,SymbolHead)),
Condition(Module(List(Set($s("tmp"),Plus(Times(a,h),Times(CN1,b,g)))),Plus(Times(SimplifyTerm(Times(Power($s("tmp"),m),Power(Power(h,m),CN1)),x),Power(f,Times(e,Power(Plus(c,Times(d,x)),n))),Power(Plus(g,Times(h,x)),CN1)),Sum(Times(SimplifyTerm(Times(b,Power($s("tmp"),Plus(k,Times(CN1,C1))),Power(Power(h,k),CN1)),x),Power(f,Times(e,Power(Plus(c,Times(d,x)),n))),Power(Plus(a,Times(b,x)),Plus(m,Times(CN1,k)))),List(k,C1,m)))),And(And(FreeQ(List(a,b,c,d,e,f,g,h),x),PositiveIntegerQ(m)),ZeroQ(Plus(Times(b,c),Times(CN1,a,d)))))),
SetDelayed(ExpandIntegrand(Times(Power(Plus(Times($p(f,true),$p(x)),$p(e)),$p(p,true)),Power($p("F"),Times(Power(Plus(Times($p(d,true),$p(x)),$p(c,true)),$p(n,true)),$p(b,true))),Power($p(x),$p(m,true))),$p(x,SymbolHead)),
Condition(If(And(And(PositiveIntegerQ(m,p),LessEqual(m,p)),Or(OneQ(n),ZeroQ(Plus(Times(d,e),Times(CN1,c,f))))),ExpandLinearProduct(Times(Power(Plus(e,Times(f,x)),p),Power($s("§f"),Times(b,Power(Plus(c,Times(d,x)),n)))),Power(x,m),e,f,x),If(PositiveIntegerQ(p),Distribute(Times(Power(x,m),Power($s("§f"),Times(b,Power(Plus(c,Times(d,x)),n))),Expand(Power(Plus(e,Times(f,x)),p),x)),$s("Plus"),$s("Times")),Distribute(Times(Power($s("§f"),Times(b,Power(Plus(c,Times(d,x)),n))),ExpandIntegrand(Times(Power(x,m),Power(Plus(e,Times(f,x)),p)),x)),$s("Plus"),$s("Times")))),FreeQ(List($s("§f"),b,c,d,e,f,m,n,p),x))),
SetDelayed(ExpandIntegrand(Times(Power(Plus(Times($p(f,true),$p(x)),$p(e)),$p(p,true)),Power($p("F"),Plus(Times(Power(Plus(Times($p(d,true),$p(x)),$p(c,true)),$p(n,true)),$p(b,true)),$p(a,true))),Power($p(x),$p(m,true))),$p(x,SymbolHead)),
Condition(If(And(And(PositiveIntegerQ(m,p),LessEqual(m,p)),Or(OneQ(n),ZeroQ(Plus(Times(d,e),Times(CN1,c,f))))),ExpandLinearProduct(Times(Power(Plus(e,Times(f,x)),p),Power($s("§f"),Plus(a,Times(b,Power(Plus(c,Times(d,x)),n))))),Power(x,m),e,f,x),If(PositiveIntegerQ(p),Distribute(Times(Power(x,m),Power($s("§f"),Plus(a,Times(b,Power(Plus(c,Times(d,x)),n)))),Expand(Power(Plus(e,Times(f,x)),p),x)),$s("Plus"),$s("Times")),Distribute(Times(Power($s("§f"),Plus(a,Times(b,Power(Plus(c,Times(d,x)),n)))),ExpandIntegrand(Times(Power(x,m),Power(Plus(e,Times(f,x)),p)),x)),$s("Plus"),$s("Times")))),FreeQ(List($s("§f"),a,b,c,d,e,f,m,n,p),x))),
SetDelayed(ExpandIntegrand(Times(Power(Plus(Times($p(b,true),$p(x)),$p(a,true)),$p(m,true)),Power($p(f),Times(Power(Plus(Times($p(d,true),$p(x)),$p(c,true)),$p(n,true)),$p(e,true))),$p(u)),$p(x,SymbolHead)),
Condition(Module(List(Set(v,ExpandIntegrand(Times(u,Power(Plus(a,Times(b,x)),m)),x))),Condition(Distribute(Times(Power(f,Times(e,Power(Plus(c,Times(d,x)),n))),v),$s("Plus"),$s("Times")),SumQ(v))),And(FreeQ(List(a,b,c,d,e,f,m,n),x),PolynomialQ(u,x)))),
SetDelayed(ExpandIntegrand(Times(Log(Times(Power(Plus(Times(Power($p(x),$p(n,true)),$p(e,true)),$p(d,true)),$p(p,true)),$p(c,true))),Power(Plus(Times($p(b,true),$p(x)),$p(a,true)),$p(m,true)),$p(u)),$p(x,SymbolHead)),
Condition(Distribute(Times(Log(Times(c,Power(Plus(d,Times(e,Power(x,n))),p))),ExpandIntegrand(Times(u,Power(Plus(a,Times(b,x)),m)),x)),$s("Plus"),$s("Times")),And(FreeQ(List(a,b,c,d,e,m,n,p),x),PolynomialQ(u,x)))),
SetDelayed(ExpandIntegrand(Times(Power($p(f),Times(Power(Plus(Times($p(d,true),$p(x)),$p(c,true)),$p(n,true)),$p(e,true))),$p(u)),$p(x,SymbolHead)),
Condition(If(OneQ(n),ExpandIntegrand(Power(f,Times(e,Power(Plus(c,Times(d,x)),n))),u,x),ExpandLinearProduct(Power(f,Times(e,Power(Plus(c,Times(d,x)),n))),u,c,d,x)),And(FreeQ(List(c,d,e,f,n),x),PolynomialQ(u,x)))),
SetDelayed(ExpandIntegrand(Times(Power(Plus(Times($($p("G"),$p(u)),$p(b,true)),$p(a)),$p(n,true)),Power($($p("F"),$p(u)),$p(m,true))),$p(x,SymbolHead)),
Condition(ReplaceAll(ExpandIntegrand(Times(Power(Plus(a,Times(b,x)),n),Power(Power(x,m),CN1)),x),Rule(x,$($s("§g"),u))),And(And(FreeQ(List(a,b),x),IntegersQ(m,n)),SameQ(Times($($s("§f"),u),$($s("§g"),u)),C1)))),
SetDelayed(ExpandIntegrand(Times(Power(Plus(Times(Log(Times(Power(Plus(Times($p(e,true),$p(x)),$p(d,true)),$p(n,true)),$p(c,true))),$p(b,true)),$p(a,true)),$p(p)),$p(u)),$p(x,SymbolHead)),
Condition(ExpandLinearProduct(Power(Plus(a,Times(b,Log(Times(c,Power(Plus(d,Times(e,x)),n))))),p),u,d,e,x),And(FreeQ(List(a,b,c,d,e,n,p),x),PolynomialQ(u,x)))),
SetDelayed(ExpandIntegrand(Times(Power(Plus(Times($($p("F"),Plus(Times($p(d,true),$p(x)),$p(c,true))),$p(b,true)),$p(a,true)),$p(n)),$p(u)),$p(x,SymbolHead)),
Condition(ExpandLinearProduct(Power(Plus(a,Times(b,$($s("§f"),Plus(c,Times(d,x))))),n),u,c,d,x),And(And(FreeQ(List(a,b,c,d,n),x),PolynomialQ(u,x)),MemberQ(List($s("ArcSin"),$s("ArcCos"),$s("ArcSinh"),$s("ArcCosh")),$s("§f"))))),
SetDelayed(ExpandIntegrand(Times(Power($p(v),$p(p)),$p(u,true)),$p(x,SymbolHead)),
Condition(Distribute(Times(NormalizeIntegrand(Power(v,p),x),ExpandIntegrand(u,x)),$s("Plus"),$s("Times")),And(Not(IntegerQ(p)),Not(LinearQ(v,x))))),
SetDelayed(ExpandIntegrand(Times(Power(Plus(Times(Power($p(x),$p(n)),$p(a,true)),Times(Power(Plus(Times(Power($p(x),$p(j)),$p(d,true)),$p(c)),C1D2),$p(b,true))),CN1),$p(u,true)),$p(x,SymbolHead)),
Condition(ExpandIntegrand(Times(u,Plus(Times(a,Power(x,n)),Times(CN1,b,Sqrt(Plus(c,Times(d,Power(x,Times(C2,n))))))),Power(Plus(Times(CN1,Power(b,C2),c),Times(Plus(Power(a,C2),Times(CN1,Power(b,C2),d)),Power(x,Times(C2,n)))),CN1)),x),And(FreeQ(List(a,b,c,d,n),x),ZeroQ(Plus(j,Times(CN1,C2,n)))))),
SetDelayed(ExpandIntegrand(Times(Power(Plus(Times($p(b,true),$p(x)),$p(a)),$p(m)),Power(Plus(Times($p(d,true),$p(x)),$p(c)),CN1)),$p(x,SymbolHead)),
Condition(If(RationalQ(a,b,c,d),ExpandExpression(Times(Power(Plus(a,Times(b,x)),m),Power(Plus(c,Times(d,x)),CN1)),x),Module(List(Set($s("tmp"),Plus(Times(a,d),Times(CN1,b,c)))),Plus(Times(SimplifyTerm(Times(Power($s("tmp"),m),Power(Power(d,m),CN1)),x),Power(Plus(c,Times(d,x)),CN1)),Sum(Times(SimplifyTerm(Times(b,Power($s("tmp"),Plus(k,Times(CN1,C1))),Power(Power(d,k),CN1)),x),Power(Plus(a,Times(b,x)),Plus(m,Times(CN1,k)))),List(k,C1,m))))),And(FreeQ(List(a,b,c,d),x),PositiveIntegerQ(m)))),
SetDelayed(ExpandIntegrand(Times(Plus(Times($p("B",true),$p(x)),$p("A")),Power(Plus(Times($p(b,true),$p(x)),$p(a)),$p(m,true)),Power(Plus(Times($p(d,true),$p(x)),$p(c)),CN1)),$p(x,SymbolHead)),
Condition(If(RationalQ(a,b,c,d,$s("A"),$s("B")),ExpandExpression(Times(Power(Plus(a,Times(b,x)),m),Plus($s("A"),Times($s("B"),x)),Power(Plus(c,Times(d,x)),CN1)),x),Module(List($s("tmp1"),$s("tmp2")),CompoundExpression(CompoundExpression(CompoundExpression(Set($s("tmp1"),Times(Plus(Times($s("A"),d),Times(CN1,$s("B"),c)),Power(d,CN1))),Set($s("tmp2"),ExpandIntegrand(Times(Power(Plus(a,Times(b,x)),m),Power(Plus(c,Times(d,x)),CN1)),x))),Set($s("tmp2"),If(SumQ($s("tmp2")),Map(Function(SimplifyTerm(Times($s("tmp1"),Slot1),x)),$s("tmp2")),SimplifyTerm(Times($s("tmp1"),$s("tmp2")),x)))),Plus(Times(SimplifyTerm(Times($s("B"),Power(d,CN1)),x),Power(Plus(a,Times(b,x)),m)),$s("tmp2"))))),And(FreeQ(List(a,b,c,d,$s("A"),$s("B")),x),PositiveIntegerQ(m)))),
SetDelayed(ExpandIntegrand(Times(Power(Plus(Times($p(b,true),$p(x)),$p(a,true)),$p(m)),$p(u)),$p(x,SymbolHead)),
Condition(Module(List($s("tmp1"),$s("tmp2")),CompoundExpression(Set($s("tmp1"),ExpandLinearProduct(Power(Plus(a,Times(b,x)),m),u,a,b,x)),If(Not(IntegerQ(m)),$s("tmp1"),CompoundExpression(Set($s("tmp2"),ExpandExpression(Times(u,Power(Plus(a,Times(b,x)),m)),x)),If(And(SumQ($s("tmp2")),LessEqual(LeafCount($s("tmp2")),Plus(LeafCount($s("tmp1")),C2))),$s("tmp2"),$s("tmp1")))))),And(And(FreeQ(List(a,b,m),x),PolynomialQ(u,x)),Not(And(PositiveIntegerQ(m),MatchQ(u,Condition(Times($p(v,true),Power(Plus($p(c),Times($p(d,true),x)),$p(n))),And(And(FreeQ(List(c,d),x),IntegerQ(n)),Greater(n,m))))))))),
SetDelayed(ExpandIntegrand(Power(Plus(Times(Power($p(u),$p(n)),$p(b,true)),$p(a)),CN1),$p(x,SymbolHead)),
Condition(Module(List(Set(r,Numerator(Rt(Times(CN1,a,Power(b,CN1)),n))),Set(s,Denominator(Rt(Times(CN1,a,Power(b,CN1)),n)))),Sum(Times(r,Power(Times(a,n,Plus(r,Times(CN1,Power(CN1,Times(C2,k,Power(n,CN1))),s,u))),CN1)),List(k,C1,n))),And(And(FreeQ(List(a,b),x),IntegerQ(n)),Greater(n,C1)))),
SetDelayed(ExpandIntegrand(Times(Power(Plus(Times(Power($p(u),$p(n)),$p(b,true)),$p(a)),CN1),Power($p(u),$p(m,true))),$p(x,SymbolHead)),
Condition(Module(List(Set(g,GCD(m,n)),Set(r,Numerator(Rt(Times(a,Power(b,CN1)),Times(n,Power(GCD(m,n),CN1))))),Set(s,Denominator(Rt(Times(a,Power(b,CN1)),Times(n,Power(GCD(m,n),CN1)))))),If(CoprimeQ(Plus(m,g),n),Sum(Times(r,Power(Times(CN1,r,Power(s,CN1)),Times(m,Power(g,CN1))),Power(CN1,Times(CN2,k,m,Power(n,CN1))),Power(Times(a,n,Plus(r,Times(Power(CN1,Times(C2,k,g,Power(n,CN1))),s,Power(u,g)))),CN1)),List(k,C1,Times(n,Power(g,CN1)))),Sum(Times(r,Power(Times(CN1,r,Power(s,CN1)),Times(m,Power(g,CN1))),Power(CN1,Times(C2,k,Plus(m,g),Power(n,CN1))),Power(Times(a,n,Plus(Times(Power(CN1,Times(C2,k,g,Power(n,CN1))),r),Times(s,Power(u,g)))),CN1)),List(k,C1,Times(n,Power(g,CN1)))))),And(And(And(And(FreeQ(List(a,b),x),IntegersQ(m,n)),Less(Less(C0,m),n)),OddQ(Times(n,Power(GCD(m,n),CN1)))),PosQ(Times(a,Power(b,CN1)))))),
SetDelayed(ExpandIntegrand(Times(Power(Plus(Times(Power($p(u),$p(n)),$p(b,true)),$p(a)),CN1),Power($p(u),$p(m,true))),$p(x,SymbolHead)),
Condition(Module(List(Set(g,GCD(m,n)),Set(r,Numerator(Rt(Times(CN1,a,Power(b,CN1)),Times(n,Power(GCD(m,n),CN1))))),Set(s,Denominator(Rt(Times(CN1,a,Power(b,CN1)),Times(n,Power(GCD(m,n),CN1)))))),If(Equal(Times(n,Power(g,CN1)),C2),Plus(Times(s,Power(Times(C2,b,Plus(r,Times(s,Power(u,g)))),CN1)),Times(CN1,s,Power(Times(C2,b,Plus(r,Times(CN1,s,Power(u,g)))),CN1))),If(CoprimeQ(Plus(m,g),n),Sum(Times(r,Power(Times(r,Power(s,CN1)),Times(m,Power(g,CN1))),Power(CN1,Times(CN2,k,m,Power(n,CN1))),Power(Times(a,n,Plus(r,Times(CN1,Power(CN1,Times(C2,k,g,Power(n,CN1))),s,Power(u,g)))),CN1)),List(k,C1,Times(n,Power(g,CN1)))),Sum(Times(r,Power(Times(r,Power(s,CN1)),Times(m,Power(g,CN1))),Power(CN1,Times(C2,k,Plus(m,g),Power(n,CN1))),Power(Times(a,n,Plus(Times(Power(CN1,Times(C2,k,g,Power(n,CN1))),r),Times(CN1,s,Power(u,g)))),CN1)),List(k,C1,Times(n,Power(g,CN1))))))),And(And(FreeQ(List(a,b),x),IntegersQ(m,n)),Less(Less(C0,m),n)))),
SetDelayed(ExpandIntegrand(Times(Plus(Times(Power($p(u),$p(m,true)),$p(d,true)),$p(c)),Power(Plus(Times(Power($p(u),$p(n)),$p(b,true)),$p(a)),CN1)),$p(x,SymbolHead)),
Condition(Module(List(Set(r,Numerator(Rt(Times(CN1,a,Power(b,CN1)),n))),Set(s,Denominator(Rt(Times(CN1,a,Power(b,CN1)),n)))),Sum(Times(Plus(Times(r,c),Times(r,d,Power(Times(r,Power(s,CN1)),m),Power(CN1,Times(CN2,k,m,Power(n,CN1))))),Power(Times(a,n,Plus(r,Times(CN1,Power(CN1,Times(C2,k,Power(n,CN1))),s,u))),CN1)),List(k,C1,n))),And(And(FreeQ(List(a,b,c,d),x),IntegersQ(m,n)),Less(Less(C0,m),n)))),
SetDelayed(ExpandIntegrand(Times(Plus(Times(Power($p(u),$p(m,true)),$p(d,true)),Times(Power($p(u),$p(p)),$p(e,true)),$p(c,true)),Power(Plus(Times(Power($p(u),$p(n)),$p(b,true)),$p(a)),CN1)),$p(x,SymbolHead)),
Condition(Module(List(Set(r,Numerator(Rt(Times(CN1,a,Power(b,CN1)),n))),Set(s,Denominator(Rt(Times(CN1,a,Power(b,CN1)),n)))),Sum(Times(Plus(Times(r,c),Times(r,d,Power(Times(r,Power(s,CN1)),m),Power(CN1,Times(CN2,k,m,Power(n,CN1)))),Times(r,e,Power(Times(r,Power(s,CN1)),p),Power(CN1,Times(CN2,k,p,Power(n,CN1))))),Power(Times(a,n,Plus(r,Times(CN1,Power(CN1,Times(C2,k,Power(n,CN1))),s,u))),CN1)),List(k,C1,n))),And(And(FreeQ(List(a,b,c,d,e),x),IntegersQ(m,n,p)),Less(Less(Less(C0,m),p),n)))),
SetDelayed(ExpandIntegrand(Times(Plus(Times(Power($p(u),$p(m,true)),$p(d,true)),Times(Power($p(u),$p(p)),$p(e,true)),Times(Power($p(u),$p(q)),$p(f,true)),$p(c,true)),Power(Plus(Times(Power($p(u),$p(n)),$p(b,true)),$p(a)),CN1)),$p(x,SymbolHead)),
Condition(Module(List(Set(r,Numerator(Rt(Times(CN1,a,Power(b,CN1)),n))),Set(s,Denominator(Rt(Times(CN1,a,Power(b,CN1)),n)))),Sum(Times(Plus(Times(r,c),Times(r,d,Power(Times(r,Power(s,CN1)),m),Power(CN1,Times(CN2,k,m,Power(n,CN1)))),Times(r,e,Power(Times(r,Power(s,CN1)),p),Power(CN1,Times(CN2,k,p,Power(n,CN1)))),Times(r,f,Power(Times(r,Power(s,CN1)),q),Power(CN1,Times(CN2,k,q,Power(n,CN1))))),Power(Times(a,n,Plus(r,Times(CN1,Power(CN1,Times(C2,k,Power(n,CN1))),s,u))),CN1)),List(k,C1,n))),And(And(FreeQ(List(a,b,c,d,e,f),x),IntegersQ(m,n,p,q)),Less(Less(Less(Less(C0,m),p),q),n)))),
SetDelayed(ExpandIntegrand(Power(Plus(Times(Power($p(u),$p(n,true)),$p(b,true)),Times(Power($p(u),$p(j,true)),$p(c,true)),$p(a,true)),CN1),$p(x,SymbolHead)),
Condition(Module(List(Set(q,Rt(Plus(Power(b,C2),Times(CN1,C4,a,c)),C2))),Plus(Times(C2,c,Power(Times(q,Plus(b,Times(CN1,q),Times(C2,c,Power(u,n)))),CN1)),Times(CN1,C2,c,Power(Times(q,Plus(b,q,Times(C2,c,Power(u,n)))),CN1)))),And(And(FreeQ(List(a,b,c,n),x),ZeroQ(Plus(j,Times(CN1,C2,n)))),NonzeroQ(Plus(Power(b,C2),Times(CN1,C4,a,c)))))),
SetDelayed(ExpandIntegrand(Times(Power(Plus(Times(Power($p(u),$p(n,true)),$p(b,true)),Times(Power($p(u),$p(j,true)),$p(c,true)),$p(a,true)),CN1),Power($p(u),$p(m,true))),$p(x,SymbolHead)),
Condition(Module(List(Set(q,Rt(Plus(Power(b,C2),Times(CN1,C4,a,c)),C2))),Plus(Times(C2,c,Power(u,m),Power(Times(q,Plus(b,Times(CN1,q),Times(C2,c,Power(u,n)))),CN1)),Times(CN1,C2,c,Power(u,m),Power(Times(q,Plus(b,q,Times(C2,c,Power(u,n)))),CN1)))),And(And(And(And(And(FreeQ(List(a,b,c),x),IntegersQ(m,n,j)),Equal(j,Times(C2,n))),Less(Less(C0,m),Times(C2,n))),Unequal(m,n)),NonzeroQ(Plus(Power(b,C2),Times(CN1,C4,a,c)))))),
SetDelayed(ExpandIntegrand(Times(Plus(Times(Power($p(u),$p(n,true)),$p(d,true)),$p(c,true)),Power(Plus(Times(Power($p(u),$p(j,true)),$p(b,true)),$p(a)),CN1)),$p(x,SymbolHead)),
Condition(Module(List(Set(q,Rt(Times(CN1,a,Power(b,CN1)),C2))),Plus(Times(CN1,Plus(c,Times(CN1,d,q)),Power(Times(C2,b,q,Plus(q,Power(u,n))),CN1)),Times(CN1,Plus(c,Times(d,q)),Power(Times(C2,b,q,Plus(q,Times(CN1,Power(u,n)))),CN1)))),And(FreeQ(List(a,b,c,d,n),x),ZeroQ(Plus(j,Times(CN1,C2,n)))))),
SetDelayed(ExpandIntegrand(Times(Plus(Times(Power($p(u),$p(n,true)),$p(e,true)),$p(d,true)),Power(Plus(Times(Power($p(u),$p(n,true)),$p(b,true)),Times(Power($p(u),$p(j,true)),$p(c,true)),$p(a,true)),CN1)),$p(x,SymbolHead)),
Condition(Module(List(Set(q,Rt(Plus(Power(b,C2),Times(CN1,C4,a,c)),C2)),r),CompoundExpression(Set(r,TogetherSimplify(Times(Plus(Times(C2,c,d),Times(CN1,b,e)),Power(q,CN1)))),Plus(Times(Plus(e,r),Power(Plus(b,Times(CN1,q),Times(C2,c,Power(u,n))),CN1)),Times(Plus(e,Times(CN1,r)),Power(Plus(b,q,Times(C2,c,Power(u,n))),CN1))))),And(And(FreeQ(List(a,b,c,d,e,n),x),ZeroQ(Plus(j,Times(CN1,C2,n)))),NonzeroQ(Plus(Power(b,C2),Times(CN1,C4,a,c)))))),
SetDelayed(ExpandIntegrand(Times(Power($p(v),CN1),$p(u)),$p(x,SymbolHead)),
Condition(Module(List(Set($s("lst"),CoefficientList(u,x))),Plus(Times(Part($s("lst"),CN1),Power(x,Exponent(u,x)),Power(v,CN1)),Times(Sum(Times(Part($s("lst"),i),Power(x,Plus(i,Times(CN1,C1)))),List(i,C1,Exponent(u,x))),Power(v,CN1)))),And(And(And(PolynomialQ(u,x),PolynomialQ(v,x)),BinomialQ(v,x)),GreaterEqual(Equal(Exponent(u,x),Plus(Exponent(v,x),Times(CN1,C1))),C2)))),
SetDelayed(ExpandIntegrand(Times(Power($p(v),CN1),$p(u)),$p(x,SymbolHead)),
Condition(PolynomialDivide(u,v,x),And(And(PolynomialQ(u,x),PolynomialQ(v,x)),GreaterEqual(Exponent(u,x),Exponent(v,x))))),
SetDelayed(ExpandIntegrand($p(u),$p(x,SymbolHead)),
ExpandExpression(u,x)),
SetDelayed(ExpandExpression($p(u),$p(x,SymbolHead)),
Module(List(v,w),CompoundExpression(Set(v,If(And(AlgebraicFunctionQ(u,x),Not(RationalFunctionQ(u,x))),ExpandAlgebraicFunction(u,x),C0)),If(SumQ(v),ExpandCleanup(v,x),CompoundExpression(Set(v,SmartApart(u,x)),If(SumQ(v),ExpandCleanup(v,x),CompoundExpression(Set(v,SmartApart(RationalFunctionFactors(u,x),x,x)),If(SumQ(v),CompoundExpression(Set(w,NonrationalFunctionFactors(u,x)),ExpandCleanup(Map(Function(Times(Slot1,w)),v),x)),CompoundExpression(Set(v,Expand(u,x)),If(SumQ(v),ExpandCleanup(v,x),CompoundExpression(Set(v,Expand(u)),If(SumQ(v),ExpandCleanup(v,x),SimplifyTerm(u,x))))))))))))),
SetDelayed(ExpandCleanup($p(u),$p(x,SymbolHead)),
Module(List(v),CompoundExpression(Set(v,CollectReciprocals(u,x)),If(SumQ(v),CompoundExpression(Set(v,Map(Function(SimplifyTerm(Slot1,x)),v)),If(SumQ(v),UnifySum(v,x),v)),v)))),
SetDelayed(CollectReciprocals(Plus(Times(Power(Plus(Times($p(b,true),$p(x)),$p(a)),CN1),$p(e)),Times(Power(Plus(Times($p(d,true),$p(x)),$p(c)),CN1),$p(f)),$p(u,true)),$p(x,SymbolHead)),
Condition(CollectReciprocals(Plus(u,Times(Plus(Times(c,e),Times(a,f)),Power(Plus(Times(a,c),Times(b,d,Power(x,C2))),CN1))),x),And(And(FreeQ(List(a,b,c,d,e,f),x),ZeroQ(Plus(Times(b,c),Times(a,d)))),ZeroQ(Plus(Times(d,e),Times(b,f)))))),
SetDelayed(CollectReciprocals(Plus(Times(Power(Plus(Times($p(b,true),$p(x)),$p(a)),CN1),$p(e)),Times(Power(Plus(Times($p(d,true),$p(x)),$p(c)),CN1),$p(f)),$p(u,true)),$p(x,SymbolHead)),
Condition(CollectReciprocals(Plus(u,Times(Plus(Times(d,e),Times(b,f)),x,Power(Plus(Times(a,c),Times(b,d,Power(x,C2))),CN1))),x),And(And(FreeQ(List(a,b,c,d,e,f),x),ZeroQ(Plus(Times(b,c),Times(a,d)))),ZeroQ(Plus(Times(c,e),Times(a,f)))))),
SetDelayed(CollectReciprocals($p(u),$p(x,SymbolHead)),
u),
SetDelayed(SmartApart($p(u),$p(x,SymbolHead)),
Module(List(Set($s("alst"),MakeAssocList(u,x))),KernelSubst(Apart(GensymSubst(u,x,$s("alst"))),x,$s("alst")))),
SetDelayed(SmartApart($p(u),$p(v),$p(x,SymbolHead)),
Module(List(Set($s("alst"),MakeAssocList(u,x))),KernelSubst(Apart(GensymSubst(u,x,$s("alst")),v),x,$s("alst")))),
SetDelayed(MakeAssocList($p(u),$p(x,SymbolHead),$p("alst",$s("List"))),
If(AtomQ(u),$s("alst"),If(IntegerPowerQ(u),MakeAssocList(Part(u,C1),x,$s("alst")),If(Or(ProductQ(u),SumQ(u)),MakeAssocList(Rest(u),x,MakeAssocList(First(u),x,$s("alst"))),If(FreeQ(u,x),Module(List(Set($s("tmp"),Select($s("alst"),Function(SameQ(Part(Slot1,C2),u)),C1))),If(SameQ($s("tmp"),List()),Append($s("alst"),List(Unique(stringx("Rubi")),u)),$s("alst"))),$s("alst")))))),
SetDelayed(GensymSubst($p(u),$p(x,SymbolHead),$p("alst",$s("List"))),
If(AtomQ(u),u,If(IntegerPowerQ(u),Power(GensymSubst(Part(u,C1),x,$s("alst")),Part(u,C2)),If(Or(ProductQ(u),SumQ(u)),Map(Function(GensymSubst(Slot1,x,$s("alst"))),u),If(FreeQ(u,x),Module(List(Set($s("tmp"),Select($s("alst"),Function(SameQ(Part(Slot1,C2),u)),C1))),If(SameQ($s("tmp"),List()),u,Part($s("tmp"),C1,C1))),u))))),
SetDelayed(KernelSubst($p(u),$p(x,SymbolHead),$p("alst",$s("List"))),
If(AtomQ(u),Module(List(Set($s("tmp"),Select($s("alst"),Function(SameQ(Part(Slot1,C1),u)),C1))),If(SameQ($s("tmp"),List()),u,Part($s("tmp"),C1,C2))),If(IntegerPowerQ(u),Power(KernelSubst(Part(u,C1),x,$s("alst")),Part(u,C2)),If(Or(ProductQ(u),SumQ(u)),Map(Function(KernelSubst(Slot1,x,$s("alst"))),u),u)))),
SetDelayed(ExpandAlgebraicFunction(Times($p(u,$s("Plus")),$p(v)),$p(x,SymbolHead)),
Condition(Map(Function(Times(Slot1,v)),u),Not(FreeQ(u,x)))),
SetDelayed(ExpandAlgebraicFunction(Times(Power($p(u,$s("Plus")),$p(n)),$p(v,true)),$p(x,SymbolHead)),
Condition(Module(List(Set(w,Expand(Power(u,n),x))),Condition(Map(Function(Times(Slot1,v)),w),SumQ(w))),And(PositiveIntegerQ(n),Not(FreeQ(u,x))))),
SetDelayed(UnifySum($p(u),$p(x,SymbolHead)),
If(SumQ(u),Apply($s("Plus"),UnifyTerms(Apply($s("List"),u),x)),SimplifyTerm(u,x))),
SetDelayed(UnifyTerms($p("lst"),$p(x)),
If(SameQ($s("lst"),List()),$s("lst"),UnifyTerm(First($s("lst")),UnifyTerms(Rest($s("lst")),x),x))),
SetDelayed(UnifyTerm($p("term"),$p("lst"),$p(x)),
If(SameQ($s("lst"),List()),List($s("term")),Module(List(Set($s("tmp"),Simplify(Times(First($s("lst")),Power($s("term"),CN1))))),If(FreeQ($s("tmp"),x),Prepend(Rest($s("lst")),Times(Plus(C1,$s("tmp")),$s("term"))),Prepend(UnifyTerm($s("term"),Rest($s("lst")),x),First($s("lst")))))))
);
}
Ads help maintain this website.