\(\int (e+f x)^2 \log (a+b \tanh (c+d x)) \, dx\) [34]

Optimal result
Mathematica [A] (verified)
Rubi [F]
Maple [C] (warning: unable to verify)
Fricas [C] (verification not implemented)
Sympy [F]
Maxima [B] (verification not implemented)
Giac [F]
Mupad [F(-1)]
Reduce [F]

Optimal result

Integrand size = 19, antiderivative size = 271 \[ \int (e+f x)^2 \log (a+b \tanh (c+d x)) \, dx=\frac {(e+f x)^3 \log \left (1+e^{2 (c+d x)}\right )}{3 f}-\frac {(e+f x)^3 \log \left (1+\frac {(a+b) e^{2 (c+d x)}}{a-b}\right )}{3 f}+\frac {(e+f x)^3 \log (a+b \tanh (c+d x))}{3 f}+\frac {(e+f x)^2 \operatorname {PolyLog}\left (2,-e^{2 (c+d x)}\right )}{2 d}-\frac {(e+f x)^2 \operatorname {PolyLog}\left (2,-\frac {(a+b) e^{2 (c+d x)}}{a-b}\right )}{2 d}-\frac {f (e+f x) \operatorname {PolyLog}\left (3,-e^{2 (c+d x)}\right )}{2 d^2}+\frac {f (e+f x) \operatorname {PolyLog}\left (3,-\frac {(a+b) e^{2 (c+d x)}}{a-b}\right )}{2 d^2}+\frac {f^2 \operatorname {PolyLog}\left (4,-e^{2 (c+d x)}\right )}{4 d^3}-\frac {f^2 \operatorname {PolyLog}\left (4,-\frac {(a+b) e^{2 (c+d x)}}{a-b}\right )}{4 d^3} \] Output:

1/3*(f*x+e)^3*ln(1+exp(2*d*x+2*c))/f-1/3*(f*x+e)^3*ln(1+(a+b)*exp(2*d*x+2* 
c)/(a-b))/f+1/3*(f*x+e)^3*ln(a+b*tanh(d*x+c))/f+1/2*(f*x+e)^2*polylog(2,-e 
xp(2*d*x+2*c))/d-1/2*(f*x+e)^2*polylog(2,-(a+b)*exp(2*d*x+2*c)/(a-b))/d-1/ 
2*f*(f*x+e)*polylog(3,-exp(2*d*x+2*c))/d^2+1/2*f*(f*x+e)*polylog(3,-(a+b)* 
exp(2*d*x+2*c)/(a-b))/d^2+1/4*f^2*polylog(4,-exp(2*d*x+2*c))/d^3-1/4*f^2*p 
olylog(4,-(a+b)*exp(2*d*x+2*c)/(a-b))/d^3
 

Mathematica [A] (verified)

Time = 3.38 (sec) , antiderivative size = 434, normalized size of antiderivative = 1.60 \[ \int (e+f x)^2 \log (a+b \tanh (c+d x)) \, dx=\frac {12 d^3 e^2 x \log \left (1+e^{-2 (c+d x)}\right )+12 d^3 e f x^2 \log \left (1+e^{-2 (c+d x)}\right )+4 d^3 f^2 x^3 \log \left (1+e^{-2 (c+d x)}\right )-12 d^3 e^2 x \log \left (1+\frac {(a-b) e^{-2 (c+d x)}}{a+b}\right )-12 d^3 e f x^2 \log \left (1+\frac {(a-b) e^{-2 (c+d x)}}{a+b}\right )-4 d^3 f^2 x^3 \log \left (1+\frac {(a-b) e^{-2 (c+d x)}}{a+b}\right )+12 d^3 e^2 x \log (a+b \tanh (c+d x))+12 d^3 e f x^2 \log (a+b \tanh (c+d x))+4 d^3 f^2 x^3 \log (a+b \tanh (c+d x))-6 d^2 (e+f x)^2 \operatorname {PolyLog}\left (2,-e^{-2 (c+d x)}\right )+6 d^2 (e+f x)^2 \operatorname {PolyLog}\left (2,\frac {(-a+b) e^{-2 (c+d x)}}{a+b}\right )-6 d e f \operatorname {PolyLog}\left (3,-e^{-2 (c+d x)}\right )-6 d f^2 x \operatorname {PolyLog}\left (3,-e^{-2 (c+d x)}\right )+6 d e f \operatorname {PolyLog}\left (3,\frac {(-a+b) e^{-2 (c+d x)}}{a+b}\right )+6 d f^2 x \operatorname {PolyLog}\left (3,\frac {(-a+b) e^{-2 (c+d x)}}{a+b}\right )-3 f^2 \operatorname {PolyLog}\left (4,-e^{-2 (c+d x)}\right )+3 f^2 \operatorname {PolyLog}\left (4,\frac {(-a+b) e^{-2 (c+d x)}}{a+b}\right )}{12 d^3} \] Input:

