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

Optimal. Leaf size=167 $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{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) + (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.152508, antiderivative size = 167, normalized size of antiderivative = 1., number of steps used = 7, number of rules used = 6, integrand size = 24, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.25, Rules used = {1010, 430, 429, 444, 70, 69} $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{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 + B*x)*(a + c*x^2)^p*(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) + (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 1010

Int[((g_) + (h_.)*(x_))*((a_) + (c_.)*(x_)^2)^(p_)*((d_) + (f_.)*(x_)^2)^(q_), x_Symbol] :> Dist[g, Int[(a + c
*x^2)^p*(d + f*x^2)^q, x], x] + Dist[h, Int[x*(a + c*x^2)^p*(d + f*x^2)^q, x], x] /; FreeQ[{a, c, d, f, g, h,
p, q}, x]

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]))

Rubi steps

\begin{align*} \int (A+B x) \left (a+c x^2\right )^p \left (d+f x^2\right )^q \, 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\\ &=\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\\ &=\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\\ &=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{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.330761, size = 236, normalized size = 1.41 $\frac{1}{2} x \left (a+c x^2\right )^p \left (d+f x^2\right )^q \left (\frac{6 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 )}+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 )\right )$

Warning: Unable to verify antiderivative.

[In]

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

[Out]

(x*(a + c*x^2)^p*(d + f*x^2)^q*((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) + (6*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

________________________________________________________________________________________

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

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

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (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((B*x+A)*(c*x^2+a)^p*(f*x^2+d)^q,x, algorithm="maxima")

[Out]

integrate((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 (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((B*x+A)*(c*x^2+a)^p*(f*x^2+d)^q,x, algorithm="fricas")

[Out]

integral((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((B*x+A)*(c*x**2+a)**p*(f*x**2+d)**q,x)

[Out]

Timed out

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (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((B*x+A)*(c*x^2+a)^p*(f*x^2+d)^q,x, algorithm="giac")

[Out]

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