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

0:  ∫(((a+b x+c (x^2)))^p)dx  when p==0 ∨ c==0 ∨ b==0

Derivation: Constant extraction

Rule 1.2.1.1.0.1: If  p==0, then

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

Rule 1.2.1.1.0.2: If  c==0, then

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

Rule 1.2.1.1.0.3: If  b==0, then

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

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∈ℤ

Derivation: Algebraic simplification

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

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

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

Program code:

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

2:  ∫(((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.2: 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]

3:  ∫(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.3: 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]

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

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.4: If  (b^2)-4 a c==0, 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]

2.  ∫(((a+b x+c (x^2)))^p)dx  when p∈ℤ

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

Rule 1.2.1.1.2.0:

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

1:  ∫(((a+b x+c (x^2)))^p)dx  when p∈ℤ ∧ a≠0 ∧ PerfectSquareQ[(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: If  p∈(SuperPlus[ℤ])∧ a≠0 ∧ PerfectSquareQ[(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] && IntegerQ[p] && NeQ[a,0] && PerfectSquareQ[b^2-4*a*c]

2:  ∫(((a+b x+c (x^2)))^p)dx  when p∈(SuperPlus[ℤ])

Derivation: Algebraic expansion

Rule 1.2.1.1.2.2: If  p∈(SuperPlus[ℤ]), 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] && IGtQ[p,0]

3:  ∫(((a+b x+c (x^2)))^p)dx  when p+1∈(SuperMinus[ℤ])

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.2.3: If  p+1∈(SuperMinus[ℤ]), 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] && ILtQ[p,-1]

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

Derivation: Algebraic expansion

Rule 1.2.1.1.2.4:

∫(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]

5:  ∫(1/(a+b x+c (x^2)))dx  when (b^2)-4a c∉ℝ ∧ 1-((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: Let q->1-((4 a c)/(b^2)), then (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.2.5: If  (b^2)-4a c∉ℝ, let q->1-((4 a c)/(b^2)), if  q∈ℝ ∧ ((q^2)==1 ∨  (b^2)-4 a c∉ℝ), 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]

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

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.2.6:

∫(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]

3:  ∫(((a+b x+c (x^2)))^p)dx  when p>0 ∧ (4 p∈ℤ ∨ 3 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.3: If p>0 ∧ (4 p∈ℤ ∨ 3 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] && GtQ[p,0] && (IntegerQ[4*p] || IntegerQ[3*p])

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

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.4.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 p<-1 ∧ (4 p∈ℤ ∨ 3 p∈ℤ)

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.4.2: If p<-1 ∧ (4 p∈ℤ ∨ 3 p∈ℤ), 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] && LtQ[p,-1] && (IntegerQ[4*p] || IntegerQ[3*p])

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 p∈ℤ ∨ 3 p∈ℤ) ∧ 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

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

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:

∫(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]

7:  ∫(((b x+c (x^2)))^p)dx  when 4 p∈ℤ ∨ 3 p∈ℤ

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: If  3 p∈ℤ, 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] && (IntegerQ[4*p] || IntegerQ[3*p])

8:  ∫(((a+b x+c (x^2)))^p)dx  when 4 p∈ℤ

Derivation: Integration by substitution and piecewise constant extraction

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

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

Note: Antiderivative of resulting integral can be expressed in terms of elliptic integral functions.

Rule 1.2.1.1.8: If  4 p∈ℤ, then

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

Program code:

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

9:  ∫(((a+b x+c (x^2)))^p)dx  when 3 p∈ℤ

Derivation: Integration by substitution and piecewise constant extraction

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

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

Note: Antiderivative of resulting integral can be expressed in terms of elliptic integral functions.

Rule 1.2.1.1.9: If  3 p∈ℤ, then

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

Program code:

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

10:  ∫(((a+b x+c (x^2)))^p)dx  when  (b^2)-4 a c≱0 ∧ 4 p∉ℤ ∧ 3 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.10: If  (b^2)-4 a c≱0 ∧ 4 p∉ℤ ∧ 3 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] && Not[IntegerQ[4*p]] && Not[IntegerQ[3*p]]