Integrate[(e + f*x)^2*Log[a + b*Tanh[c + d*x]],x]
 

Output:

(12*d^3*e^2*x*Log[1 + E^(-2*(c + d*x))] + 12*d^3*e*f*x^2*Log[1 + E^(-2*(c 
+ d*x))] + 4*d^3*f^2*x^3*Log[1 + E^(-2*(c + d*x))] - 12*d^3*e^2*x*Log[1 + 
(a - b)/((a + b)*E^(2*(c + d*x)))] - 12*d^3*e*f*x^2*Log[1 + (a - b)/((a + 
b)*E^(2*(c + d*x)))] - 4*d^3*f^2*x^3*Log[1 + (a - b)/((a + b)*E^(2*(c + d* 
x)))] + 12*d^3*e^2*x*Log[a + b*Tanh[c + d*x]] + 12*d^3*e*f*x^2*Log[a + b*T 
anh[c + d*x]] + 4*d^3*f^2*x^3*Log[a + b*Tanh[c + d*x]] - 6*d^2*(e + f*x)^2 
*PolyLog[2, -E^(-2*(c + d*x))] + 6*d^2*(e + f*x)^2*PolyLog[2, (-a + b)/((a 
 + b)*E^(2*(c + d*x)))] - 6*d*e*f*PolyLog[3, -E^(-2*(c + d*x))] - 6*d*f^2* 
x*PolyLog[3, -E^(-2*(c + d*x))] + 6*d*e*f*PolyLog[3, (-a + b)/((a + b)*E^( 
2*(c + d*x)))] + 6*d*f^2*x*PolyLog[3, (-a + b)/((a + b)*E^(2*(c + d*x)))] 
- 3*f^2*PolyLog[4, -E^(-2*(c + d*x))] + 3*f^2*PolyLog[4, (-a + b)/((a + b) 
*E^(2*(c + d*x)))])/(12*d^3)
 

Rubi [F]

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int (e+f x)^2 \log (a+b \tanh (c+d x)) \, dx\)

\(\Big \downarrow \) 3031

\(\displaystyle \frac {(e+f x)^3 \log (a+b \tanh (c+d x))}{3 f}-\frac {\int \frac {b d (e+f x)^3 \text {sech}^2(c+d x)}{a+b \tanh (c+d x)}dx}{3 f}\)

\(\Big \downarrow \) 27

\(\displaystyle \frac {(e+f x)^3 \log (a+b \tanh (c+d x))}{3 f}-\frac {b d \int \frac {(e+f x)^3 \text {sech}^2(c+d x)}{a+b \tanh (c+d x)}dx}{3 f}\)

\(\Big \downarrow \) 7293

\(\displaystyle \frac {(e+f x)^3 \log (a+b \tanh (c+d x))}{3 f}-\frac {b d \int \left (\frac {\text {sech}^2(c+d x) e^3}{a+b \tanh (c+d x)}+\frac {3 f x \text {sech}^2(c+d x) e^2}{a+b \tanh (c+d x)}+\frac {3 f^2 x^2 \text {sech}^2(c+d x) e}{a+b \tanh (c+d x)}+\frac {f^3 x^3 \text {sech}^2(c+d x)}{a+b \tanh (c+d x)}\right )dx}{3 f}\)

\(\Big \downarrow \) 2009

\(\displaystyle \frac {(e+f x)^3 \log (a+b \tanh (c+d x))}{3 f}-\frac {b d \left (3 e^2 f \int \frac {x \text {sech}^2(c+d x)}{a+b \tanh (c+d x)}dx+3 e f^2 \int \frac {x^2 \text {sech}^2(c+d x)}{a+b \tanh (c+d x)}dx+f^3 \int \frac {x^3 \text {sech}^2(c+d x)}{a+b \tanh (c+d x)}dx+\frac {e^3 \log (a+b \tanh (c+d x))}{b d}\right )}{3 f}\)

Input:

Int[(e + f*x)^2*Log[a + b*Tanh[c + d*x]],x]
 

