### 3.400 $$\int (a+c x^2)^p (A+B x+C x^2) (d+f x^2)^q \, dx$$

Optimal. Leaf size=252 $A x \left (a+c x^2\right )^p \left (\frac{c x^2}{a}+1\right )^{-p} \left (d+f x^2\right )^q \left (\frac{f x^2}{d}+1\right )^{-q} F_1\left (\frac{1}{2};-p,-q;\frac{3}{2};-\frac{c x^2}{a},-\frac{f x^2}{d}\right )+\frac{1}{3} C x^3 \left (a+c x^2\right )^p \left (\frac{c x^2}{a}+1\right )^{-p} \left (d+f x^2\right )^q \left (\frac{f x^2}{d}+1\right )^{-q} F_1\left (\frac{3}{2};-p,-q;\frac{5}{2};-\frac{c x^2}{a},-\frac{f x^2}{d}\right )+\frac{B \left (a+c x^2\right )^{p+1} \left (d+f x^2\right )^q \left (\frac{c \left (d+f x^2\right )}{c d-a f}\right )^{-q} \, _2F_1\left (p+1,-q;p+2;-\frac{f \left (c x^2+a\right )}{c d-a f}\right )}{2 c (p+1)}$

[Out]

(A*x*(a + c*x^2)^p*(d + f*x^2)^q*AppellF1[1/2, -p, -q, 3/2, -((c*x^2)/a), -((f*x^2)/d)])/((1 + (c*x^2)/a)^p*(1
+ (f*x^2)/d)^q) + (C*x^3*(a + c*x^2)^p*(d + f*x^2)^q*AppellF1[3/2, -p, -q, 5/2, -((c*x^2)/a), -((f*x^2)/d)])/
(3*(1 + (c*x^2)/a)^p*(1 + (f*x^2)/d)^q) + (B*(a + c*x^2)^(1 + p)*(d + f*x^2)^q*Hypergeometric2F1[1 + p, -q, 2
+ p, -((f*(a + c*x^2))/(c*d - a*f))])/(2*c*(1 + p)*((c*(d + f*x^2))/(c*d - a*f))^q)

________________________________________________________________________________________

Rubi [A]  time = 0.480678, antiderivative size = 252, normalized size of antiderivative = 1., number of steps used = 11, number of rules used = 8, integrand size = 29, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.276, Rules used = {6742, 430, 429, 444, 70, 69, 511, 510} $A x \left (a+c x^2\right )^p \left (\frac{c x^2}{a}+1\right )^{-p} \left (d+f x^2\right )^q \left (\frac{f x^2}{d}+1\right )^{-q} F_1\left (\frac{1}{2};-p,-q;\frac{3}{2};-\frac{c x^2}{a},-\frac{f x^2}{d}\right )+\frac{1}{3} C x^3 \left (a+c x^2\right )^p \left (\frac{c x^2}{a}+1\right )^{-p} \left (d+f x^2\right )^q \left (\frac{f x^2}{d}+1\right )^{-q} F_1\left (\frac{3}{2};-p,-q;\frac{5}{2};-\frac{c x^2}{a},-\frac{f x^2}{d}\right )+\frac{B \left (a+c x^2\right )^{p+1} \left (d+f x^2\right )^q \left (\frac{c \left (d+f x^2\right )}{c d-a f}\right )^{-q} \, _2F_1\left (p+1,-q;p+2;-\frac{f \left (c x^2+a\right )}{c d-a f}\right )}{2 c (p+1)}$

Antiderivative was successfully veriﬁed.

[In]

Int[(a + c*x^2)^p*(A + B*x + C*x^2)*(d + f*x^2)^q,x]

[Out]

(A*x*(a + c*x^2)^p*(d + f*x^2)^q*AppellF1[1/2, -p, -q, 3/2, -((c*x^2)/a), -((f*x^2)/d)])/((1 + (c*x^2)/a)^p*(1
+ (f*x^2)/d)^q) + (C*x^3*(a + c*x^2)^p*(d + f*x^2)^q*AppellF1[3/2, -p, -q, 5/2, -((c*x^2)/a), -((f*x^2)/d)])/
(3*(1 + (c*x^2)/a)^p*(1 + (f*x^2)/d)^q) + (B*(a + c*x^2)^(1 + p)*(d + f*x^2)^q*Hypergeometric2F1[1 + p, -q, 2
+ p, -((f*(a + c*x^2))/(c*d - a*f))])/(2*c*(1 + p)*((c*(d + f*x^2))/(c*d - a*f))^q)

