Rules for integrands of the form(((a+b x+c (x^2)))^p)

1.  ∫(((a+b x+c (x^2)))^p)dx  when (b^2)-4 a c==0

1:  ∫(((a+b x+c (x^2)))^p)dx  when (b^2)-4 a c==0 ∧ p<-1

Derivation: Piecewise constant extraction

Basis: If  (b^2)-4 a c==0, then (∂_x)((((a+b x+c (x^2)))^(p+1))/(((b+2 c x))^(2 (p+1))))==0

Rule 1.2.1.1.1.1: If  (b^2)-4 a c==0 ∧ p<-1, then

∫(((a+b x+c (x^2)))^p)dx  ⟶  ((4 c (((a+b x+c (x^2)))^(p+1)))/(((b+2 c x))^(2 (p+1))))∫(((b+2 c x))^(2 p))dx  ⟶  ((2 (((a+b x+c (x^2)))^(p+1)))/((2 p+1) (b+2c x)))

Program code:

Int[(a_+b_.*x_+c_.*x_^2)^p_,x_Symbol] :=
  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]

2.  ∫(((a+b x+c (x^2)))^p)dx  when (b^2)-4 a c==0 ∧ p≮-1

1:  ∫(1/(Sqrt[a+b x+c (x^2)]))dx  when (b^2)-4 a c==0

Reference: G&R 2.261.3 which is correct only for (b/2)+c x>0

Derivation: Piecewise constant extraction

Basis: If  (b^2)-4 a c==0, then (∂_x)(((b/2)+c x)/(Sqrt[a+b x+c (x^2)]))==0

Rule 1.2.1.1.1.1: If  (b^2)-4 a c==0, then

∫(1/(Sqrt[a+b x+c (x^2)]))dx  ⟶  (((b/2)+c x)/(Sqrt[a+b x+c (x^2)]))∫(1/((b/2)+c x))dx

Program code:

Int[1/Sqrt[a_+b_.*x_+c_.*x_^2],x_Symbol] :=
  (b/2+c*x)/Sqrt[a+b*x+c*x^2]*Int[1/(b/2+c*x),x] /;
FreeQ[{a,b,c},x] && EqQ[b^2-4*a*c,0]

2:  ∫(((a+b x+c (x^2)))^p)dx  when (b^2)-4 a c==0 ∧ p≠-(1/2)

Derivation: Piecewise constant extraction

Basis: If  (b^2)-4 a c==0, then (∂_x)((((a+b x+c (x^2)))^p)/(((b+2 c x))^(2 p)))==0

Rule 1.2.1.1.1.2: If  (b^2)-4 a c==0 ∧ p≠-(1/2), then

∫(((a+b x+c (x^2)))^p)dx  ⟶  ((((a+b x+c (x^2)))^p)/(((b+2 c x))^(2 p)))∫(((b+2 c x))^(2 p))dx  ⟶  (((b+2c x) (((a+b x+c (x^2)))^p))/(2c (2 p+1)))

Program code:

Int[(a_+b_.*x_+c_.*x_^2)^p_,x_Symbol] :=
  (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]

2.  ∫(((a+b x+c (x^2)))^p)dx  when (b^2)-4a c≠0 ∧ 4 p∈ℤ ∧ p>0

1.  ∫(((a+b x+c (x^2)))^p)dx  when (b^2)-4a c≠0 ∧ p>0 ∧ p∈ℤ

1:  ∫(((a+b x+c (x^2)))^p)dx  when (b^2)-4 a c≠0 ∧ p∈(SuperPlus[ℤ])∧ PerfectSquare[(b^2)-4 a c]

Derivation: Algebraic expansion

Basis: Let q=(Sqrt[(b^2)-4 a c]), then a+b z+c (z^2)==(1/c)((b/2)-(q/2)+c x)((b/2)+(q/2)+c x)

Rule 1.2.1.1.2.1.1: If  (b^2)-4 a c≠0 ∧ p∈(SuperPlus[ℤ])∧ PerfectSquare[(b^2)-4 a c], let q=(Sqrt[(b^2)-4 a c]), then

