int_rules_9_1 = @theory begin

    #= ::Subsection::Closed:: =#
    #= 9.1*Integrand*simplification*rules =#
    #= Antiderivative((~u')*((~v)+(~w))^(~p'),~x) := Antiderivative(u*w^p,x) <-- FreeQ(p,x) &&  EqQ(v,0) =#
    @apply_utils Antiderivative(~(u') * (~a + ~(b') * (~x) ^ ~(n')) ^ ~(p'), ~x) => Antiderivative(~u * (~b * (~x) ^ ~n) ^ ~p, ~x) <-- FreeQ([~a, ~b, ~n, ~p], ~x) && EqQ(~a, 0)
    @apply_utils Antiderivative(~(u') * (~(a') + ~(b') * (~x) ^ ~(n')) ^ ~(p'), ~x) => Antiderivative(~u * (~a) ^ ~p, ~x) <-- FreeQ([~a, ~b, ~n, ~p], ~x) && EqQ(~b, 0)
    @apply_utils Antiderivative(~(u') * (~a + ~(b') * (~x) ^ ~(n') + ~(c') * (~x) ^ ~(j')) ^ ~(p'), ~x) => Antiderivative(~u * (~b * (~x) ^ ~n + ~c * (~x) ^ (2 * ~n)) ^ ~p, ~x) <-- FreeQ([~a, ~b, ~c, ~n, ~p], ~x) && (EqQ(~j, 2 * ~n) && EqQ(~a, 0))
    @apply_utils Antiderivative(~(u') * (~(a') + ~(b') * (~x) ^ ~(n') + ~(c') * (~x) ^ ~(j')) ^ ~(p'), ~x) => Antiderivative(~u * (~a + ~c * (~x) ^ (2 * ~n)) ^ ~p, ~x) <-- FreeQ([~a, ~b, ~c, ~n, ~p], ~x) && (EqQ(~j, 2 * ~n) && EqQ(~b, 0))
    @apply_utils Antiderivative(~(u') * (~(a') + ~(b') * (~x) ^ ~(n') + ~(c') * (~x) ^ ~(j')) ^ ~(p'), ~x) => Antiderivative(~u * (~a + ~b * (~x) ^ ~n) ^ ~p, ~x) <-- FreeQ([~a, ~b, ~c, ~n, ~p], ~x) && (EqQ(~j, 2 * ~n) && EqQ(~c, 0))
    @apply_utils Antiderivative(~(u') * (~(a') * ~v + ~(b') * ~v + ~(w')) ^ ~(p'), ~x) => Antiderivative(~u * ((~a + ~b) * ~v + ~w) ^ ~p, ~x) <-- FreeQ([~a, ~b], ~x) && Not(FreeQ(~v, ~x))
    @apply_utils Antiderivative(~(u') * (~Px) ^ ~p, ~x) => Antiderivative(~u * (~Px) ^ Simplify(~p), ~x) <-- PolyQ(~Px, ~x) && (Not(RationalQ(~p)) && (FreeQ(~p, ~x) && RationalQ(Simplify(~p))))
    @apply_utils Antiderivative(~a, ~x) => ~a * ~x <-- FreeQ(~a, ~x)
    @apply_utils Antiderivative(~a * (~b + ~(c') * ~x), ~x) => (~a * (~b + ~c * ~x) ^ 2) / (2 * ~c) <-- FreeQ([~a, ~b, ~c], ~x)
    @apply_utils Antiderivative(-(~u), ~x) => Identity(-1) * Antiderivative(~u, ~x)
    @apply_utils Antiderivative(Complex(0, ~a) * ~u, ~x) => Complex(Identity(0), ~a) * Antiderivative(~u, ~x) <-- FreeQ(~a, ~x) && EqQ((~a) ^ 2, 1)
    @apply_utils Antiderivative(~a * ~u, ~x) => ~a * Antiderivative(~u, ~x) <-- FreeQ(~a, ~x) && Not(MatchQ(~u, ~b * ~v <-- FreeQ(b, ~x)))
    If(TrueQ($LoadShowSteps), Antiderivative((~u), ~x) := ShowStep("", "Antiderivative(a*u + b*v + ...,x)", "a*Integrate(u,x) + b*Integrate(v,x) + ...", Hold( IntSum(u, x))) <-- SimplifyFlag && SumQ(u), Antiderivative((~u), ~x) := IntSum(u, x) <-- SumQ(u))
    @apply_utils Antiderivative((~(c') * ~x) ^ ~(m') * ~u, ~x) => Antiderivative(ExpandIntegrand((~c * ~x) ^ ~m * ~u, ~x), ~x) <-- FreeQ([~c, ~m], ~x) && (SumQ(~u) && (Not(LinearQ(~u, ~x)) && Not(MatchQ(~u, ~a + ~(b') * ~v <-- FreeQ([a, b], ~x) && InverseFunctionQ(v)))))
    @apply_utils Antiderivative(~(u') * (~(a') * (~x) ^ ~n) ^ ~m, ~x) => (((~a) ^ IntPart(~m) * (~a * (~x) ^ ~n) ^ FracPart(~m)) / (~x) ^ (~n * FracPart(~m))) * Antiderivative(~u * (~x) ^ (~m * ~n), ~x) <-- FreeQ([~a, ~m, ~n], ~x) && Not(IntegerQ(~m))
    @apply_utils Antiderivative(~(u') * (~v) ^ ~(m') * (~b * ~v) ^ ~n, ~x) => (1 / (~b) ^ ~m) * Antiderivative(~u * (~b * ~v) ^ (~m + ~n), ~x) <-- FreeQ([~b, ~n], ~x) && IntegerQ(~m)
    @apply_utils Antiderivative(~(u') * (~(a') * ~v) ^ ~m * (~(b') * ~v) ^ ~n, ~x) => (((~a) ^ (~m + 1 / 2) * (~b) ^ (~n - 1 / 2) * sqrt(~b * ~v)) / sqrt(~a * ~v)) * Antiderivative(~u * (~v) ^ (~m + ~n), ~x) <-- FreeQ([~a, ~b, ~m], ~x) && (Not(IntegerQ(~m)) && (IGtQ(~n + 1 / 2, 0) && IntegerQ(~m + ~n)))
    #= Antiderivative((~u')*((~a')*(~v))^(~m)*((~b')*(~v))^(~n),~x) :=  b^(n-1/2)*sqrt(b*v)/(a^(n-1/2)*sqrt(a*v))*Antiderivative(u*(a*v)^(m+n),x) <--  FreeQ([a,b,m],x) && Not(IntegerQ(m)) && IGtQ(n+1/2,0) &&  Not(IntegerQ(m+n)) =#
    @apply_utils Antiderivative(~(u') * (~(a') * ~v) ^ ~m * (~(b') * ~v) ^ ~n, ~x) => (((~a) ^ (~m - 1 / 2) * (~b) ^ (~n + 1 / 2) * sqrt(~a * ~v)) / sqrt(~b * ~v)) * Antiderivative(~u * (~v) ^ (~m + ~n), ~x) <-- FreeQ([~a, ~b, ~m], ~x) && (Not(IntegerQ(~m)) && (ILtQ(~n - 1 / 2, 0) && IntegerQ(~m + ~n)))
    #= Antiderivative((~u')*((~a')*(~v))^(~m)*((~b')*(~v))^(~n),~x) :=  b^(n+1/2)*sqrt(a*v)/(a^(n+1/2)*sqrt(b*v))*Antiderivative(u*(a*v)^(m+n),x) <--  FreeQ([a,b,m],x) && Not(IntegerQ(m)) && ILtQ(n-1/2,0) &&  Not(IntegerQ(m+n)) =#
    @apply_utils Antiderivative(~(u') * (~(a') * ~v) ^ ~m * (~(b') * ~v) ^ ~n, ~x) => (((~a) ^ (~m + ~n) * (~b * ~v) ^ ~n) / (~a * ~v) ^ ~n) * Antiderivative(~u * (~v) ^ (~m + ~n), ~x) <-- FreeQ([~a, ~b, ~m, ~n], ~x) && (Not(IntegerQ(~m)) && (Not(IntegerQ(~n)) && IntegerQ(~m + ~n)))
    @apply_utils Antiderivative(~(u') * (~(a') * ~v) ^ ~m * (~(b') * ~v) ^ ~n, ~x) => (((~b) ^ IntPart(~n) * (~b * ~v) ^ FracPart(~n)) / ((~a) ^ IntPart(~n) * (~a * ~v) ^ FracPart(~n))) * Antiderivative(~u * (~a * ~v) ^ (~m + ~n), ~x) <-- FreeQ([~a, ~b, ~m, ~n], ~x) && (Not(IntegerQ(~m)) && (Not(IntegerQ(~n)) && Not(IntegerQ(~m + ~n))))
    @apply_utils Antiderivative(~(u') * (~a + ~(b') * ~v) ^ ~(m') * (~c + ~(d') * ~v) ^ ~(n'), ~x) => (~b / ~d) ^ ~m * Antiderivative(~u * (~c + ~d * ~v) ^ (~m + ~n), ~x) <-- FreeQ([~a, ~b, ~c, ~d, ~n], ~x) && (EqQ(~b * ~c - ~a * ~d, 0) && (IntegerQ(~m) && (Not(IntegerQ(~n)) || SimplerQ(~c + ~d * ~x, ~a + ~b * ~x))))
    @apply_utils Antiderivative(~(u') * (~a + ~(b') * ~v) ^ ~m * (~c + ~(d') * ~v) ^ ~n, ~x) => (~b / ~d) ^ ~m * Antiderivative(~u * (~c + ~d * ~v) ^ (~m + ~n), ~x) <-- FreeQ([~a, ~b, ~c, ~d, ~m, ~n], ~x) && (EqQ(~b * ~c - ~a * ~d, 0) && (GtQ(~b / ~d, 0) && Not(IntegerQ(~m) || IntegerQ(~n))))
    @apply_utils Antiderivative(~(u') * (~a + ~(b') * ~v) ^ ~m * (~c + ~(d') * ~v) ^ ~n, ~x) => ((~a + ~b * ~v) ^ ~m / (~c + ~d * ~v) ^ ~m) * Antiderivative(~u * (~c + ~d * ~v) ^ (~m + ~n), ~x) <-- FreeQ([~a, ~b, ~c, ~d, ~m, ~n], ~x) && (EqQ(~b * ~c - ~a * ~d, 0) && Not(IntegerQ(~m) || (IntegerQ(~n) || GtQ(~b / ~d, 0))))
    #= Antiderivative((~u')*((~a')*(~v))^(~m)*((~b')*(~v)+(~c')*(~v)^2),~x) :=  1/a*Antiderivative(u*(a*v)^(m+1)*(b+c*v),x) <-- FreeQ([a,b,c],x) && LeQ(m,-1) =#
    @apply_utils Antiderivative(~(u') * (~a + ~(b') * ~v) ^ ~m * (~(A') + ~(B') * ~v + ~(C') * (~v) ^ 2), ~x) => (1 / (~b) ^ 2) * Antiderivative(~u * (~a + ~b * ~v) ^ (~m + 1) * Simp((~b * ~B - ~a * ~C) + ~b * ~C * ~v, ~x), ~x) <-- FreeQ([~a, ~b, ~A, ~B, ~C], ~x) && (EqQ((~A * (~b) ^ 2 - ~a * ~b * ~B) + (~a) ^ 2 * ~C, 0) && LeQ(~m, -1))
    @apply_utils Antiderivative(~(u') * (~a + ~(b') * (~x) ^ ~(n')) ^ ~(m') * (~c + ~(d') * (~x) ^ ~(q')) ^ ~(p'), ~x) => (~d / ~a) ^ ~p * Antiderivative((~u * (~a + ~b * (~x) ^ ~n) ^ (~m + ~p)) / (~x) ^ (~n * ~p), ~x) <-- FreeQ([~a, ~b, ~c, ~d, ~m, ~n], ~x) && (EqQ(~q, -(~n)) && (IntegerQ(~p) && (EqQ(~a * ~c - ~b * ~d, 0) && Not(IntegerQ(~m) && NegQ(~n)))))
    @apply_utils Antiderivative(~(u') * (~a + ~(b') * (~x) ^ ~(n')) ^ ~(m') * (~c + ~(d') * (~x) ^ ~j) ^ ~(p'), ~x) => (-((~b) ^ 2) / ~d) ^ ~m * Antiderivative(~u * (~a - ~b * (~x) ^ ~n) ^ -(~m), ~x) <-- FreeQ([~a, ~b, ~c, ~d, ~m, ~n, ~p], ~x) && (EqQ(~j, 2 * ~n) && (EqQ(~p, -(~m)) && (EqQ((~b) ^ 2 * ~c + (~a) ^ 2 * ~d, 0) && (GtQ(~a, 0) && LtQ(~d, 0)))))
    @apply_utils Antiderivative(~(u') * (~a + ~(b') * ~x + ~(c') * (~x) ^ 2) ^ ~(p'), ~x) => Antiderivative(~u * Cancel((~b / 2 + ~c * ~x) ^ (2 * ~p) / (~c) ^ ~p), ~x) <-- FreeQ([~a, ~b, ~c], ~x) && (EqQ((~b) ^ 2 - 4 * ~a * ~c, 0) && IntegerQ(~p))
    @apply_utils Antiderivative(~(u') * (~a + ~(b') * (~x) ^ ~n + ~(c') * (~x) ^ ~(n2')) ^ ~(p'), ~x) => (1 / (~c) ^ ~p) * Antiderivative(~u * (~b / 2 + ~c * (~x) ^ ~n) ^ (2 * ~p), ~x) <-- FreeQ([~a, ~b, ~c, ~n], ~x) && (EqQ(~n2, 2 * ~n) && (EqQ((~b) ^ 2 - 4 * ~a * ~c, 0) && IntegerQ(~p)))
end
