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 IntegrationRulesForMiscellaneousExpressions9 {
public static IAST RULES = List(
SetDelayed(ExpandLinearProduct($p(v),$p(u),$p(a),$p(b),$p(x,SymbolHead)),
Condition(Module(List($s("lst")),CompoundExpression(CompoundExpression(Set($s("lst"),CoefficientList(ReplaceAll(u,Rule(x,Times(Plus(x,Times(CN1,a)),Power(b,CN1)))),x)),Set($s("lst"),Map(Function(SimplifyTerm(Slot1,x)),$s("lst")))),Sum(Times(v,Part($s("lst"),k),Power(Plus(a,Times(b,x)),Plus(k,Times(CN1,C1)))),List(k,C1,Length($s("lst")))))),And(FreeQ(List(a,b),x),PolynomialQ(u,x)))),
SetDelayed(ExpandTrigReduce($p(u),$p(v),$p(x,SymbolHead)),
Module(List(Set(w,ExpandTrigReduce(v,x))),If(SumQ(w),Map(Function(Times(u,Slot1)),w),Times(u,w)))),
SetDelayed(ExpandTrigReduce(Times(Power($($p("F"),Plus($p(n),$p(v,true))),$p(m,true)),$p(u,true)),$p(x,SymbolHead)),
Condition(Module(List($s("nn")),ReplaceAll(ExpandTrigReduce(Times(u,Power($($s("§f"),Plus($s("nn"),v)),m)),x),Rule($s("nn"),n))),And(And(MemberQ(List($s("Sinh"),$s("Cosh")),$s("§f")),IntegerQ(m)),RationalQ(n)))),
SetDelayed(ExpandTrigReduce($p(u),$p(x,SymbolHead)),
ExpandTrigReduceAux(u,x)),
SetDelayed(ExpandTrigReduceAux($p(u),$p(x,SymbolHead)),
Module(List(Set(v,Expand(TrigReduce(u)))),If(SumQ(v),Map(Function(NormalizeTrig(Slot1,x)),v),NormalizeTrig(v,x)))),
SetDelayed(NormalizeTrig(Times(Power($($p("F"),$p(u)),$p(n,true)),$p(a,true)),$p(x,SymbolHead)),
Condition(Times(a,Power($($s("§f"),ExpandToSum(u,x)),n)),And(And(FreeQ(List($s("§f"),a,n),x),PolynomialQ(u,x)),Greater(Exponent(u,x),C0)))),
SetDelayed(NormalizeTrig($p(u),$p(x,SymbolHead)),
u),
SetDelayed(ExpandTrigToExp($p(u),$p(v),$p(x,SymbolHead)),
Module(List(Set(w,Expand(TrigToExp(v)))),If(SumQ(w),Map(Function(SimplifyIntegrand(Times(u,Slot1),x)),w),SimplifyIntegrand(Times(u,w),x)))),
SetDelayed(ExpandTrigToExp($p(u),$p(x,SymbolHead)),
Module(List(Set(w,Expand(TrigToExp(u)))),If(SumQ(w),Map(Function(SimplifyIntegrand(Slot1,x)),w),SimplifyIntegrand(w,x)))),
SetDelayed(Distrib($p(u),$p(v)),
If(SumQ(v),Map(Function(Times(u,Slot1)),v),Times(u,v))),
SetDelayed(Dist($p(u),Dist($p(v),$p(w),$p(x)),$p(x)),
Dist(Times(u,v),w,x)),
SetDelayed(Dist($p(u),Times($p(v),$p(w)),$p(x)),
Condition(Dist(Times(u,v),w,x),And(And(SameQ($s("ShowSteps"),True),FreeQ(v,$s("Int"))),Not(FreeQ(w,$s("Int")))))),
SetDelayed(Dist($p(u),$p(v),$p(x)),
If(SameQ(u,C1),v,If(SameQ(u,C0),CompoundExpression(Print(stringx("*** Warning ***: Dist[0,"),v,stringx(" "),x,stringx("]")),C0),If(And(Less(NumericFactor(u),C0),Greater(NumericFactor(Times(CN1,u)),C0)),Times(CN1,Dist(Times(CN1,u),v,x)),If(SumQ(v),Map(Function(Dist(u,Slot1,x)),v),If(FreeQ(v,$s("Int")),Simp(Times(u,v),x),Module(List(Set(w,Times(Simp(Times(u,Power(x,C2)),x),Power(Power(x,C2),CN1)))),If(And(And(UnsameQ(w,u),FreeQ(w,x)),SameQ(w,Simp(w,x))),Dist(w,v,x),If(UnsameQ($s("ShowSteps"),True),Simp(Times(u,v),x),$(Defer($s("Integrate::Dist")),u,v,x)))))))))),
SetDelayed(FunctionOfLinear($p(u),$p(x,SymbolHead)),
Module(List(Set($s("lst"),FunctionOfLinear(u,False,False,x,False))),If(Or(Or(FalseQ($s("lst")),FalseQ(Part($s("lst"),C1))),And(SameQ(Part($s("lst"),C1),C0),SameQ(Part($s("lst"),C2),C1))),False,List(FunctionOfLinearSubst(u,Part($s("lst"),C1),Part($s("lst"),C2),x),Part($s("lst"),C1),Part($s("lst"),C2))))),
SetDelayed(FunctionOfLinear($p(u),$p(a),$p(b),$p(x),$p("flag")),
If(FreeQ(u,x),List(a,b),If(CalculusQ(u),False,If(LinearQ(u,x),If(FalseQ(a),List(Coefficient(u,x,C0),Coefficient(u,x,C1)),Module(List(Set($s("lst"),CommonFactors(List(b,Coefficient(u,x,C1))))),If(And(ZeroQ(Coefficient(u,x,C0)),Not($s("flag"))),List(C0,Part($s("lst"),C1)),If(ZeroQ(Plus(Times(b,Coefficient(u,x,C0)),Times(CN1,a,Coefficient(u,x,C1)))),List(Times(a,Power(Part($s("lst"),C2),CN1)),Part($s("lst"),C1)),List(C0,C1))))),If(And(PowerQ(u),FreeQ(Part(u,C1),x)),FunctionOfLinear(Times(Log(Part(u,C1)),Part(u,C2)),a,b,x,False),Module(List($s("lst")),If(And(ProductQ(u),NonzeroQ(Part(Set($s("lst"),MonomialFactor(u,x)),C1))),If(And(And(And(False,IntegerQ(Part($s("lst"),C1))),Unequal(Part($s("lst"),C1),CN1)),FreeQ(Part($s("lst"),C2),x)),If(And(RationalQ(LeadFactor(Part($s("lst"),C2))),Less(LeadFactor(Part($s("lst"),C2)),C0)),FunctionOfLinear(Times(DivideDegreesOfFactors(Times(CN1,Part($s("lst"),C2)),Part($s("lst"),C1)),x),a,b,x,False),FunctionOfLinear(Times(DivideDegreesOfFactors(Part($s("lst"),C2),Part($s("lst"),C1)),x),a,b,x,False)),False),CompoundExpression(Set($s("lst"),List(a,b)),Catch(CompoundExpression(Scan(Function(CompoundExpression(Set($s("lst"),FunctionOfLinear(Slot1,Part($s("lst"),C1),Part($s("lst"),C2),x,SumQ(u))),If(FalseQ($s("lst")),Throw(False)))),u),$s("lst"))))))))))),
SetDelayed(FunctionOfLinearSubst($p(u),$p(a),$p(b),$p(x)),
If(FreeQ(u,x),u,If(LinearQ(u,x),Module(List(Set($s("tmp"),Coefficient(u,x,C1))),CompoundExpression(Set($s("tmp"),If(SameQ($s("tmp"),b),C1,Times($s("tmp"),Power(b,CN1)))),Plus(Coefficient(u,x,C0),Times(CN1,a,$s("tmp")),Times($s("tmp"),x)))),If(And(PowerQ(u),FreeQ(Part(u,C1),x)),Power(E,FullSimplify(FunctionOfLinearSubst(Times(Log(Part(u,C1)),Part(u,C2)),a,b,x))),Module(List($s("lst")),If(And(ProductQ(u),NonzeroQ(Part(Set($s("lst"),MonomialFactor(u,x)),C1))),If(And(RationalQ(LeadFactor(Part($s("lst"),C2))),Less(LeadFactor(Part($s("lst"),C2)),C0)),Times(CN1,Power(FunctionOfLinearSubst(Times(DivideDegreesOfFactors(Times(CN1,Part($s("lst"),C2)),Part($s("lst"),C1)),x),a,b,x),Part($s("lst"),C1))),Power(FunctionOfLinearSubst(Times(DivideDegreesOfFactors(Part($s("lst"),C2),Part($s("lst"),C1)),x),a,b,x),Part($s("lst"),C1))),Map(Function(FunctionOfLinearSubst(Slot1,a,b,x)),u))))))),
SetDelayed(DivideDegreesOfFactors($p(u),$p(n)),
If(ProductQ(u),Map(Function(Power(LeadBase(Slot1),Times(LeadDegree(Slot1),Power(n,CN1)))),u),Power(LeadBase(u),Times(LeadDegree(u),Power(n,CN1))))),
SetDelayed(FunctionOfInverseLinear($p(u),$p(x,SymbolHead)),
FunctionOfInverseLinear(u,Null,x)),
SetDelayed(FunctionOfInverseLinear($p(u),$p("lst"),$p(x)),
If(FreeQ(u,x),$s("lst"),If(SameQ(u,x),False,If(QuotientOfLinearsQ(u,x),Module(List(Set($s("tmp"),Drop(QuotientOfLinearsParts(u,x),C2))),If(SameQ(Part($s("tmp"),C2),C0),False,If(SameQ($s("lst"),Null),$s("tmp"),If(ZeroQ(Plus(Times(Part($s("lst"),C1),Part($s("tmp"),C2)),Times(CN1,Part($s("lst"),C2),Part($s("tmp"),C1)))),$s("lst"),False)))),If(CalculusQ(u),False,Module(List(Set($s("tmp"),$s("lst"))),Catch(CompoundExpression(Scan(Function(If(FalseQ(Set($s("tmp"),FunctionOfInverseLinear(Slot1,$s("tmp"),x))),Throw(False))),u),$s("tmp"))))))))),
SetDelayed(FunctionOfExponentialQ($p(u),$p(x,SymbolHead)),
Block(List(Set(Times($s("$base"),$s("$")),Null),Set(Times($s("$expon"),$s("$")),Null),Set(Times($s("$exponFlag"),$s("$")),False)),And(FunctionOfExponentialTest(u,x),Times($s("$exponFlag"),$s("$"))))),
SetDelayed(FunctionOfExponential($p(u),$p(x,SymbolHead)),
Block(List(Set(Times($s("$base"),$s("$")),Null),Set(Times($s("$expon"),$s("$")),Null),Set(Times($s("$exponFlag"),$s("$")),False)),CompoundExpression(FunctionOfExponentialTest(u,x),Times($s("$base"),Power($s("$"),$s("$expon")),$s("$"))))),
SetDelayed(FunctionOfExponentialFunction($p(u),$p(x,SymbolHead)),
Block(List(Set(Times($s("$base"),$s("$")),Null),Set(Times($s("$expon"),$s("$")),Null),Set(Times($s("$exponFlag"),$s("$")),False)),CompoundExpression(FunctionOfExponentialTest(u,x),SimplifyIntegrand(FunctionOfExponentialFunctionAux(u,x),x)))),
SetDelayed(FunctionOfExponentialFunctionAux($p(u),$p(x)),
If(AtomQ(u),u,If(And(And(PowerQ(u),FreeQ(Part(u,C1),x)),LinearQ(Part(u,C2),x)),If(ZeroQ(Coefficient(Times($s("$expon"),$s("$")),x,C0)),Times(Power(Part(u,C1),Coefficient(Part(u,C2),x,C0)),Power(x,FullSimplify(Times(Log(Part(u,C1)),Coefficient(Part(u,C2),x,C1),Power(Times(Log(Times($s("$base"),$s("$"))),Coefficient(Times($s("$expon"),$s("$")),x,C1)),CN1))))),Power(x,FullSimplify(Times(Log(Part(u,C1)),Coefficient(Part(u,C2),x,C1),Power(Times(Log(Times($s("$base"),$s("$"))),Coefficient(Times($s("$expon"),$s("$")),x,C1)),CN1))))),If(And(HyperbolicQ(u),LinearQ(Part(u,C1),x)),Module(List($s("tmp")),CompoundExpression(Set($s("tmp"),Power(x,FullSimplify(Times(Coefficient(Part(u,C1),x,C1),Power(Times(Log(Times($s("$base"),$s("$"))),Coefficient(Times($s("$expon"),$s("$")),x,C1)),CN1))))),If(SinhQ(u),Plus(Times(C1D2,$s("tmp")),Times(CN1,Power(Times(C2,$s("tmp")),CN1))),If(CoshQ(u),Plus(Times(C1D2,$s("tmp")),Power(Times(C2,$s("tmp")),CN1)),If(TanhQ(u),Times(Plus($s("tmp"),Times(CN1,Power($s("tmp"),CN1))),Power(Plus($s("tmp"),Power($s("tmp"),CN1)),CN1)),If(CothQ(u),Times(Plus($s("tmp"),Power($s("tmp"),CN1)),Power(Plus($s("tmp"),Times(CN1,Power($s("tmp"),CN1))),CN1)),If(SechQ(u),Times(C2,Power(Plus($s("tmp"),Power($s("tmp"),CN1)),CN1)),Times(C2,Power(Plus($s("tmp"),Times(CN1,Power($s("tmp"),CN1))),CN1))))))))),If(And(And(PowerQ(u),FreeQ(Part(u,C1),x)),SumQ(Part(u,C2))),Times(FunctionOfExponentialFunctionAux(Power(Part(u,C1),First(Part(u,C2))),x),FunctionOfExponentialFunctionAux(Power(Part(u,C1),Rest(Part(u,C2))),x)),Map(Function(FunctionOfExponentialFunctionAux(Slot1,x)),u)))))),
SetDelayed(FunctionOfExponentialTest($p(u),$p(x)),
If(FreeQ(u,x),True,If(Or(SameQ(u,x),CalculusQ(u)),False,If(And(And(PowerQ(u),FreeQ(Part(u,C1),x)),LinearQ(Part(u,C2),x)),CompoundExpression(Set(Times($s("$exponFlag"),$s("$")),True),FunctionOfExponentialTestAux(Part(u,C1),Part(u,C2),x)),If(And(HyperbolicQ(u),LinearQ(Part(u,C1),x)),FunctionOfExponentialTestAux(E,Part(u,C1),x),If(And(And(PowerQ(u),FreeQ(Part(u,C1),x)),SumQ(Part(u,C2))),And(FunctionOfExponentialTest(Power(Part(u,C1),First(Part(u,C2))),x),FunctionOfExponentialTest(Power(Part(u,C1),Rest(Part(u,C2))),x)),Catch(CompoundExpression(Scan(Function(If(Not(FunctionOfExponentialTest(Slot1,x)),Throw(False))),u),True)))))))),
SetDelayed(FunctionOfExponentialTestAux($p("base"),$p("expon"),$p(x)),
If(SameQ(Times($s("$base"),$s("$")),Null),CompoundExpression(CompoundExpression(Set(Times($s("$base"),$s("$")),$s("base")),Set(Times($s("$expon"),$s("$")),$s("expon"))),True),Module(List($s("tmp")),CompoundExpression(Set($s("tmp"),FullSimplify(Times(Log($s("base")),Coefficient($s("expon"),x,C1),Power(Times(Log(Times($s("$base"),$s("$"))),Coefficient(Times($s("$expon"),$s("$")),x,C1)),CN1)))),If(Not(RationalQ($s("tmp"))),False,If(Or(ZeroQ(Coefficient(Times($s("$expon"),$s("$")),x,C0)),NonzeroQ(Plus($s("tmp"),Times(CN1,FullSimplify(Times(Log($s("base")),Coefficient($s("expon"),x,C0),Power(Times(Log(Times($s("$base"),$s("$"))),Coefficient(Times($s("$expon"),$s("$")),x,C0)),CN1))))))),CompoundExpression(CompoundExpression(If(And(PositiveIntegerQ($s("base"),Times($s("$base"),$s("$"))),Less($s("base"),Times($s("$base"),$s("$")))),CompoundExpression(CompoundExpression(Set(Times($s("$base"),$s("$")),$s("base")),Set(Times($s("$expon"),$s("$")),$s("expon"))),Set($s("tmp"),Power($s("tmp"),CN1)))),Set(Times($s("$expon"),$s("$")),Times(Coefficient(Times($s("$expon"),$s("$")),x,C1),x,Power(Denominator($s("tmp")),CN1)))),If(And(Less($s("tmp"),C0),NegQ(Coefficient(Times($s("$expon"),$s("$")),x,C1))),CompoundExpression(Set(Times($s("$expon"),$s("$")),Times(CN1,$s("$expon"),$s("$"))),True),True)),CompoundExpression(CompoundExpression(If(And(PositiveIntegerQ($s("base"),Times($s("$base"),$s("$"))),Less($s("base"),Times($s("$base"),$s("$")))),CompoundExpression(CompoundExpression(Set(Times($s("$base"),$s("$")),$s("base")),Set(Times($s("$expon"),$s("$")),$s("expon"))),Set($s("tmp"),Power($s("tmp"),CN1)))),Set(Times($s("$expon"),$s("$")),Times($s("$expon"),$s("$"),Power(Denominator($s("tmp")),CN1)))),If(And(Less($s("tmp"),C0),NegQ(Coefficient(Times($s("$expon"),$s("$")),x,C1))),CompoundExpression(Set(Times($s("$expon"),$s("$")),Times(CN1,$s("$expon"),$s("$"))),True),True)))))))),
SetDelayed(FunctionOfTrigOfLinearQ($p(u),$p(x,SymbolHead)),
And(Not(MemberQ(List(Null,False),FunctionOfTrig(u,Null,x))),AlgebraicTrigFunctionQ(u,x))),
SetDelayed(FunctionOfTrig($p(u),$p(x,SymbolHead)),
Module(List(Set(v,FunctionOfTrig(ActivateTrig(u),Null,x))),If(SameQ(v,Null),False,v))),
SetDelayed(FunctionOfTrig($p(u),$p(v),$p(x)),
If(AtomQ(u),If(SameQ(u,x),False,v),If(And(TrigQ(u),LinearQ(Part(u,C1),x)),If(SameQ(v,Null),Part(u,C1),Module(List(Set(a,Coefficient(v,x,C0)),Set(b,Coefficient(v,x,C1)),Set(c,Coefficient(Part(u,C1),x,C0)),Set(d,Coefficient(Part(u,C1),x,C1))),If(And(ZeroQ(Plus(Times(a,d),Times(CN1,b,c))),RationalQ(Times(b,Power(d,CN1)))),Plus(Times(a,Power(Numerator(Times(b,Power(d,CN1))),CN1)),Times(b,x,Power(Numerator(Times(b,Power(d,CN1))),CN1))),False))),If(And(HyperbolicQ(u),LinearQ(Part(u,C1),x)),If(SameQ(v,Null),Times(CI,Part(u,C1)),Module(List(Set(a,Coefficient(v,x,C0)),Set(b,Coefficient(v,x,C1)),Set(c,Times(CI,Coefficient(Part(u,C1),x,C0))),Set(d,Times(CI,Coefficient(Part(u,C1),x,C1)))),If(And(ZeroQ(Plus(Times(a,d),Times(CN1,b,c))),RationalQ(Times(b,Power(d,CN1)))),Plus(Times(a,Power(Numerator(Times(b,Power(d,CN1))),CN1)),Times(b,x,Power(Numerator(Times(b,Power(d,CN1))),CN1))),False))),If(CalculusQ(u),False,Module(List(Set(w,v)),Catch(CompoundExpression(Scan(Function(If(FalseQ(Set(w,FunctionOfTrig(Slot1,w,x))),Throw(False))),u),w)))))))),
SetDelayed(AlgebraicTrigFunctionQ($p(u),$p(x,SymbolHead)),
If(AtomQ(u),True,If(And(TrigQ(u),LinearQ(Part(u,C1),x)),True,If(And(HyperbolicQ(u),LinearQ(Part(u,C1),x)),True,If(And(PowerQ(u),FreeQ(Part(u,C2),x)),AlgebraicTrigFunctionQ(Part(u,C1),x),If(Or(ProductQ(u),SumQ(u)),Catch(CompoundExpression(Scan(Function(If(Not(AlgebraicTrigFunctionQ(Slot1,x)),Throw(False))),u),True)),False)))))),
SetDelayed(FunctionOfHyperbolic($p(u),$p(x,SymbolHead)),
Module(List(Set(v,FunctionOfHyperbolic(u,Null,x))),If(SameQ(v,Null),False,v))),
SetDelayed(FunctionOfHyperbolic($p(u),$p(v),$p(x)),
If(AtomQ(u),If(SameQ(u,x),False,v),If(And(HyperbolicQ(u),LinearQ(Part(u,C1),x)),If(SameQ(v,Null),Part(u,C1),Module(List(Set(a,Coefficient(v,x,C0)),Set(b,Coefficient(v,x,C1)),Set(c,Coefficient(Part(u,C1),x,C0)),Set(d,Coefficient(Part(u,C1),x,C1))),If(And(ZeroQ(Plus(Times(a,d),Times(CN1,b,c))),RationalQ(Times(b,Power(d,CN1)))),Plus(Times(a,Power(Numerator(Times(b,Power(d,CN1))),CN1)),Times(b,x,Power(Numerator(Times(b,Power(d,CN1))),CN1))),False))),If(CalculusQ(u),False,Module(List(Set(w,v)),Catch(CompoundExpression(Scan(Function(If(FalseQ(Set(w,FunctionOfHyperbolic(Slot1,w,x))),Throw(False))),u),w))))))),
SetDelayed(FunctionOfQ($p(v),$p(u),$p(x,SymbolHead)),
FunctionOfQ(v,u,x,False)),
SetDelayed(FunctionOfQ($p(v),$p(u),$p(x,SymbolHead),$p("PureFlag")),
If(FreeQ(u,x),False,If(AtomQ(v),True,If(Not(InertTrigFreeQ(u)),FunctionOfQ(v,ActivateTrig(u),x,$s("PureFlag")),If(And(PowerQ(v),FreeQ(Part(v,C2),x)),FunctionOfPowerQ(u,Part(v,C1),Part(v,C2),x),If(And(ProductQ(v),Not(OneQ(FreeFactors(v,x)))),FunctionOfQ(NonfreeFactors(v,x),u,x,$s("PureFlag")),If($s("PureFlag"),If(Or(SinQ(v),CscQ(v)),PureFunctionOfSinQ(u,Part(v,C1),x),If(Or(CosQ(v),SecQ(v)),PureFunctionOfCosQ(u,Part(v,C1),x),If(TanQ(v),PureFunctionOfTanQ(u,Part(v,C1),x),If(CotQ(v),PureFunctionOfCotQ(u,Part(v,C1),x),If(Or(SinhQ(v),CschQ(v)),PureFunctionOfSinhQ(u,Part(v,C1),x),If(Or(CoshQ(v),SechQ(v)),PureFunctionOfCoshQ(u,Part(v,C1),x),If(TanhQ(v),PureFunctionOfTanhQ(u,Part(v,C1),x),If(CothQ(v),PureFunctionOfCothQ(u,Part(v,C1),x),FunctionOfExpnQ(u,v,x))))))))),If(Or(SinQ(v),CscQ(v)),FunctionOfSinQ(u,Part(v,C1),x),If(Or(CosQ(v),SecQ(v)),FunctionOfCosQ(u,Part(v,C1),x),If(Or(TanQ(v),CotQ(v)),FunctionOfTanQ(u,Part(v,C1),x),If(Or(SinhQ(v),CschQ(v)),FunctionOfSinhQ(u,Part(v,C1),x),If(Or(CoshQ(v),SechQ(v)),FunctionOfCoshQ(u,Part(v,C1),x),If(Or(TanhQ(v),CothQ(v)),FunctionOfTanhQ(u,Part(v,C1),x),FunctionOfExpnQ(u,v,x)))))))))))))),
SetDelayed(FunctionOfExpnQ($p(u),$p(v),$p(x)),
If(SameQ(u,v),True,If(AtomQ(u),UnsameQ(u,x),If(CalculusQ(u),False,Catch(CompoundExpression(Scan(Function(If(FunctionOfExpnQ(Slot1,v,x),Null,Throw(False))),u),True)))))),
SetDelayed(FunctionOfPowerQ($p(u),$p("bas"),$p("deg"),$p(x)),
If(AtomQ(u),UnsameQ(u,x),If(CalculusQ(u),False,If(And(And(PowerQ(u),ZeroQ(Plus(Part(u,C1),Times(CN1,$s("bas"))))),FreeQ(Part(u,C2),x)),If(RationalQ($s("deg")),If(RationalQ(Part(u,C2)),And(IntegerQ(Times(Part(u,C2),Power($s("deg"),CN1))),Or(Greater($s("deg"),C0),Less(Part(u,C2),C0))),False),IntegerQ(Simplify(Times(Part(u,C2),Power($s("deg"),CN1))))),Catch(CompoundExpression(Scan(Function(If(FunctionOfPowerQ(Slot1,$s("bas"),$s("deg"),x),Null,Throw(False))),u),True)))))),
SetDelayed(FindTrigFactor($p("func1"),$p("func2"),$p(u),$p(v),$p("flag")),
If(SameQ(u,C1),False,If(And(And(And(Or(SameQ(Head(LeadBase(u)),$s("func1")),SameQ(Head(LeadBase(u)),$s("func2"))),OddQ(LeadDegree(u))),IntegerQuotientQ(Part(LeadBase(u),C1),v)),Or($s("flag"),NonzeroQ(Plus(Part(LeadBase(u),C1),Times(CN1,v))))),List(Part(LeadBase(u),C1),RemainingFactors(u)),Module(List(Set($s("lst"),FindTrigFactor($s("func1"),$s("func2"),RemainingFactors(u),v,$s("flag")))),If(FalseQ($s("lst")),False,List(Part($s("lst"),C1),Times(LeadFactor(u),Part($s("lst"),C2)))))))),
SetDelayed(PureFunctionOfSinQ($p(u),$p(v),$p(x)),
If(AtomQ(u),UnsameQ(u,x),If(CalculusQ(u),False,If(And(TrigQ(u),ZeroQ(Plus(Part(u,C1),Times(CN1,v)))),Or(SinQ(u),CscQ(u)),Catch(CompoundExpression(Scan(Function(If(Not(PureFunctionOfSinQ(Slot1,v,x)),Throw(False))),u),True)))))),
SetDelayed(PureFunctionOfCosQ($p(u),$p(v),$p(x)),
If(AtomQ(u),UnsameQ(u,x),If(CalculusQ(u),False,If(And(TrigQ(u),ZeroQ(Plus(Part(u,C1),Times(CN1,v)))),Or(CosQ(u),SecQ(u)),Catch(CompoundExpression(Scan(Function(If(Not(PureFunctionOfCosQ(Slot1,v,x)),Throw(False))),u),True)))))),
SetDelayed(PureFunctionOfTanQ($p(u),$p(v),$p(x)),
If(AtomQ(u),UnsameQ(u,x),If(CalculusQ(u),False,If(And(TrigQ(u),ZeroQ(Plus(Part(u,C1),Times(CN1,v)))),Or(TanQ(u),CotQ(u)),Catch(CompoundExpression(Scan(Function(If(Not(PureFunctionOfTanQ(Slot1,v,x)),Throw(False))),u),True)))))),
SetDelayed(PureFunctionOfCotQ($p(u),$p(v),$p(x)),
If(AtomQ(u),UnsameQ(u,x),If(CalculusQ(u),False,If(And(TrigQ(u),ZeroQ(Plus(Part(u,C1),Times(CN1,v)))),CotQ(u),Catch(CompoundExpression(Scan(Function(If(Not(PureFunctionOfCotQ(Slot1,v,x)),Throw(False))),u),True)))))),
SetDelayed(FunctionOfSinQ($p(u),$p(v),$p(x)),
If(AtomQ(u),UnsameQ(u,x),If(CalculusQ(u),False,If(And(TrigQ(u),IntegerQuotientQ(Part(u,C1),v)),If(OddQuotientQ(Part(u,C1),v),Or(SinQ(u),CscQ(u)),Or(CosQ(u),SecQ(u))),If(And(And(IntegerPowerQ(u),TrigQ(Part(u,C1))),IntegerQuotientQ(Part(u,C1,C1),v)),If(EvenQ(Part(u,C2)),True,FunctionOfSinQ(Part(u,C1),v,x)),If(ProductQ(u),If(And(And(And(CosQ(Part(u,C1)),SinQ(Part(u,C2))),ZeroQ(Plus(Part(u,C1,C1),Times(CN1,C1D2,v)))),ZeroQ(Plus(Part(u,C2,C1),Times(CN1,C1D2,v)))),FunctionOfSinQ(Drop(u,C2),v,x),Module(List($s("lst")),CompoundExpression(Set($s("lst"),FindTrigFactor($s("Sin"),$s("Csc"),u,v,False)),If(And(NotFalseQ($s("lst")),EvenQuotientQ(Part($s("lst"),C1),v)),FunctionOfSinQ(Times(Cos(v),Part($s("lst"),C2)),v,x),CompoundExpression(Set($s("lst"),FindTrigFactor($s("Cos"),$s("Sec"),u,v,False)),If(And(NotFalseQ($s("lst")),OddQuotientQ(Part($s("lst"),C1),v)),FunctionOfSinQ(Times(Cos(v),Part($s("lst"),C2)),v,x),CompoundExpression(Set($s("lst"),FindTrigFactor($s("Tan"),$s("Cot"),u,v,True)),If(NotFalseQ($s("lst")),FunctionOfSinQ(Times(Cos(v),Part($s("lst"),C2)),v,x),Catch(CompoundExpression(Scan(Function(If(Not(FunctionOfSinQ(Slot1,v,x)),Throw(False))),u),True)))))))))),Catch(CompoundExpression(Scan(Function(If(Not(FunctionOfSinQ(Slot1,v,x)),Throw(False))),u),True)))))))),
SetDelayed(FunctionOfCosQ($p(u),$p(v),$p(x)),
If(AtomQ(u),UnsameQ(u,x),If(CalculusQ(u),False,If(And(TrigQ(u),IntegerQuotientQ(Part(u,C1),v)),Or(CosQ(u),SecQ(u)),If(And(And(IntegerPowerQ(u),TrigQ(Part(u,C1))),IntegerQuotientQ(Part(u,C1,C1),v)),If(EvenQ(Part(u,C2)),True,FunctionOfCosQ(Part(u,C1),v,x)),If(ProductQ(u),Module(List($s("lst")),CompoundExpression(Set($s("lst"),FindTrigFactor($s("Sin"),$s("Csc"),u,v,False)),If(NotFalseQ($s("lst")),FunctionOfCosQ(Times(Sin(v),Part($s("lst"),C2)),v,x),CompoundExpression(Set($s("lst"),FindTrigFactor($s("Tan"),$s("Cot"),u,v,True)),If(NotFalseQ($s("lst")),FunctionOfCosQ(Times(Sin(v),Part($s("lst"),C2)),v,x),Catch(CompoundExpression(Scan(Function(If(Not(FunctionOfCosQ(Slot1,v,x)),Throw(False))),u),True))))))),Catch(CompoundExpression(Scan(Function(If(Not(FunctionOfCosQ(Slot1,v,x)),Throw(False))),u),True)))))))),
SetDelayed(FunctionOfTanQ($p(u),$p(v),$p(x)),
If(AtomQ(u),UnsameQ(u,x),If(CalculusQ(u),False,If(And(TrigQ(u),IntegerQuotientQ(Part(u,C1),v)),Or(Or(TanQ(u),CotQ(u)),EvenQuotientQ(Part(u,C1),v)),If(And(And(And(PowerQ(u),EvenQ(Part(u,C2))),TrigQ(Part(u,C1))),IntegerQuotientQ(Part(u,C1,C1),v)),True,If(ProductQ(u),Module(List(Set($s("lst"),ReapList(Scan(Function(If(Not(FunctionOfTanQ(Slot1,v,x)),Sow(Slot1))),u)))),If(SameQ($s("lst"),List()),True,And(And(Equal(Length($s("lst")),C2),OddTrigPowerQ(Part($s("lst"),C1),v,x)),OddTrigPowerQ(Part($s("lst"),C2),v,x)))),Catch(CompoundExpression(Scan(Function(If(Not(FunctionOfTanQ(Slot1,v,x)),Throw(False))),u),True)))))))),
SetDelayed(OddTrigPowerQ($p(u),$p(v),$p(x)),
If(Or(Or(Or(SinQ(u),CosQ(u)),SecQ(u)),CscQ(u)),OddQuotientQ(Part(u,C1),v),If(PowerQ(u),And(OddQ(Part(u,C2)),OddTrigPowerQ(Part(u,C1),v,x)),If(ProductQ(u),Module(List(Set($s("lst"),ReapList(Scan(Function(If(Not(FunctionOfTanQ(Slot1,v,x)),Sow(Slot1))),u)))),If(SameQ($s("lst"),List()),True,And(Equal(Length($s("lst")),C1),OddTrigPowerQ(Part($s("lst"),C1),v,x)))),False)))),
SetDelayed(FunctionOfTanWeight($p(u),$p(v),$p(x)),
If(AtomQ(u),C0,If(CalculusQ(u),C0,If(And(TrigQ(u),IntegerQuotientQ(Part(u,C1),v)),If(And(TanQ(u),ZeroQ(Plus(Part(u,C1),Times(CN1,v)))),C1,If(And(CotQ(u),ZeroQ(Plus(Part(u,C1),Times(CN1,v)))),CN1,C0)),If(And(And(And(PowerQ(u),EvenQ(Part(u,C2))),TrigQ(Part(u,C1))),IntegerQuotientQ(Part(u,C1,C1),v)),If(Or(Or(TanQ(Part(u,C1)),CosQ(Part(u,C1))),SecQ(Part(u,C1))),C1,CN1),If(ProductQ(u),If(Catch(CompoundExpression(Scan(Function(If(Not(FunctionOfTanQ(Slot1,v,x)),Throw(False))),u),True)),Apply($s("Plus"),Map(Function(FunctionOfTanWeight(Slot1,v,x)),Apply($s("List"),u))),C0),Apply($s("Plus"),Map(Function(FunctionOfTanWeight(Slot1,v,x)),Apply($s("List"),u))))))))),
SetDelayed(FunctionOfTrigQ($p(u),$p(v),$p(x,SymbolHead)),
If(AtomQ(u),UnsameQ(u,x),If(CalculusQ(u),False,If(And(TrigQ(u),IntegerQuotientQ(Part(u,C1),v)),True,Catch(CompoundExpression(Scan(Function(If(Not(FunctionOfTrigQ(Slot1,v,x)),Throw(False))),u),True)))))),
SetDelayed(PureFunctionOfSinhQ($p(u),$p(v),$p(x)),
If(AtomQ(u),UnsameQ(u,x),If(CalculusQ(u),False,If(And(HyperbolicQ(u),ZeroQ(Plus(Part(u,C1),Times(CN1,v)))),Or(SinhQ(u),CschQ(u)),Catch(CompoundExpression(Scan(Function(If(Not(PureFunctionOfSinhQ(Slot1,v,x)),Throw(False))),u),True)))))),
SetDelayed(PureFunctionOfCoshQ($p(u),$p(v),$p(x)),
If(AtomQ(u),UnsameQ(u,x),If(CalculusQ(u),False,If(And(HyperbolicQ(u),ZeroQ(Plus(Part(u,C1),Times(CN1,v)))),Or(CoshQ(u),SechQ(u)),Catch(CompoundExpression(Scan(Function(If(Not(PureFunctionOfCoshQ(Slot1,v,x)),Throw(False))),u),True)))))),
SetDelayed(PureFunctionOfTanhQ($p(u),$p(v),$p(x)),
If(AtomQ(u),UnsameQ(u,x),If(CalculusQ(u),False,If(And(HyperbolicQ(u),ZeroQ(Plus(Part(u,C1),Times(CN1,v)))),Or(TanhQ(u),CothQ(u)),Catch(CompoundExpression(Scan(Function(If(Not(PureFunctionOfTanhQ(Slot1,v,x)),Throw(False))),u),True)))))),
SetDelayed(PureFunctionOfCothQ($p(u),$p(v),$p(x)),
If(AtomQ(u),UnsameQ(u,x),If(CalculusQ(u),False,If(And(HyperbolicQ(u),ZeroQ(Plus(Part(u,C1),Times(CN1,v)))),CothQ(u),Catch(CompoundExpression(Scan(Function(If(Not(PureFunctionOfCothQ(Slot1,v,x)),Throw(False))),u),True))))))
);
}
Ads help maintain this website.