int_rules_1_2_1_1 = @theory begin

    #= ::Subsection::Closed:: =#
    #= 1.2.1.1*(a+b*x+c*x^2)^p =#
    @apply_utils Antiderivative((~a + ~(b') * ~x + ~(c') * (~x) ^ 2) ^ ~p, ~x) => (2 * (~a + ~b * ~x + ~c * (~x) ^ 2) ^ (~p + 1)) / ((2 * ~p + 1) * (~b + 2 * ~c * ~x)) <-- FreeQ([~a, ~b, ~c, ~p], ~x) && (EqQ((~b) ^ 2 - 4 * ~a * ~c, 0) && LtQ(~p, -1))
    @apply_utils Antiderivative(1 / sqrt(~a + ~(b') * ~x + ~(c') * (~x) ^ 2), ~x) => ((~b / 2 + ~c * ~x) / sqrt(~a + ~b * ~x + ~c * (~x) ^ 2)) * Antiderivative(1 / (~b / 2 + ~c * ~x), ~x) <-- FreeQ([~a, ~b, ~c], ~x) && EqQ((~b) ^ 2 - 4 * ~a * ~c, 0)
    @apply_utils Antiderivative((~a + ~(b') * ~x + ~(c') * (~x) ^ 2) ^ ~p, ~x) => ((~b + 2 * ~c * ~x) * (~a + ~b * ~x + ~c * (~x) ^ 2) ^ ~p) / (2 * ~c * (2 * ~p + 1)) <-- FreeQ([~a, ~b, ~c, ~p], ~x) && (EqQ((~b) ^ 2 - 4 * ~a * ~c, 0) && NeQ(~p, -1 / 2))
    @apply_utils Antiderivative((~a + ~(b') * ~x + ~(c') * (~x) ^ 2) ^ ~p, ~x) => With([q = Rt((~b) ^ 2 - 4 * ~a * ~c, 2)], (1 / (~c) ^ ~p) * Antiderivative(Simp((~b / 2 - q / 2) + ~c * ~x, ~x) ^ ~p * Simp(~b / 2 + q / 2 + ~c * ~x, ~x) ^ ~p, ~x)) <-- FreeQ([~a, ~b, ~c], ~x) && (NeQ((~b) ^ 2 - 4 * ~a * ~c, 0) && (IGtQ(~p, 0) && PerfectSquareQ((~b) ^ 2 - 4 * ~a * ~c)))
    @apply_utils Antiderivative((~(a') + ~(b') * ~x + ~(c') * (~x) ^ 2) ^ ~p, ~x) => Antiderivative(ExpandIntegrand((~a + ~b * ~x + ~c * (~x) ^ 2) ^ ~p, ~x), ~x) <-- FreeQ([~a, ~b, ~c], ~x) && (NeQ((~b) ^ 2 - 4 * ~a * ~c, 0) && (IGtQ(~p, 0) && (EqQ(~a, 0) || Not(PerfectSquareQ((~b) ^ 2 - 4 * ~a * ~c)))))
    @apply_utils Antiderivative((~(a') + ~(b') * ~x + ~(c') * (~x) ^ 2) ^ ~p, ~x) => ((~b + 2 * ~c * ~x) * (~a + ~b * ~x + ~c * (~x) ^ 2) ^ ~p) / (2 * ~c * (2 * ~p + 1)) - ((~p * ((~b) ^ 2 - 4 * ~a * ~c)) / (2 * ~c * (2 * ~p + 1))) * Antiderivative((~a + ~b * ~x + ~c * (~x) ^ 2) ^ (~p - 1), ~x) <-- FreeQ([~a, ~b, ~c], ~x) && (NeQ((~b) ^ 2 - 4 * ~a * ~c, 0) && (GtQ(~p, 0) && IntegerQ(4 * ~p)))
    @apply_utils Antiderivative(1 / (~(a') + ~(b') * ~x + ~(c') * (~x) ^ 2) ^ (3 / 2), ~x) => (-2 * (~b + 2 * ~c * ~x)) / (((~b) ^ 2 - 4 * ~a * ~c) * sqrt(~a + ~b * ~x + ~c * (~x) ^ 2)) <-- FreeQ([~a, ~b, ~c], ~x) && NeQ((~b) ^ 2 - 4 * ~a * ~c, 0)
    @apply_utils Antiderivative((~(a') + ~(b') * ~x + ~(c') * (~x) ^ 2) ^ ~p, ~x) => ((~b + 2 * ~c * ~x) * (~a + ~b * ~x + ~c * (~x) ^ 2) ^ (~p + 1)) / ((~p + 1) * ((~b) ^ 2 - 4 * ~a * ~c)) - ((2 * ~c * (2 * ~p + 3)) / ((~p + 1) * ((~b) ^ 2 - 4 * ~a * ~c))) * Antiderivative((~a + ~b * ~x + ~c * (~x) ^ 2) ^ (~p + 1), ~x) <-- FreeQ([~a, ~b, ~c], ~x) && (NeQ((~b) ^ 2 - 4 * ~a * ~c, 0) && (LtQ(~p, -1) && (NeQ(~p, -3 / 2) && IntegerQ(4 * ~p))))
    @apply_utils Antiderivative(1 / (~(b') * ~x + ~(c') * (~x) ^ 2), ~x) => log(~x) / ~b - log(RemoveContent(~b + ~c * ~x, ~x)) / ~b <-- FreeQ([~b, ~c], ~x)
    @apply_utils Antiderivative(1 / (~(a') + ~(b') * ~x + ~(c') * (~x) ^ 2), ~x) => With([q = Rt((~b) ^ 2 - 4 * ~a * ~c, 2)], (~c / q) * Antiderivative(1 / Simp((~b / 2 - q / 2) + ~c * ~x, ~x), ~x) - (~c / q) * Antiderivative(1 / Simp(~b / 2 + q / 2 + ~c * ~x, ~x), ~x)) <-- FreeQ([~a, ~b, ~c], ~x) && (NeQ((~b) ^ 2 - 4 * ~a * ~c, 0) && (PosQ((~b) ^ 2 - 4 * ~a * ~c) && PerfectSquareQ((~b) ^ 2 - 4 * ~a * ~c)))
    @apply_utils Antiderivative(1 / (~a + ~(b') * ~x + ~(c') * (~x) ^ 2), ~x) => With([q = 1 - 4 * Simplify((~a * ~c) / (~b) ^ 2)], (-2 / ~b) * Subst(Antiderivative(1 / (q - (~x) ^ 2), ~x), ~x, 1 + (2 * ~c * ~x) / ~b) <-- RationalQ(q) && (EqQ(q ^ 2, 1) || Not(RationalQ((~b) ^ 2 - 4 * ~a * ~c)))) <-- FreeQ([~a, ~b, ~c], ~x) && NeQ((~b) ^ 2 - 4 * ~a * ~c, 0)
    @apply_utils Antiderivative(1 / (~(a') + ~(b') * ~x + ~(c') * (~x) ^ 2), ~x) => -2 * Subst(Antiderivative(1 / Simp(((~b) ^ 2 - 4 * ~a * ~c) - (~x) ^ 2, ~x), ~x), ~x, ~b + 2 * ~c * ~x) <-- FreeQ([~a, ~b, ~c], ~x) && NeQ((~b) ^ 2 - 4 * ~a * ~c, 0)
    @apply_utils Antiderivative((~(a') + ~(b') * ~x + ~(c') * (~x) ^ 2) ^ ~p, ~x) => (1 / (2 * ~c * ((-4 * ~c) / ((~b) ^ 2 - 4 * ~a * ~c)) ^ ~p)) * Subst(Antiderivative(Simp(1 - (~x) ^ 2 / ((~b) ^ 2 - 4 * ~a * ~c), ~x) ^ ~p, ~x), ~x, ~b + 2 * ~c * ~x) <-- FreeQ([~a, ~b, ~c, ~p], ~x) && GtQ(4 * ~a - (~b) ^ 2 / ~c, 0)
    @apply_utils Antiderivative(1 / sqrt(~(b') * ~x + ~(c') * (~x) ^ 2), ~x) => 2 * Subst(Antiderivative(1 / (1 - ~c * (~x) ^ 2), ~x), ~x, ~x / sqrt(~b * ~x + ~c * (~x) ^ 2)) <-- FreeQ([~b, ~c], ~x)
    @apply_utils Antiderivative(1 / sqrt(~a + ~(b') * ~x + ~(c') * (~x) ^ 2), ~x) => 2 * Subst(Antiderivative(1 / (4 * ~c - (~x) ^ 2), ~x), ~x, (~b + 2 * ~c * ~x) / sqrt(~a + ~b * ~x + ~c * (~x) ^ 2)) <-- FreeQ([~a, ~b, ~c], ~x) && NeQ((~b) ^ 2 - 4 * ~a * ~c, 0)
    @apply_utils Antiderivative((~(b') * ~x + ~(c') * (~x) ^ 2) ^ ~p, ~x) => ((~b * ~x + ~c * (~x) ^ 2) ^ ~p / ((-(~c) * (~b * ~x + ~c * (~x) ^ 2)) / (~b) ^ 2) ^ ~p) * Antiderivative(((-(~c) * ~x) / ~b - ((~c) ^ 2 * (~x) ^ 2) / (~b) ^ 2) ^ ~p, ~x) <-- FreeQ([~b, ~c], ~x) && (RationalQ(~p) && 3 <= Denominator(~p) <= 4)
    #= Antiderivative(((~a')+(~b')*(~x)+(~c')*(~x)^2)^(~p),~x) :=  (a+b*x+c*x^2)^p/(-c*(a+b*x+c*x^2)/(b^2-4*a*c))^p*Antiderivative((-a*c/(b^2-4*a*c) -b*c*x/(b^2-4*a*c)-c^2*x^2/(b^2-4*a*c))^p,x) <-- FreeQ([a,b,c],x) &&  NeQ(b^2-4*a*c,0) && RationalQ(p) && 3<=Denominator(p)<=4 =#
    @apply_utils Antiderivative((~(a') + ~(b') * ~x + ~(c') * (~x) ^ 2) ^ ~p, ~x) => With([d = Denominator(~p)], ((d * sqrt((~b + 2 * ~c * ~x) ^ 2)) / (~b + 2 * ~c * ~x)) * Subst(Antiderivative((~x) ^ (d * (~p + 1) - 1) / sqrt(((~b) ^ 2 - 4 * ~a * ~c) + 4 * ~c * (~x) ^ d), ~x), ~x, (~a + ~b * ~x + ~c * (~x) ^ 2) ^ (1 / d)) <-- 3 <= d <= 4) <-- FreeQ([~a, ~b, ~c], ~x) && (NeQ((~b) ^ 2 - 4 * ~a * ~c, 0) && RationalQ(~p))
    @apply_utils Antiderivative((~(a') + ~(b') * ~x + ~(c') * (~x) ^ 2) ^ ~p, ~x) => With([q = Rt((~b) ^ 2 - 4 * ~a * ~c, 2)], (-((~a + ~b * ~x + ~c * (~x) ^ 2) ^ (~p + 1)) / (q * (~p + 1) * (((q - ~b) - 2 * ~c * ~x) / (2q)) ^ (~p + 1))) * HypergeometricFunctions._₂F₁(-(~p), ~p + 1, ~p + 2, (~b + q + 2 * ~c * ~x) / (2q))) <-- FreeQ([~a, ~b, ~c, ~p], ~x) && (NeQ((~b) ^ 2 - 4 * ~a * ~c, 0) && Not(IntegerQ(4 * ~p)))
    @apply_utils Antiderivative((~(a') + ~(b') * ~u + ~(c') * (~u) ^ 2) ^ ~p, ~x) => (1 / Coefficient(~u, ~x, 1)) * Subst(Antiderivative((~a + ~b * ~x + ~c * (~x) ^ 2) ^ ~p, ~x), ~x, ~u) <-- FreeQ([~a, ~b, ~c, ~p], ~x) && (LinearQ(~u, ~x) && NeQ(~u, ~x))
end