Rule 6742

Int[u_, x_Symbol] :> With[{v = ExpandIntegrand[u, x]}, Int[v, x] /; SumQ[v]]

Rule 430

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_))^(q_), x_Symbol] :> Dist[(a^IntPart[p]*(a + b*x^n)^F
racPart[p])/(1 + (b*x^n)/a)^FracPart[p], Int[(1 + (b*x^n)/a)^p*(c + d*x^n)^q, x], x] /; FreeQ[{a, b, c, d, n,
p, q}, x] && NeQ[b*c - a*d, 0] && NeQ[n, -1] &&  !(IntegerQ[p] || GtQ[a, 0])

Rule 429

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_))^(q_), x_Symbol] :> Simp[a^p*c^q*x*AppellF1[1/n, -p,
-q, 1 + 1/n, -((b*x^n)/a), -((d*x^n)/c)], x] /; FreeQ[{a, b, c, d, n, p, q}, x] && NeQ[b*c - a*d, 0] && NeQ[n
, -1] && (IntegerQ[p] || GtQ[a, 0]) && (IntegerQ[q] || GtQ[c, 0])

Rule 444

Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_))^(q_.), x_Symbol] :> Dist[1/n, Subst[Int
[(a + b*x)^p*(c + d*x)^q, x], x, x^n], x] /; FreeQ[{a, b, c, d, m, n, p, q}, x] && NeQ[b*c - a*d, 0] && EqQ[m
- n + 1, 0]

Rule 70

Int[((a_) + (b_.)*(x_))^(m_)*((c_) + (d_.)*(x_))^(n_), x_Symbol] :> Dist[(c + d*x)^FracPart[n]/((b/(b*c - a*d)
)^IntPart[n]*((b*(c + d*x))/(b*c - a*d))^FracPart[n]), Int[(a + b*x)^m*Simp[(b*c)/(b*c - a*d) + (b*d*x)/(b*c -
a*d), x]^n, x], x] /; FreeQ[{a, b, c, d, m, n}, x] && NeQ[b*c - a*d, 0] &&  !IntegerQ[m] &&  !IntegerQ[n] &&
(RationalQ[m] ||  !SimplerQ[n + 1, m + 1])

Rule 69