Output:

$Aborted
 

Defintions of rubi rules used

rule 27
Int[(a_)*(Fx_), x_Symbol] :> Simp[a   Int[Fx, x], x] /; FreeQ[a, x] &&  !Ma 
tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
 

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 3031
Int[Log[u_]*((a_.) + (b_.)*(x_))^(m_.), x_Symbol] :> Simp[(a + b*x)^(m + 1) 
*(Log[u]/(b*(m + 1))), x] - Simp[1/(b*(m + 1))   Int[SimplifyIntegrand[(a + 
 b*x)^(m + 1)*(D[u, x]/u), x], x], x] /; FreeQ[{a, b, m}, x] && InverseFunc 
tionFreeQ[u, x] && NeQ[m, -1]
 

rule 7293
Int[u_, x_Symbol] :> With[{v = ExpandIntegrand[u, x]}, Int[v, x] /; SumQ[v] 
]
 
Maple [C] (warning: unable to verify)

Result contains higher order function than in optimal. Order 9 vs. order 4.

Time = 7.74 (sec) , antiderivative size = 4458, normalized size of antiderivative = 16.45

method result size
risch \(\text {Expression too large to display}\) \(4458\)

Input:

int((f*x+e)^2*ln(a+b*tanh(d*x+c)),x,method=_RETURNVERBOSE)
 

Output:

-1/2*f/d^2*e*polylog(3,-exp(2*d*x+2*c))-f^2*c^3/d^3*ln(1+exp(2*d*x+2*c))+1 
/2*f^2/d*polylog(2,-exp(2*d*x+2*c))*x^2-1/2*f^2/d^3*polylog(2,-exp(2*d*x+2 
*c))*c^2+2/d^2*f*a*e*c^2/(a+b)*ln((-exp(d*x+c)*a-b*exp(d*x+c)+(-(a+b)*(a-b 
))^(1/2))/(-(a+b)*(a-b))^(1/2))+2/d^2*f*a*e*c^2/(a+b)*ln((exp(d*x+c)*a+b*e 
xp(d*x+c)+(-(a+b)*(a-b))^(1/2))/(-(a+b)*(a-b))^(1/2))-1/d^2*f^2*a*c^2/(a+b 
)*ln((-exp(d*x+c)*a-b*exp(d*x+c)+(-(a+b)*(a-b))^(1/2))/(-(a+b)*(a-b))^(1/2 
))*x-1/d^2*f^2*a*c^2/(a+b)*ln((exp(d*x+c)*a+b*exp(d*x+c)+(-(a+b)*(a-b))^(1 
/2))/(-(a+b)*(a-b))^(1/2))*x-1/d^2*f^2*b*c^2/(a+b)*ln((-exp(d*x+c)*a-b*exp 
(d*x+c)+(-(a+b)*(a-b))^(1/2))/(-(a+b)*(a-b))^(1/2))*x-1/d^2*f^2*b*c^2/(a+b 
)*ln((exp(d*x+c)*a+b*exp(d*x+c)+(-(a+b)*(a-b))^(1/2))/(-(a+b)*(a-b))^(1/2) 
)*x+2/d^2*f*a*e*c/(a+b)*dilog((-exp(d*x+c)*a-b*exp(d*x+c)+(-(a+b)*(a-b))^( 
1/2))/(-(a+b)*(a-b))^(1/2))-1/3*f^2*a/(a+b)*ln(1-(a+b)*exp(2*d*x+2*c)/(-a+ 
b))*x^3-1/d*a*e^2/(a+b)*dilog((-exp(d*x+c)*a-b*exp(d*x+c)+(-(a+b)*(a-b))^( 
1/2))/(-(a+b)*(a-b))^(1/2))-1/d*a*e^2/(a+b)*dilog((exp(d*x+c)*a+b*exp(d*x+ 
c)+(-(a+b)*(a-b))^(1/2))/(-(a+b)*(a-b))^(1/2))-b*e^2/(a+b)*ln((-exp(d*x+c) 
*a-b*exp(d*x+c)+(-(a+b)*(a-b))^(1/2))/(-(a+b)*(a-b))^(1/2))*x-b*e^2/(a+b)* 
ln((exp(d*x+c)*a+b*exp(d*x+c)+(-(a+b)*(a-b))^(1/2))/(-(a+b)*(a-b))^(1/2))* 
x-a*e^2/(a+b)*ln((-exp(d*x+c)*a-b*exp(d*x+c)+(-(a+b)*(a-b))^(1/2))/(-(a+b) 
*(a-b))^(1/2))*x-a*e^2/(a+b)*ln((exp(d*x+c)*a+b*exp(d*x+c)+(-(a+b)*(a-b))^ 
(1/2))/(-(a+b)*(a-b))^(1/2))*x-1/2*f^2/d^2*polylog(3,-exp(2*d*x+2*c))*x...
 

