int_rules_3_2_2 = @theory begin

    #= ::Subsection::Closed:: =#
    #= 3.2.2*(f+g*x)^m*(h+i*x)^q*(A+B*log(e*((a+b*x)*over*(c+d*x))^n))^p =#
    @apply_utils Antiderivative((~(f') + ~(g') * ~x) ^ ~(m') * (~(h') + ~(i') * ~x) * (~(A') + ~(B') * log(~(e') * ((~(a') + ~(b') * ~x) / (~(c') + ~(d') * ~x)) ^ ~(n'))), ~x) => ((~f + ~g * ~x) ^ (~m + 1) * (~h + ~i * ~x) * (~A + ~B * log(~e * ((~a + ~b * ~x) / (~c + ~d * ~x)) ^ ~n))) / (~g * (~m + 2)) + ((~i * (~b * ~c - ~a * ~d)) / (~b * ~d * (~m + 2))) * Antiderivative((~f + ~g * ~x) ^ ~m * ((~A - ~B * ~n) + ~B * log(~e * ((~a + ~b * ~x) / (~c + ~d * ~x)) ^ ~n)), ~x) <-- FreeQ([~a, ~b, ~c, ~d, ~e, ~f, ~g, ~h, ~i, ~A, ~B, ~m, ~n], ~x) && (NeQ(~b * ~c - ~a * ~d, 0) && (EqQ(~b * ~f - ~a * ~g, 0) && (EqQ(~d * ~h - ~c * ~i, 0) && IGtQ(~m, -2))))
    @apply_utils Antiderivative((~(f') + ~(g') * ~x) ^ ~(m') * (~(h') + ~(i') * ~x) * (~(A') + ~(B') * log(~(e') * (~(a') + ~(b') * ~x) ^ ~(n') * (~(c') + ~(d') * ~x) ^ ~mn)), ~x) => ((~f + ~g * ~x) ^ (~m + 1) * (~h + ~i * ~x) * (~A + ~B * log((~e * (~a + ~b * ~x) ^ ~n) / (~c + ~d * ~x) ^ ~n))) / (~g * (~m + 2)) + ((~i * (~b * ~c - ~a * ~d)) / (~b * ~d * (~m + 2))) * Antiderivative((~f + ~g * ~x) ^ ~m * ((~A - ~B * ~n) + ~B * log((~e * (~a + ~b * ~x) ^ ~n) / (~c + ~d * ~x) ^ ~n)), ~x) <-- FreeQ([~a, ~b, ~c, ~d, ~e, ~f, ~g, ~h, ~i, ~A, ~B, ~m, ~n], ~x) && (EqQ(~n + ~mn, 0) && (IGtQ(~n, 0) && (NeQ(~b * ~c - ~a * ~d, 0) && (EqQ(~b * ~f - ~a * ~g, 0) && (EqQ(~d * ~h - ~c * ~i, 0) && IGtQ(~m, -2))))))
    @apply_utils Antiderivative((~(f') + ~(g') * ~x) ^ ~(m') * (~(h') + ~(i') * ~x) ^ ~(q') * (~(A') + ~(B') * log(~(e') * ((~(a') + ~(b') * ~x) / (~(c') + ~(d') * ~x)) ^ ~(n'))) ^ ~(p'), ~x) => (~b * ~c - ~a * ~d) ^ (~m + ~q + 1) * (~g / ~b) ^ ~m * (~i / ~d) ^ ~q * Subst(Antiderivative(((~x) ^ ~m * (~A + ~B * log(~e * (~x) ^ ~n)) ^ ~p) / (~b - ~d * ~x) ^ (~m + ~q + 2), ~x), ~x, (~a + ~b * ~x) / (~c + ~d * ~x)) <-- FreeQ([~a, ~b, ~c, ~d, ~e, ~f, ~g, ~h, ~i, ~A, ~B, ~n, ~p], ~x) && (NeQ(~b * ~c - ~a * ~d, 0) && (EqQ(~b * ~f - ~a * ~g, 0) && (EqQ(~d * ~h - ~c * ~i, 0) && IntegersQ(~m, ~q))))
    @apply_utils Antiderivative((~(f') + ~(g') * ~x) ^ ~(m') * (~(h') + ~(i') * ~x) ^ ~(q') * (~(A') + ~(B') * log(~(e') * (~(a') + ~(b') * ~x) ^ ~(n') * (~(c') + ~(d') * ~x) ^ ~mn)) ^ ~(p'), ~x) => (~b * ~c - ~a * ~d) ^ (~m + ~q + 1) * (~g / ~b) ^ ~m * (~i / ~d) ^ ~q * Subst(Antiderivative(((~x) ^ ~m * (~A + ~B * log(~e * (~x) ^ ~n)) ^ ~p) / (~b - ~d * ~x) ^ (~m + ~q + 2), ~x), ~x, (~a + ~b * ~x) / (~c + ~d * ~x)) <-- FreeQ([~a, ~b, ~c, ~d, ~e, ~f, ~g, ~h, ~i, ~A, ~B, ~n, ~p], ~x) && (EqQ(~n + ~mn, 0) && (IGtQ(~n, 0) && (NeQ(~b * ~c - ~a * ~d, 0) && (EqQ(~b * ~f - ~a * ~g, 0) && (EqQ(~d * ~h - ~c * ~i, 0) && IntegersQ(~m, ~q))))))
    @apply_utils Antiderivative((~(f') + ~(g') * ~x) ^ ~(m') * (~(h') + ~(i') * ~x) ^ ~(q') * (~(A') + ~(B') * log(~(e') * ((~(a') + ~(b') * ~x) / (~(c') + ~(d') * ~x)) ^ ~(n'))) ^ ~(p'), ~x) => (((~d) ^ 2 * ((~g * (~a + ~b * ~x)) / ~b) ^ ~m) / ((~i) ^ 2 * (~b * ~c - ~a * ~d) * ((~i * (~c + ~d * ~x)) / ~d) ^ ~m * ((~a + ~b * ~x) / (~c + ~d * ~x)) ^ ~m)) * Subst(Antiderivative((~x) ^ ~m * (~A + ~B * log(~e * (~x) ^ ~n)) ^ ~p, ~x), ~x, (~a + ~b * ~x) / (~c + ~d * ~x)) <-- FreeQ([~a, ~b, ~c, ~d, ~e, ~f, ~g, ~h, ~i, ~A, ~B, ~m, ~n, ~p, ~q], ~x) && (NeQ(~b * ~c - ~a * ~d, 0) && (EqQ(~b * ~f - ~a * ~g, 0) && (EqQ(~d * ~h - ~c * ~i, 0) && EqQ(~m + ~q + 2, 0))))
    @apply_utils Antiderivative((~(f') + ~(g') * ~x) ^ ~(m') * (~(h') + ~(i') * ~x) ^ ~(q') * (~(A') + ~(B') * log(~(e') * (~(a') + ~(b') * ~x) ^ ~(n') * (~(c') + ~(d') * ~x) ^ ~mn)) ^ ~(p'), ~x) => (((~d) ^ 2 * ((~g * (~a + ~b * ~x)) / ~b) ^ ~m) / ((~i) ^ 2 * (~b * ~c - ~a * ~d) * ((~i * (~c + ~d * ~x)) / ~d) ^ ~m * ((~a + ~b * ~x) / (~c + ~d * ~x)) ^ ~m)) * Subst(Antiderivative((~x) ^ ~m * (~A + ~B * log(~e * (~x) ^ ~n)) ^ ~p, ~x), ~x, (~a + ~b * ~x) / (~c + ~d * ~x)) <-- FreeQ([~a, ~b, ~c, ~d, ~e, ~f, ~g, ~h, ~i, ~A, ~B, ~m, ~n, ~p, ~q], ~x) && (EqQ(~n + ~mn, 0) && (IGtQ(~n, 0) && (NeQ(~b * ~c - ~a * ~d, 0) && (EqQ(~b * ~f - ~a * ~g, 0) && (EqQ(~d * ~h - ~c * ~i, 0) && EqQ(~m + ~q + 2, 0))))))
    #= Antiderivative(((~f')+(~g')*(~x))^(~m')*((~h')+(~i')*(~x))^(~q')*((~A')+(~B')*log((~e')*((~a')+(~b')*(~x)) ^(~n')*((~c')+(~d')*(~x))^(~mn)))^(~p'),~x) :=  b*d*(f+g*x)^(m+1)/(g*i*(b*c-a*d)*(h+i*x)^(m+1)*((a+b*x)/(c+d*x))^(m+1) )* Subst(Antiderivative(x^m*(A+B*log(e*x^n))^p,x),x,(a+b*x)/(c+d*x)) <--  FreeQ([a,b,c,d,e,f,g,h,i,A,B,m,n,p,q],x) && EqQ(n+mn,0) &&  NeQ(b*c-a*d,0) && EqQ(b*f-a*g,0) && EqQ(d*h-c*i,0) && EqQ(m+q+2,0) =#
    @apply_utils Antiderivative((~(f') + ~(g') * ~x) ^ ~(m') * (~(h') + ~(i') * ~x) ^ ~(q') * (~(A') + ~(B') * log(~(e') * ((~(a') + ~(b') * ~x) / (~(c') + ~(d') * ~x)) ^ ~(n'))) ^ ~(p'), ~x) => (~b * ~c - ~a * ~d) ^ (~q + 1) * (~i / ~d) ^ ~q * Subst(Antiderivative((((~b * ~f - ~a * ~g) - (~d * ~f - ~c * ~g) * ~x) ^ ~m * (~A + ~B * log(~e * (~x) ^ ~n)) ^ ~p) / (~b - ~d * ~x) ^ (~m + ~q + 2), ~x), ~x, (~a + ~b * ~x) / (~c + ~d * ~x)) <-- FreeQ([~a, ~b, ~c, ~d, ~e, ~f, ~g, ~h, ~i, ~A, ~B, ~n], ~x) && (NeQ(~b * ~c - ~a * ~d, 0) && (IntegersQ(~m, ~q) && (IGtQ(~p, 0) && EqQ(~d * ~h - ~c * ~i, 0))))
    @apply_utils Antiderivative((~(f') + ~(g') * ~x) ^ ~(m') * (~(h') + ~(i') * ~x) ^ ~(q') * (~(A') + ~(B') * log(~(e') * (~(a') + ~(b') * ~x) ^ ~(n') * (~(c') + ~(d') * ~x) ^ ~mn)) ^ ~(p'), ~x) => (~b * ~c - ~a * ~d) ^ (~q + 1) * (~i / ~d) ^ ~q * Subst(Antiderivative((((~b * ~f - ~a * ~g) - (~d * ~f - ~c * ~g) * ~x) ^ ~m * (~A + ~B * log(~e * (~x) ^ ~n)) ^ ~p) / (~b - ~d * ~x) ^ (~m + ~q + 2), ~x), ~x, (~a + ~b * ~x) / (~c + ~d * ~x)) <-- FreeQ([~a, ~b, ~c, ~d, ~e, ~f, ~g, ~h, ~i, ~A, ~B, ~n], ~x) && (EqQ(~n + ~mn, 0) && (IGtQ(~n, 0) && (NeQ(~b * ~c - ~a * ~d, 0) && (IntegersQ(~m, ~q) && (IGtQ(~p, 0) && EqQ(~d * ~h - ~c * ~i, 0))))))
    @apply_utils Antiderivative((~(f') + ~(g') * ~x) ^ ~(m') * (~(h') + ~(i') * ~x) ^ ~(q') * (~(A') + ~(B') * log(~(e') * ((~(a') + ~(b') * ~x) / (~(c') + ~(d') * ~x)) ^ ~(n'))) ^ ~(p'), ~x) => (~b * ~c - ~a * ~d) * Subst(Antiderivative((((~b * ~f - ~a * ~g) - (~d * ~f - ~c * ~g) * ~x) ^ ~m * ((~b * ~h - ~a * ~i) - (~d * ~h - ~c * ~i) * ~x) ^ ~q * (~A + ~B * log(~e * (~x) ^ ~n)) ^ ~p) / (~b - ~d * ~x) ^ (~m + ~q + 2), ~x), ~x, (~a + ~b * ~x) / (~c + ~d * ~x)) <-- FreeQ([~a, ~b, ~c, ~d, ~e, ~f, ~g, ~h, ~i, ~A, ~B, ~n], ~x) && (NeQ(~b * ~c - ~a * ~d, 0) && (IntegersQ(~m, ~q) && IGtQ(~p, 0)))
    @apply_utils Antiderivative((~(f') + ~(g') * ~x) ^ ~(m') * (~(h') + ~(i') * ~x) ^ ~(q') * (~(A') + ~(B') * log(~(e') * (~(a') + ~(b') * ~x) ^ ~(n') * (~(c') + ~(d') * ~x) ^ ~mn)) ^ ~(p'), ~x) => (~b * ~c - ~a * ~d) * Subst(Antiderivative((((~b * ~f - ~a * ~g) - (~d * ~f - ~c * ~g) * ~x) ^ ~m * ((~b * ~h - ~a * ~i) - (~d * ~h - ~c * ~i) * ~x) ^ ~q * (~A + ~B * log(~e * (~x) ^ ~n)) ^ ~p) / (~b - ~d * ~x) ^ (~m + ~q + 2), ~x), ~x, (~a + ~b * ~x) / (~c + ~d * ~x)) <-- FreeQ([~a, ~b, ~c, ~d, ~e, ~f, ~g, ~h, ~i, ~A, ~B, ~n], ~x) && (EqQ(~n + ~mn, 0) && (IGtQ(~n, 0) && (NeQ(~b * ~c - ~a * ~d, 0) && (IntegersQ(~m, ~q) && IGtQ(~p, 0)))))
    @apply_utils Antiderivative((~(f') + ~(g') * ~x) ^ ~(m') * (~(h') + ~(i') * ~x) ^ ~(q') * (~(A') + ~(B') * log(~(e') * ((~(a') + ~(b') * ~x) / (~(c') + ~(d') * ~x)) ^ ~(n'))) ^ ~(p'), ~x) => Unintegrable((~f + ~g * ~x) ^ ~m * (~h + ~i * ~x) ^ ~q * (~A + ~B * log(~e * ((~a + ~b * ~x) / (~c + ~d * ~x)) ^ ~n)) ^ ~p, ~x) <-- FreeQ([~a, ~b, ~c, ~d, ~e, ~f, ~g, ~h, ~i, ~A, ~B, ~m, ~n, ~p, ~q], ~x)
    @apply_utils Antiderivative((~(f') + ~(g') * ~x) ^ ~(m') * (~(h') + ~(i') * ~x) ^ ~(q') * (~(A') + ~(B') * log(~(e') * (~(a') + ~(b') * ~x) ^ ~(n') * (~(c') + ~(d') * ~x) ^ ~mn)) ^ ~(p'), ~x) => Unintegrable((~f + ~g * ~x) ^ ~m * (~h + ~i * ~x) ^ ~q * (~A + ~B * log((~e * (~a + ~b * ~x) ^ ~n) / (~c + ~d * ~x) ^ ~n)) ^ ~p, ~x) <-- FreeQ([~a, ~b, ~c, ~d, ~e, ~f, ~g, ~h, ~i, ~A, ~B, ~m, ~n, ~p, ~q], ~x) && (EqQ(~n + ~mn, 0) && IntegerQ(~n))
    @apply_utils Antiderivative((~w) ^ ~(m') * (~y) ^ ~(q') * (~(A') + ~(B') * log(~(e') * (~u / ~v) ^ ~(n'))) ^ ~(p'), ~x) => Antiderivative(ExpandToSum(~w, ~x) ^ ~m * ExpandToSum(~y, ~x) ^ ~q * (~A + ~B * log(~e * (ExpandToSum(~u, ~x) / ExpandToSum(~v, ~x)) ^ ~n)) ^ ~p, ~x) <-- FreeQ([~e, ~A, ~B, ~m, ~n, ~p, ~q], ~x) && (LinearQ([~u, ~v, ~w, ~y], ~x) && Not(LinearMatchQ([~u, ~v, ~w, ~y], ~x)))
    @apply_utils Antiderivative((~w) ^ ~(m') * (~y) ^ ~(q') * (~(A') + ~(B') * log(~(e') * (~u) ^ ~(n') * (~v) ^ ~mn)) ^ ~(p'), ~x) => Antiderivative(ExpandToSum(~w, ~x) ^ ~m * ExpandToSum(~y, ~x) ^ ~q * (~A + ~B * log((~e * ExpandToSum(~u, ~x) ^ ~n) / ExpandToSum(~v, ~x) ^ ~n)) ^ ~p, ~x) <-- FreeQ([~e, ~A, ~B, ~m, ~n, ~p, ~q], ~x) && (EqQ(~n + ~mn, 0) && (IGtQ(~n, 0) && (LinearQ([~u, ~v, ~w, ~y], ~x) && Not(LinearMatchQ([~u, ~v, ~w, ~y], ~x)))))
    @apply_utils Antiderivative(~(w') * (~(A') + ~(B') * log(~(e') * (~u) ^ ~(n') * (~v) ^ ~mn)) ^ ~(p'), ~x) => Subst(Antiderivative(~w * (~A + ~B * log(~e * (~u / ~v) ^ ~n)) ^ ~p, ~x), ~e * (~u / ~v) ^ ~n, (~e * (~u) ^ ~n) / (~v) ^ ~n) <-- FreeQ([~e, ~A, ~B, ~n, ~p], ~x) && (EqQ(~n + ~mn, 0) && (LinearQ([~u, ~v], ~x) && Not(IntegerQ(~n))))
    #= Antiderivative((~w')*((~A')+(~B')*log((~e')*((~f')*(~u)^(~q')*(~v)^(~mq))^(~n')))^(~p'),~x) :=   Subst(Antiderivative(w*(A+B*log(e*f^n*(u/v)^(n*q)))^p,x),e*f^n*(u/v)^(n*q),e*( f*(u^q/v^q))^n) <-- FreeQ([e,f,A,B,n,p,q],x) && EqQ(q+mq,0) &&  LinearQ([u,v],x) && Not(IntegerQ(n)) =#
    @apply_utils Antiderivative((~(f') + ~(g') * ~x + ~(h') * (~x) ^ 2) ^ ~(m') * (~(A') + ~(B') * log(~(e') * ((~(a') + ~(b') * ~x) / (~(c') + ~(d') * ~x)) ^ ~(n'))) ^ ~(p'), ~x) => ((~h) ^ ~m / ((~b) ^ ~m * (~d) ^ ~m)) * Antiderivative((~a + ~b * ~x) ^ ~m * (~c + ~d * ~x) ^ ~m * (~A + ~B * log(~e * ((~a + ~b * ~x) / (~c + ~d * ~x)) ^ ~n)) ^ ~p, ~x) <-- FreeQ([~a, ~b, ~c, ~d, ~e, ~f, ~g, ~h, ~A, ~B, ~n, ~p], ~x) && (EqQ(~b * ~d * ~f - ~a * ~c * ~h, 0) && (EqQ(~b * ~d * ~g - ~h * (~b * ~c + ~a * ~d), 0) && IntegerQ(~m)))
    @apply_utils Antiderivative((~(f') + ~(g') * ~x + ~(h') * (~x) ^ 2) ^ ~(m') * (~(A') + ~(B') * log(~(e') * (~(a') + ~(b') * ~x) ^ ~(n') * (~(c') + ~(d') * ~x) ^ ~mn)) ^ ~(p'), ~x) => ((~h) ^ ~m / ((~b) ^ ~m * (~d) ^ ~m)) * Antiderivative((~a + ~b * ~x) ^ ~m * (~c + ~d * ~x) ^ ~m * (~A + ~B * log((~e * (~a + ~b * ~x) ^ ~n) / (~c + ~d * ~x) ^ ~n)) ^ ~p, ~x) <-- FreeQ([~a, ~b, ~c, ~d, ~e, ~f, ~g, ~h, ~A, ~B, ~n, ~p], ~x) && (EqQ(~n + ~mn, 0) && (IGtQ(~n, 0) && (EqQ(~b * ~d * ~f - ~a * ~c * ~h, 0) && (EqQ(~b * ~d * ~g - ~h * (~b * ~c + ~a * ~d), 0) && IntegerQ(~m)))))
    @apply_utils Antiderivative((~P2x) ^ ~(m') * (~(A') + ~(B') * log(~(e') * ((~(a') + ~(b') * ~x) / (~(c') + ~(d') * ~x)) ^ ~(n'))) ^ ~(p'), ~x) => With([f = Coeff(~P2x, ~x, 0), g = Coeff(~P2x, ~x, 1), h = Coeff(~P2x, ~x, 2)], (~b * ~c - ~a * ~d) * Subst(Antiderivative(((((((~b) ^ 2 * f - ~a * ~b * g) + (~a) ^ 2 * h) - (((2 * ~b * ~d * f - ~b * ~c * g) - ~a * ~d * g) + 2 * ~a * ~c * h) * ~x) + (((~d) ^ 2 * f - ~c * ~d * g) + (~c) ^ 2 * h) * (~x) ^ 2) ^ ~m * (~A + ~B * log(~e * (~x) ^ ~n)) ^ ~p) / (~b - ~d * ~x) ^ (2 * (~m + 1)), ~x), ~x, (~a + ~b * ~x) / (~c + ~d * ~x))) <-- FreeQ([~a, ~b, ~c, ~d, ~e, ~A, ~B, ~n], ~x) && (PolyQ(~P2x, ~x, 2) && (NeQ(~b * ~c - ~a * ~d, 0) && (IntegerQ(~m) && IGtQ(~p, 0))))
    @apply_utils Antiderivative((~P2x) ^ ~(m') * (~(A') + ~(B') * log(~(e') * (~(a') + ~(b') * ~x) ^ ~(n') * (~(c') + ~(d') * ~x) ^ ~mn)) ^ ~(p'), ~x) => With([f = Coeff(~P2x, ~x, 0), g = Coeff(~P2x, ~x, 1), h = Coeff(~P2x, ~x, 2)], (~b * ~c - ~a * ~d) * Subst(Antiderivative(((((((~b) ^ 2 * f - ~a * ~b * g) + (~a) ^ 2 * h) - (((2 * ~b * ~d * f - ~b * ~c * g) - ~a * ~d * g) + 2 * ~a * ~c * h) * ~x) + (((~d) ^ 2 * f - ~c * ~d * g) + (~c) ^ 2 * h) * (~x) ^ 2) ^ ~m * (~A + ~B * log(~e * (~x) ^ ~n)) ^ ~p) / (~b - ~d * ~x) ^ (2 * (~m + 1)), ~x), ~x, (~a + ~b * ~x) / (~c + ~d * ~x))) <-- FreeQ([~a, ~b, ~c, ~d, ~e, ~A, ~B, ~n], ~x) && (PolyQ(~P2x, ~x, 2) && (EqQ(~n + ~mn, 0) && (IGtQ(~n, 0) && (NeQ(~b * ~c - ~a * ~d, 0) && (IntegerQ(~m) && IGtQ(~p, 0))))))
end