Int[((a_) + (b_.)*(x_))^(m_)*((c_) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[((a + b*x)^(m + 1)*Hypergeometric2F1[
-n, m + 1, m + 2, -((d*(a + b*x))/(b*c - a*d))])/(b*(m + 1)*(b/(b*c - a*d))^n), x] /; FreeQ[{a, b, c, d, m, n}
, x] && NeQ[b*c - a*d, 0] &&  !IntegerQ[m] &&  !IntegerQ[n] && GtQ[b/(b*c - a*d), 0] && (RationalQ[m] ||  !(Ra
tionalQ[n] && GtQ[-(d/(b*c - a*d)), 0]))

Rule 511

Int[((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_))^(q_), x_Symbol] :> Dist[(a^IntPa
rt[p]*(a + b*x^n)^FracPart[p])/(1 + (b*x^n)/a)^FracPart[p], Int[(e*x)^m*(1 + (b*x^n)/a)^p*(c + d*x^n)^q, x], x
] /; FreeQ[{a, b, c, d, e, m, n, p, q}, x] && NeQ[b*c - a*d, 0] && NeQ[m, -1] && NeQ[m, n - 1] &&  !(IntegerQ[
p] || GtQ[a, 0])

Rule 510

Int[((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_))^(q_), x_Symbol] :> Simp[(a^p*c^q
*(e*x)^(m + 1)*AppellF1[(m + 1)/n, -p, -q, 1 + (m + 1)/n, -((b*x^n)/a), -((d*x^n)/c)])/(e*(m + 1)), x] /; Free
Q[{a, b, c, d, e, m, n, p, q}, x] && NeQ[b*c - a*d, 0] && NeQ[m, -1] && NeQ[m, n - 1] && (IntegerQ[p] || GtQ[a
, 0]) && (IntegerQ[q] || GtQ[c, 0])

Rubi steps

\begin{align*} \int \left (a+c x^2\right )^p \left (A+B x+C x^2\right ) \left (d+f x^2\right )^q \, dx &=\int \left (A \left (a+c x^2\right )^p \left (d+f x^2\right )^q+B x \left (a+c x^2\right )^p \left (d+f x^2\right )^q+C x^2 \left (a+c x^2\right )^p \left (d+f x^2\right )^q\right ) \, dx\\ &=A \int \left (a+c x^2\right )^p \left (d+f x^2\right )^q \, dx+B \int x \left (a+c x^2\right )^p \left (d+f x^2\right )^q \, dx+C \int x^2 \left (a+c x^2\right )^p \left (d+f x^2\right )^q \, dx\\ &=\frac{1}{2} B \operatorname{Subst}\left (\int (a+c x)^p (d+f x)^q \, dx,x,x^2\right )+\left (A \left (a+c x^2\right )^p \left (1+\frac{c x^2}{a}\right )^{-p}\right ) \int \left (1+\frac{c x^2}{a}\right )^p \left (d+f x^2\right )^q \, dx+\left (C \left (a+c x^2\right )^p \left (1+\frac{c x^2}{a}\right )^{-p}\right ) \int x^2 \left (1+\frac{c x^2}{a}\right )^p \left (d+f x^2\right )^q \, dx\\ &=\frac{1}{2} \left (B \left (d+f x^2\right )^q \left (\frac{c \left (d+f x^2\right )}{c d-a f}\right )^{-q}\right ) \operatorname{Subst}\left (\int (a+c x)^p \left (\frac{c d}{c d-a f}+\frac{c f x}{c d-a f}\right )^q \, dx,x,x^2\right )+\left (A \left (a+c x^2\right )^p \left (1+\frac{c x^2}{a}\right )^{-p} \left (d+f x^2\right )^q \left (1+\frac{f x^2}{d}\right )^{-q}\right ) \int \left (1+\frac{c x^2}{a}\right )^p \left (1+\frac{f x^2}{d}\right )^q \, dx+\left (C \left (a+c x^2\right )^p \left (1+\frac{c x^2}{a}\right )^{-p} \left (d+f x^2\right )^q \left (1+\frac{f x^2}{d}\right )^{-q}\right ) \int x^2 \left (1+\frac{c x^2}{a}\right )^p \left (1+\frac{f x^2}{d}\right )^q \, dx\\ &=A x \left (a+c x^2\right )^p \left (1+\frac{c x^2}{a}\right )^{-p} \left (d+f x^2\right )^q \left (1+\frac{f x^2}{d}\right )^{-q} F_1\left (\frac{1}{2};-p,-q;\frac{3}{2};-\frac{c x^2}{a},-\frac{f x^2}{d}\right )+\frac{1}{3} C x^3 \left (a+c x^2\right )^p \left (1+\frac{c x^2}{a}\right )^{-p} \left (d+f x^2\right )^q \left (1+\frac{f x^2}{d}\right )^{-q} F_1\left (\frac{3}{2};-p,-q;\frac{5}{2};-\frac{c x^2}{a},-\frac{f x^2}{d}\right )+\frac{B \left (a+c x^2\right )^{1+p} \left (d+f x^2\right )^q \left (\frac{c \left (d+f x^2\right )}{c d-a f}\right )^{-q} \, _2F_1\left (1+p,-q;2+p;-\frac{f \left (a+c x^2\right )}{c d-a f}\right )}{2 c (1+p)}\\ \end{align*}

Mathematica [A]  time = 0.530799, size = 302, normalized size = 1.2 $\frac{1}{6} x \left (a+c x^2\right )^p \left (d+f x^2\right )^q \left (\frac{18 a A d F_1\left (\frac{1}{2};-p,-q;\frac{3}{2};-\frac{c x^2}{a},-\frac{f x^2}{d}\right )}{2 x^2 \left (c d p F_1\left (\frac{3}{2};1-p,-q;\frac{5}{2};-\frac{c x^2}{a},-\frac{f x^2}{d}\right )+a f q F_1\left (\frac{3}{2};-p,1-q;\frac{5}{2};-\frac{c x^2}{a},-\frac{f x^2}{d}\right )\right )+3 a d F_1\left (\frac{1}{2};-p,-q;\frac{3}{2};-\frac{c x^2}{a},-\frac{f x^2}{d}\right )}+3 B x \left (\frac{c x^2}{a}+1\right )^{-p} \left (\frac{f x^2}{d}+1\right )^{-q} F_1\left (1;-p,-q;2;-\frac{c x^2}{a},-\frac{f x^2}{d}\right )+2 C x^2 \left (\frac{c x^2}{a}+1\right )^{-p} \left (\frac{f x^2}{d}+1\right )^{-q} F_1\left (\frac{3}{2};-p,-q;\frac{5}{2};-\frac{c x^2}{a},-\frac{f x^2}{d}\right )\right )$

Warning: Unable to verify antiderivative.

[In]

Integrate[(a + c*x^2)^p*(A + B*x + C*x^2)*(d + f*x^2)^q,x]

[Out]

(x*(a + c*x^2)^p*(d + f*x^2)^q*((3*B*x*AppellF1[1, -p, -q, 2, -((c*x^2)/a), -((f*x^2)/d)])/((1 + (c*x^2)/a)^p*
(1 + (f*x^2)/d)^q) + (18*a*A*d*AppellF1[1/2, -p, -q, 3/2, -((c*x^2)/a), -((f*x^2)/d)])/(3*a*d*AppellF1[1/2, -p
, -q, 3/2, -((c*x^2)/a), -((f*x^2)/d)] + 2*x^2*(c*d*p*AppellF1[3/2, 1 - p, -q, 5/2, -((c*x^2)/a), -((f*x^2)/d)
] + a*f*q*AppellF1[3/2, -p, 1 - q, 5/2, -((c*x^2)/a), -((f*x^2)/d)])) + (2*C*x^2*AppellF1[3/2, -p, -q, 5/2, -(
(c*x^2)/a), -((f*x^2)/d)])/((1 + (c*x^2)/a)^p*(1 + (f*x^2)/d)^q)))/6

________________________________________________________________________________________

Maple [F]  time = 0.618, size = 0, normalized size = 0. \begin{align*} \int \left ( c{x}^{2}+a \right ) ^{p} \left ( C{x}^{2}+Bx+A \right ) \left ( f{x}^{2}+d \right ) ^{q}\, dx \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

int((c*x^2+a)^p*(C*x^2+B*x+A)*(f*x^2+d)^q,x)

[Out]

int((c*x^2+a)^p*(C*x^2+B*x+A)*(f*x^2+d)^q,x)

________________________________________________________________________________________

Maxima [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (C x^{2} + B x + A\right )}{\left (c x^{2} + a\right )}^{p}{\left (f x^{2} + d\right )}^{q}\,{d x} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate((c*x^2+a)^p*(C*x^2+B*x+A)*(f*x^2+d)^q,x, algorithm="maxima")

[Out]

integrate((C*x^2 + B*x + A)*(c*x^2 + a)^p*(f*x^2 + d)^q, x)

________________________________________________________________________________________

Fricas [F]  time = 0., size = 0, normalized size = 0. \begin{align*}{\rm integral}\left ({\left (C x^{2} + B x + A\right )}{\left (c x^{2} + a\right )}^{p}{\left (f x^{2} + d\right )}^{q}, x\right ) \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate((c*x^2+a)^p*(C*x^2+B*x+A)*(f*x^2+d)^q,x, algorithm="fricas")

[Out]

integral((C*x^2 + B*x + A)*(c*x^2 + a)^p*(f*x^2 + d)^q, x)

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate((c*x**2+a)**p*(C*x**2+B*x+A)*(f*x**2+d)**q,x)

[Out]

Timed out

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (C x^{2} + B x + A\right )}{\left (c x^{2} + a\right )}^{p}{\left (f x^{2} + d\right )}^{q}\,{d x} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate((c*x^2+a)^p*(C*x^2+B*x+A)*(f*x^2+d)^q,x, algorithm="giac")

[Out]

integrate((C*x^2 + B*x + A)*(c*x^2 + a)^p*(f*x^2 + d)^q, x)