Fricas [C] (verification not implemented)

Result contains complex when optimal does not.

Time = 0.12 (sec) , antiderivative size = 1091, normalized size of antiderivative = 4.03 \[ \int (e+f x)^2 \log (a+b \tanh (c+d x)) \, dx=\text {Too large to display} \] Input:

integrate((f*x+e)^2*log(a+b*tanh(d*x+c)),x, algorithm="fricas")
 

Output:

-1/3*(6*f^2*polylog(4, sqrt(-(a + b)/(a - b))*(cosh(d*x + c) + sinh(d*x + 
c))) + 6*f^2*polylog(4, -sqrt(-(a + b)/(a - b))*(cosh(d*x + c) + sinh(d*x 
+ c))) - 6*f^2*polylog(4, I*cosh(d*x + c) + I*sinh(d*x + c)) - 6*f^2*polyl 
og(4, -I*cosh(d*x + c) - I*sinh(d*x + c)) + 3*(d^2*f^2*x^2 + 2*d^2*e*f*x + 
 d^2*e^2)*dilog(sqrt(-(a + b)/(a - b))*(cosh(d*x + c) + sinh(d*x + c))) + 
3*(d^2*f^2*x^2 + 2*d^2*e*f*x + d^2*e^2)*dilog(-sqrt(-(a + b)/(a - b))*(cos 
h(d*x + c) + sinh(d*x + c))) - 3*(d^2*f^2*x^2 + 2*d^2*e*f*x + d^2*e^2)*dil 
og(I*cosh(d*x + c) + I*sinh(d*x + c)) - 3*(d^2*f^2*x^2 + 2*d^2*e*f*x + d^2 
*e^2)*dilog(-I*cosh(d*x + c) - I*sinh(d*x + c)) - (3*c*d^2*e^2 - 3*c^2*d*e 
*f + c^3*f^2)*log(2*(a + b)*cosh(d*x + c) + 2*(a + b)*sinh(d*x + c) + 2*(a 
 - b)*sqrt(-(a + b)/(a - b))) - (3*c*d^2*e^2 - 3*c^2*d*e*f + c^3*f^2)*log( 
2*(a + b)*cosh(d*x + c) + 2*(a + b)*sinh(d*x + c) - 2*(a - b)*sqrt(-(a + b 
)/(a - b))) + (d^3*f^2*x^3 + 3*d^3*e*f*x^2 + 3*d^3*e^2*x + 3*c*d^2*e^2 - 3 
*c^2*d*e*f + c^3*f^2)*log(sqrt(-(a + b)/(a - b))*(cosh(d*x + c) + sinh(d*x 
 + c)) + 1) + (d^3*f^2*x^3 + 3*d^3*e*f*x^2 + 3*d^3*e^2*x + 3*c*d^2*e^2 - 3 
*c^2*d*e*f + c^3*f^2)*log(-sqrt(-(a + b)/(a - b))*(cosh(d*x + c) + sinh(d* 
x + c)) + 1) - (d^3*f^2*x^3 + 3*d^3*e*f*x^2 + 3*d^3*e^2*x)*log((a*cosh(d*x 
 + c) + b*sinh(d*x + c))/cosh(d*x + c)) + (3*c*d^2*e^2 - 3*c^2*d*e*f + c^3 
*f^2)*log(cosh(d*x + c) + sinh(d*x + c) + I) + (3*c*d^2*e^2 - 3*c^2*d*e*f 
+ c^3*f^2)*log(cosh(d*x + c) + sinh(d*x + c) - I) - (d^3*f^2*x^3 + 3*d^...
 

Sympy [F]

\[ \int (e+f x)^2 \log (a+b \tanh (c+d x)) \, dx=\int \left (e + f x\right )^{2} \log {\left (a + b \tanh {\left (c + d x \right )} \right )}\, dx \] Input:

integrate((f*x+e)**2*ln(a+b*tanh(d*x+c)),x)
 

Output:

Integral((e + f*x)**2*log(a + b*tanh(c + d*x)), x)
 

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 559 vs. \(2 (251) = 502\).

Time = 0.21 (sec) , antiderivative size = 559, normalized size of antiderivative = 2.06 \[ \int (e+f x)^2 \log (a+b \tanh (c+d x)) \, dx =\text {Too large to display} \] Input:

integrate((f*x+e)^2*log(a+b*tanh(d*x+c)),x, algorithm="maxima")
 

Output:

-1/18*b*d*(9*(2*d*x*log((a*e^(2*c) + b*e^(2*c))*e^(2*d*x)/(a - b) + 1) + d 
ilog(-(a*e^(2*c) + b*e^(2*c))*e^(2*d*x)/(a - b)))*e^2/(b*d^2) - 9*(2*d*x*l 
og(e^(2*d*x + 2*c) + 1) + dilog(-e^(2*d*x + 2*c)))*e^2/(b*d^2) + 9*(2*d^2* 
x^2*log((a*e^(2*c) + b*e^(2*c))*e^(2*d*x)/(a - b) + 1) + 2*d*x*dilog(-(a*e 
^(2*c) + b*e^(2*c))*e^(2*d*x)/(a - b)) - polylog(3, -(a*e^(2*c) + b*e^(2*c 
))*e^(2*d*x)/(a - b)))*e*f/(b*d^3) - 9*(2*d^2*x^2*log(e^(2*d*x + 2*c) + 1) 
 + 2*d*x*dilog(-e^(2*d*x + 2*c)) - polylog(3, -e^(2*d*x + 2*c)))*e*f/(b*d^ 
3) + 2*(4*d^3*x^3*log((a*e^(2*c) + b*e^(2*c))*e^(2*d*x)/(a - b) + 1) + 6*d 
^2*x^2*dilog(-(a*e^(2*c) + b*e^(2*c))*e^(2*d*x)/(a - b)) - 6*d*x*polylog(3 
, -(a*e^(2*c) + b*e^(2*c))*e^(2*d*x)/(a - b)) + 3*polylog(4, -(a*e^(2*c) + 
 b*e^(2*c))*e^(2*d*x)/(a - b)))*f^2/(b*d^4) - 2*(4*d^3*x^3*log(e^(2*d*x + 
2*c) + 1) + 6*d^2*x^2*dilog(-e^(2*d*x + 2*c)) - 6*d*x*polylog(3, -e^(2*d*x 
 + 2*c)) + 3*polylog(4, -e^(2*d*x + 2*c)))*f^2/(b*d^4)) + 1/3*(f^2*x^3 + 3 
*e*f*x^2 + 3*e^2*x)*log(b*tanh(d*x + c) + a)
 

Giac [F]

\[ \int (e+f x)^2 \log (a+b \tanh (c+d x)) \, dx=\int { {\left (f x + e\right )}^{2} \log \left (b \tanh \left (d x + c\right ) + a\right ) \,d x } \] Input:

integrate((f*x+e)^2*log(a+b*tanh(d*x+c)),x, algorithm="giac")
 

Output:

integrate((f*x + e)^2*log(b*tanh(d*x + c) + a), x)
 

Mupad [F(-1)]

Timed out. \[ \int (e+f x)^2 \log (a+b \tanh (c+d x)) \, dx=\int \ln \left (a+b\,\mathrm {tanh}\left (c+d\,x\right )\right )\,{\left (e+f\,x\right )}^2 \,d x \] Input:

int(log(a + b*tanh(c + d*x))*(e + f*x)^2,x)
 

Output:

int(log(a + b*tanh(c + d*x))*(e + f*x)^2, x)
 

Reduce [F]

\[ \int (e+f x)^2 \log (a+b \tanh (c+d x)) \, dx=\left (\int \mathrm {log}\left (\tanh \left (d x +c \right ) b +a \right )d x \right ) e^{2}+\left (\int \mathrm {log}\left (\tanh \left (d x +c \right ) b +a \right ) x^{2}d x \right ) f^{2}+2 \left (\int \mathrm {log}\left (\tanh \left (d x +c \right ) b +a \right ) x d x \right ) e f \] Input:

int((f*x+e)^2*log(a+b*tanh(d*x+c)),x)
 

Output:

int(log(tanh(c + d*x)*b + a),x)*e**2 + int(log(tanh(c + d*x)*b + a)*x**2,x 
)*f**2 + 2*int(log(tanh(c + d*x)*b + a)*x,x)*e*f