∫(((a+b x+c (x^2)))^p)dx  ⟶  (1/(c^p))∫((((b/2)-(q/2)+c x))^p) ((((b/2)+(q/2)+c x))^p)dx

Program code:

Int[(a_+b_.*x_+c_.*x_^2)^p_,x_Symbol] :=
  With[{q=Rt[b^2-4*a*c,2]},
  1/c^p*Int[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]

2:  ∫(((a+b x+c (x^2)))^p)dx  when (b^2)-4 a c≠0 ∧ p∈(SuperPlus[ℤ])∧ ¬PerfectSquare[(b^2)-4 a c]

Derivation: Algebraic expansion

Rule 1.2.1.1.2.1.2: If  (b^2)-4 a c≠0 ∧ p∈(SuperPlus[ℤ])∧ ¬PerfectSquare[(b^2)-4 a c], then

∫(((a+b x+c (x^2)))^p)dx  ⟶  ∫ExpandIntegrand[(((a+b x+c (x^2)))^p),x]dx

Program code:

Int[(a_.+b_.*x_+c_.*x_^2)^p_,x_Symbol] :=
  Int[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]])

2:  ∫(((a+b x+c (x^2)))^p)dx  when (b^2)-4a c≠0 ∧ p>0 ∧ p∉ℤ

Reference: G&R 2.260.2, CRC 245, A&S 3.3.37

Derivation: Quadratic recurrence 1b with m=-1, A=d and B=e

Rule 1.2.1.1.2.2: If  (b^2)-4a c≠0 ∧ p>0 ∧ p∉ℤ, then

∫(((a+b x+c (x^2)))^p)dx  ⟶  (((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)))∫(((a+b x+c (x^2)))^(p-1))dx

Program code:

Int[(a_.+b_.*x_+c_.*x_^2)^p_,x_Symbol] :=
  (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))*Int[(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]

3.  ∫(((a+b x+c (x^2)))^p)dx  when (b^2)-4a c≠0 ∧ 4 p∈ℤ ∧ p<-1

1:  ∫(1/(((a+b x+c (x^2)))^(3/2)))dx  when (b^2)-4 a c≠0

Reference: G&R 2.264.5, CRC 239

Derivation: Quadratic recurrence 2a with m=0, A=1, B=0 and p=-(3/2)

Rule 1.2.1.1.3.1: If  (b^2)-4 a c≠0, then

∫(1/(((a+b x+c (x^2)))^(3/2)))dx  ⟶  -((2 (b+2 c x))/(((b^2)-4 a c) (Sqrt[a+b x+c (x^2)])))

Program code:

Int[1/(a_.+b_.*x_+c_.*x_^2)^(3/2),x_Symbol] :=
  -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]

2:  ∫(((a+b x+c (x^2)))^p)dx  when (b^2)-4a c≠0 ∧ p<-1 ∧ p≠-(3/2)

Reference: G&R 2.171.3, G&R 2.263.3, CRC 113, CRC 241

Derivation: Quadratic recurrence 2a with m=0, A=1 and B=0

Rule 1.2.1.1.3.2: If  (b^2)-4a c≠0 ∧ p<-1 ∧ p≠-(3/2), then

∫(((a+b x+c (x^2)))^p)dx  ⟶  (((b+2 c x)(((a+b x+c (x^2)))^(p+1)))/((p+1)((b^2)-4 a c)))-((2c(2p+3))/((p+1)((b^2)-4 a c)))∫(((a+b x+c (x^2)))^(p+1))dx

Program code:

Int[(a_.+b_.*x_+c_.*x_^2)^p_,x_Symbol] :=
  (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))*Int[(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]

4.  ∫(1/(a+b x+c (x^2)))dx  when (b^2)-4 a c≠0

1:  ∫(1/(b x+c (x^2)))dx

Derivation: Algebraic expansion

Rule 1.2.1.1.4.1:

∫(1/(b x+c (x^2)))dx  ⟶  (1/b)∫(1/x)dx-(c/b)∫(1/(b+c x))dx  ⟶  ((Log[x])/b)-((Log[b+c x])/b)

Program code:

Int[1/(b_.*x_+c_.*x_^2),x_Symbol] :=
  Log[x]/b - Log[RemoveContent[b+c*x,x]]/b /;
FreeQ[{b,c},x]

2:  ∫(1/(a+b x+c (x^2)))dx  when (b^2)-4 a c≠0 ∧ (b^2)-4 a c>0 ∧ PerfectSquare[(b^2)-4 a c]

Reference: G&R 2.161.1a

Derivation: Algebraic expansion

Basis: Let q->(Sqrt[(b^2)-4 a c]), then (1/(a+b z+c (z^2)))==(c/q)(1/(((b-q)/2)+c z))-(c/q)(1/(((b+q)/2)+c z))

Rule 1.2.1.1.4.2: If  (b^2)-4 a c≠0 ∧ (b^2)-4 a c>0 ∧ PerfectSquare[(b^2)-4 a c], let q->(Sqrt[(b^2)-4 a c]), then

∫(1/(a+b x+c (x^2)))dx  ⟶  (c/q)∫(1/((b/2)-(q/2)+c x))dx-(c/q)∫(1/((b/2)+(q/2)+c x))dx

Program code:

Int[1/(a_.+b_.*x_+c_.*x_^2),x_Symbol] :=
  With[{q=Rt[b^2-4*a*c,2]},
  c/q*Int[1/Simp[b/2-q/2+c*x,x],x] - c/q*Int[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]

3:  ∫(1/(a+b x+c (x^2)))dx  when (b^2)-4a c∉ℝ ∧ (((b^2)-4 a c)/(b^2))∈ℝ

Reference: G&R 2.172.4, CRC 109, A&S 3.3.16

Reference: G&R 2.172.2, CRC 110a, A&S 3.3.17

Derivation: Integration by substitution

Basis: (1/(a+b x+c (x^2)))==-(2/b) Subst[(1/(q-(x^2))),x,1+((2 c x)/b)] (∂_x)(1+((2 c x)/b))

Rule 1.2.1.1.4.3: If  (b^2)-4a c∉ℝ, let q->(((b^2)-4 a c)/(b^2)), if  q∈ℝ, then

∫(1/(a+b x+c (x^2)))dx  ⟶  -(2/b)Subst[∫(1/(q-(x^2)))dx,x,1+((2 c x)/b)]

Program code:

Int[1/(a_+b_.*x_+c_.*x_^2),x_Symbol] :=
  With[{q=1-4*Simplify[a*c/b^2]},
  -2/b*Subst[Int[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]

4:  ∫(1/(a+b x+c (x^2)))dx  when (b^2)-4 a c≠0

Reference: G&R 2.172.2, CRC 110a, A&S 3.3.17

Reference: G&R 2.172.4, CRC 109, A&S 3.3.16

Derivation: Integration by substitution

Basis: (1/(a+b x+c (x^2)))==-2 Subst[(1/((b^2)-4 a c-(x^2))),x,b+2 c x] (∂_x)(b+2 c x)

Rule 1.2.1.1.4.4: If  (b^2)-4 a c≠0, then

∫(1/(a+b x+c (x^2)))dx  ⟶  -2 Subst[∫(1/((b^2)-4 a c-(x^2)))dx,x,b+2 c x]

Program code:

Int[1/(a_.+b_.*x_+c_.*x_^2),x_Symbol] :=
  -2*Subst[Int[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]

5:  ∫(((a+b x+c (x^2)))^p)dx  when 4 a-((b^2)/c)>0

Derivation: Integration by substitution

Basis: If  4 a-((b^2)/c)>0, then (((a+b x+c (x^2)))^p)==(1/(2 c (((-((4 c)/((b^2)-4 a c))))^p))) Subst[(((1-((x^2)/((b^2)-4 a c))))^p),x,b+2 c x] (∂_x)(b+2 c x)

Rule 1.2.1.1.5: If  4 a-((b^2)/c)>0, then

∫(((a+b x+c (x^2)))^p)dx  ⟶  (1/(2 c (((-((4  c)/((b^2)-4 a c))))^p))) Subst[∫(((1-((x^2)/((b^2)-4 a c))))^p)dx,x,b+2 c x]

Program code:

Int[(a_.+b_.*x_+c_.*x_^2)^p_,x_Symbol] :=
  1/(2*c*(-4*c/(b^2-4*a*c))^p)*Subst[Int[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]

6.  ∫(1/(Sqrt[a+b x+c (x^2)]))dx  when (b^2)-4 a c≠0

1:  ∫(1/(Sqrt[b x+c (x^2)]))dx

Derivation: Integration by substitution

Basis: (1/(Sqrt[b x+c (x^2)]))==2 Subst[(1/(1-c (x^2))),x,(x/(Sqrt[b x+c (x^2)]))] (∂_x)(x/(Sqrt[b x+c (x^2)]))

Rule 1.2.1.1.6.1:

∫(1/(Sqrt[b x+c (x^2)]))dx  ⟶  2 Subst[∫(1/(1-c (x^2)))dx,x,(x/(Sqrt[b x+c (x^2)]))]

Program code:

Int[1/Sqrt[b_.*x_+c_.*x_^2],x_Symbol] :=
  2*Subst[Int[1/(1-c*x^2),x],x,x/Sqrt[b*x+c*x^2]] /;
FreeQ[{b,c},x]

2:  ∫(1/(Sqrt[a+b x+c (x^2)]))dx  when (b^2)-4 a c≠0

Reference: G&R 2.261.1, CRC 237a, A&S 3.3.33

Reference: CRC 238

Derivation: Integration by substitution

Basis: (1/(Sqrt[a+b x+c (x^2)]))==2 Subst[(1/(4 c-(x^2))),x,((b+2 c x)/(Sqrt[a+b x+c (x^2)]))] (∂_x)((b+2 c x)/(Sqrt[a+b x+c (x^2)]))

Rule 1.2.1.1.6.2: If  (b^2)-4 a c≠0, then

∫(1/(Sqrt[a+b x+c (x^2)]))dx  ⟶  2 Subst[∫(1/(4 c-(x^2)))dx,x,((b+2 c x)/(Sqrt[a+b x+c (x^2)]))]

Program code:

Int[1/Sqrt[a_+b_.*x_+c_.*x_^2],x_Symbol] :=
  2*Subst[Int[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]

7.  ∫(((a+b x+c (x^2)))^p)dx  when (b^2)-4a c≠0 ∧ 3≤Denominator[p]≤4

1:  ∫(((b x+c (x^2)))^p)dx  when 3≤Denominator[p]≤4

Derivation: Piecewise constant extraction

Basis: (∂_x)((((b x+c (x^2)))^p)/(((-((c (b x+c (x^2)))/(b^2))))^p))==0

Note: If this optional rule is deleted, the resulting antiderivative is less compact but real when the integrand is real.

Rule 1.2.1.1.7.1: If  3≤Denominator[p]≤4, then

∫(((b x+c (x^2)))^p)dx  ⟶  ((((b x+c (x^2)))^p)/(((-((c (b x+c (x^2)))/(b^2))))^p)) ∫(((-((c x)/b)-(((c^2) (x^2))/(b^2))))^p)dx

Program code:

Int[(b_.*x_+c_.*x_^2)^p_,x_Symbol] :=
  (b*x+c*x^2)^p/(-c*(b*x+c*x^2)/(b^2))^p*Int[(-c*x/b-c^2*x^2/b^2)^p,x] /;
FreeQ[{b,c},x] && RationalQ[p] && 3≤Denominator[p]≤4

x:  ∫(((a+b x+c (x^2)))^p)dx  when (b^2)-4a c≠0 ∧ 3≤Denominator[p]≤4

Derivation: Piecewise constant extraction

Basis: (∂_x)((((a+b x+c (x^2)))^p)/(((-((c (a+b x+c (x^2)))/((b^2)-4 a c))))^p))==0

Rule 1.2.1.1.7.2: If  (b^2)-4a c≠0 ∧ 3≤Denominator[p]≤4, then

∫(((a+b x+c (x^2)))^p)dx  ⟶  ((((a+b x+c (x^2)))^p)/(((-((c (a+b x+c (x^2)))/((b^2)-4 a c))))^p)) ∫(((-((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)dx

Program code:

(* Int[(a_.+b_.*x_+c_.*x_^2)^p_,x_Symbol] :=
  (a+b*x+c*x^2)^p/(-c*(a+b*x+c*x^2)/(b^2-4*a*c))^p*Int[(-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 *)

2:  ∫(((a+b x+c (x^2)))^p)dx  when (b^2)-4a c≠0 ∧ 3≤Denominator[p]≤4

Derivation: Integration by substitution and piecewise constant extraction

Basis: If  d∈(SuperPlus[ℤ]), then (((a+b x+c (x^2)))^p)==((d (Sqrt[(((b+2 c x))^2)]))/(b+2 c x))Subst[((x^(d(p+1)-1))/(Sqrt[(b^2)-4 a c+4 c (x^d)])),x,(((a+b x+c (x^2)))^(1/d))] (∂_x)(((a+b x+c (x^2)))^(1/d))

Basis: (∂_x)((Sqrt[(((b+2 c x))^2)])/(b+2 c x))==0

Note: Since d≤4, resulting integrand is an elliptic integral.

Rule 1.2.1.1.7.2: If  (b^2)-4a c≠0, let d->Denominator[p], if  3≤d≤4, then

∫(((a+b x+c (x^2)))^p)dx  ⟶  ((d (Sqrt[(((b+2 c x))^2)]))/(b+2 c x)) Subst[∫((x^(d(p+1)-1))/(Sqrt[(b^2)-4 a c+4 c (x^d)]))dx,x,(((a+b x+c (x^2)))^(1/d))]

Program code:

Int[(a_.+b_.*x_+c_.*x_^2)^p_,x_Symbol] :=
  With[{d=Denominator[p]},
  d*Sqrt[(b+2*c*x)^2]/(b+2*c*x)*Subst[Int[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]

H:  ∫(((a+b x+c (x^2)))^p)dx  when  (b^2)-4 a c≱0 ∧ 4 p∉ℤ

Derivation: Piecewise constant extraction

Basis: Let q=(Sqrt[(b^2)-4 a c]), then (∂_x)((((a+b x+c (x^2)))^p)/((((b+q+2 c x))^p) (((b-q+2 c x))^p)))==0

Rule 1.2.1.1.H: If  (b^2)-4 a c≱0 ∧ 4 p∉ℤ, let q=(Sqrt[(b^2)-4 a c]), then

∫(((a+b x+c (x^2)))^p)dx  ⟶  ((((a+b x+c (x^2)))^p)/((((b+q+2 c x))^p) (((b-q+2 c x))^p))) ∫(((b+q+2 c x))^p) (((b-q+2 c x))^p)dx

  ⟶  -((((a+b x+c (x^2)))^(p+1))/(q (p+1) (((((q-b-2 c x)/(2 q))))^(p+1)))) Hypergeometric2F1[-p,p+1,p+2,((b+q+2 c x)/(2 q))]

Program code:

Int[(a_.+b_.*x_+c_.*x_^2)^p_,x_Symbol] :=
  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)/(2*q))^(p+1))*Hypergeometric2F1[-p,p+1,p+2,(b+q+2*c*x)/(2*q)]] /;
FreeQ[{a,b,c,p},x] && NeQ[b^2-4*a*c,0] && Not[IntegerQ[4*p]]

S:  ∫(((a+b u+c (u^2)))^p)dx  when  u==d+e x

Derivation: Integration by substitution

Rule 1.2.1.1.S: If  u==d+e x, then

∫(((a+b u+c (u^2)))^p)dx  ⟶  (1/e)Subst[∫(((a+b x+c (x^2)))^p)dx,x,u]

Program code:

Int[(a_.+b_.*u_+c_.*u_^2)^p_,x_Symbol] :=
  1/Coefficient[u,x,1]*Subst[Int[(a+b*x+c*x^2)^p,x],x,u] /;
FreeQ[{a,b,c,p},x] && LinearQ[u,x] && NeQ[u,x]