\(\int \frac {(c+d x)^2}{(a+a \cosh (e+f x))^2} \, dx\) [117]

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

Optimal result

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

1/3*(d*x+c)^2/a^2/f-4/3*d*(d*x+c)*ln(1+exp(f*x+e))/a^2/f^2-4/3*d^2*polylog 
(2,-exp(f*x+e))/a^2/f^3+1/3*d*(d*x+c)*sech(1/2*f*x+1/2*e)^2/a^2/f^2-2/3*d^ 
2*tanh(1/2*f*x+1/2*e)/a^2/f^3+1/3*(d*x+c)^2*tanh(1/2*f*x+1/2*e)/a^2/f+1/6* 
(d*x+c)^2*sech(1/2*f*x+1/2*e)^2*tanh(1/2*f*x+1/2*e)/a^2/f
 

Mathematica [A] (verified)

Time = 0.98 (sec) , antiderivative size = 295, normalized size of antiderivative = 1.48 \[ \int \frac {(c+d x)^2}{(a+a \cosh (e+f x))^2} \, dx=\frac {\cosh \left (\frac {1}{2} (e+f x)\right ) \left (-\frac {8 \cosh ^3\left (\frac {1}{2} (e+f x)\right ) \left (f (c+d x) \left (f (c+d x)+2 d \left (1+e^e\right ) \log \left (1+e^{-e-f x}\right )\right )-2 d^2 \left (1+e^e\right ) \operatorname {PolyLog}\left (2,-e^{-e-f x}\right )\right )}{1+e^e}+\text {sech}\left (\frac {e}{2}\right ) \left (2 d f (c+d x) \cosh \left (\frac {f x}{2}\right )+2 d f (c+d x) \cosh \left (e+\frac {f x}{2}\right )-4 d^2 \sinh \left (\frac {f x}{2}\right )+3 c^2 f^2 \sinh \left (\frac {f x}{2}\right )+6 c d f^2 x \sinh \left (\frac {f x}{2}\right )+3 d^2 f^2 x^2 \sinh \left (\frac {f x}{2}\right )+2 d^2 \sinh \left (e+\frac {f x}{2}\right )-2 d^2 \sinh \left (e+\frac {3 f x}{2}\right )+c^2 f^2 \sinh \left (e+\frac {3 f x}{2}\right )+2 c d f^2 x \sinh \left (e+\frac {3 f x}{2}\right )+d^2 f^2 x^2 \sinh \left (e+\frac {3 f x}{2}\right )\right )\right )}{3 a^2 f^3 (1+\cosh (e+f x))^2} \] Input:

Integrate[(c + d*x)^2/(a + a*Cosh[e + f*x])^2,x]
 

Output:

(Cosh[(e + f*x)/2]*((-8*Cosh[(e + f*x)/2]^3*(f*(c + d*x)*(f*(c + d*x) + 2* 
d*(1 + E^e)*Log[1 + E^(-e - f*x)]) - 2*d^2*(1 + E^e)*PolyLog[2, -E^(-e - f 
*x)]))/(1 + E^e) + Sech[e/2]*(2*d*f*(c + d*x)*Cosh[(f*x)/2] + 2*d*f*(c + d 
*x)*Cosh[e + (f*x)/2] - 4*d^2*Sinh[(f*x)/2] + 3*c^2*f^2*Sinh[(f*x)/2] + 6* 
c*d*f^2*x*Sinh[(f*x)/2] + 3*d^2*f^2*x^2*Sinh[(f*x)/2] + 2*d^2*Sinh[e + (f* 
x)/2] - 2*d^2*Sinh[e + (3*f*x)/2] + c^2*f^2*Sinh[e + (3*f*x)/2] + 2*c*d*f^ 
2*x*Sinh[e + (3*f*x)/2] + d^2*f^2*x^2*Sinh[e + (3*f*x)/2])))/(3*a^2*f^3*(1 
 + Cosh[e + f*x])^2)
 

Rubi [C] (verified)

Result contains complex when optimal does not.

Time = 1.04 (sec) , antiderivative size = 196, normalized size of antiderivative = 0.98, number of steps used = 16, number of rules used = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.750, Rules used = {3042, 3799, 3042, 4674, 3042, 4254, 24, 4672, 26, 3042, 26, 4201, 2620, 2715, 2838}

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 \frac {(c+d x)^2}{(a \cosh (e+f x)+a)^2} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {(c+d x)^2}{\left (a+a \sin \left (i e+i f x+\frac {\pi }{2}\right )\right )^2}dx\)

\(\Big \downarrow \) 3799

\(\displaystyle \frac {\int (c+d x)^2 \text {sech}^4\left (\frac {e}{2}+\frac {f x}{2}\right )dx}{4 a^2}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {\int (c+d x)^2 \csc \left (\frac {i e}{2}+\frac {i f x}{2}+\frac {\pi }{2}\right )^4dx}{4 a^2}\)

\(\Big \downarrow \) 4674

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4254

\(\displaystyle \frac {\frac {2}{3} \int (c+d x)^2 \csc \left (\frac {i e}{2}+\frac {i f x}{2}+\frac {\pi }{2}\right )^2dx-\frac {8 i d^2 \int 1d\left (-i \tanh \left (\frac {e}{2}+\frac {f x}{2}\right )\right )}{3 f^3}+\frac {4 d (c+d x) \text {sech}^2\left (\frac {e}{2}+\frac {f x}{2}\right )}{3 f^2}+\frac {2 (c+d x)^2 \tanh \left (\frac {e}{2}+\frac {f x}{2}\right ) \text {sech}^2\left (\frac {e}{2}+\frac {f x}{2}\right )}{3 f}}{4 a^2}\)

\(\Big \downarrow \) 24

\(\displaystyle \frac {\frac {2}{3} \int (c+d x)^2 \csc \left (\frac {i e}{2}+\frac {i f x}{2}+\frac {\pi }{2}\right )^2dx+\frac {4 d (c+d x) \text {sech}^2\left (\frac {e}{2}+\frac {f x}{2}\right )}{3 f^2}+\frac {2 (c+d x)^2 \tanh \left (\frac {e}{2}+\frac {f x}{2}\right ) \text {sech}^2\left (\frac {e}{2}+\frac {f x}{2}\right )}{3 f}-\frac {8 d^2 \tanh \left (\frac {e}{2}+\frac {f x}{2}\right )}{3 f^3}}{4 a^2}\)

\(\Big \downarrow \) 4672

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

\(\Big \downarrow \) 26

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 26

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

\(\Big \downarrow \) 4201

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

\(\Big \downarrow \) 2620

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

\(\Big \downarrow \) 2715

\(\displaystyle \frac {\frac {2}{3} \left (\frac {2 (c+d x)^2 \tanh \left (\frac {e}{2}+\frac {f x}{2}\right )}{f}+\frac {4 i d \left (2 i \left (\frac {(c+d x) \log \left (e^{e+f x}+1\right )}{f}-\frac {d \int e^{-e-f x} \log \left (1+e^{e+f x}\right )de^{e+f x}}{f^2}\right )-\frac {i (c+d x)^2}{2 d}\right )}{f}\right )+\frac {4 d (c+d x) \text {sech}^2\left (\frac {e}{2}+\frac {f x}{2}\right )}{3 f^2}+\frac {2 (c+d x)^2 \tanh \left (\frac {e}{2}+\frac {f x}{2}\right ) \text {sech}^2\left (\frac {e}{2}+\frac {f x}{2}\right )}{3 f}-\frac {8 d^2 \tanh \left (\frac {e}{2}+\frac {f x}{2}\right )}{3 f^3}}{4 a^2}\)

\(\Big \downarrow \) 2838

\(\displaystyle \frac {\frac {2}{3} \left (\frac {2 (c+d x)^2 \tanh \left (\frac {e}{2}+\frac {f x}{2}\right )}{f}+\frac {4 i d \left (2 i \left (\frac {(c+d x) \log \left (e^{e+f x}+1\right )}{f}+\frac {d \operatorname {PolyLog}\left (2,-e^{e+f x}\right )}{f^2}\right )-\frac {i (c+d x)^2}{2 d}\right )}{f}\right )+\frac {4 d (c+d x) \text {sech}^2\left (\frac {e}{2}+\frac {f x}{2}\right )}{3 f^2}+\frac {2 (c+d x)^2 \tanh \left (\frac {e}{2}+\frac {f x}{2}\right ) \text {sech}^2\left (\frac {e}{2}+\frac {f x}{2}\right )}{3 f}-\frac {8 d^2 \tanh \left (\frac {e}{2}+\frac {f x}{2}\right )}{3 f^3}}{4 a^2}\)

Input:

Int[(c + d*x)^2/(a + a*Cosh[e + f*x])^2,x]
 

Output:

((4*d*(c + d*x)*Sech[e/2 + (f*x)/2]^2)/(3*f^2) - (8*d^2*Tanh[e/2 + (f*x)/2 
])/(3*f^3) + (2*(c + d*x)^2*Sech[e/2 + (f*x)/2]^2*Tanh[e/2 + (f*x)/2])/(3* 
f) + (2*(((4*I)*d*(((-1/2*I)*(c + d*x)^2)/d + (2*I)*(((c + d*x)*Log[1 + E^ 
(e + f*x)])/f + (d*PolyLog[2, -E^(e + f*x)])/f^2)))/f + (2*(c + d*x)^2*Tan 
h[e/2 + (f*x)/2])/f))/3)/(4*a^2)
 

Defintions of rubi rules used

rule 24
Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]
 

rule 26
Int[(Complex[0, a_])*(Fx_), x_Symbol] :> Simp[(Complex[Identity[0], a])   I 
nt[Fx, x], x] /; FreeQ[a, x] && EqQ[a^2, 1]
 

rule 2620
Int[(((F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)*((c_.) + (d_.)*(x_))^(m_.))/ 
((a_) + (b_.)*((F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)), x_Symbol] :> Simp 
[((c + d*x)^m/(b*f*g*n*Log[F]))*Log[1 + b*((F^(g*(e + f*x)))^n/a)], x] - Si 
mp[d*(m/(b*f*g*n*Log[F]))   Int[(c + d*x)^(m - 1)*Log[1 + b*((F^(g*(e + f*x 
)))^n/a)], x], x] /; FreeQ[{F, a, b, c, d, e, f, g, n}, x] && IGtQ[m, 0]
 

rule 2715
Int[Log[(a_) + (b_.)*((F_)^((e_.)*((c_.) + (d_.)*(x_))))^(n_.)], x_Symbol] 
:> Simp[1/(d*e*n*Log[F])   Subst[Int[Log[a + b*x]/x, x], x, (F^(e*(c + d*x) 
))^n], x] /; FreeQ[{F, a, b, c, d, e, n}, x] && GtQ[a, 0]
 

rule 2838
Int[Log[(c_.)*((d_) + (e_.)*(x_)^(n_.))]/(x_), x_Symbol] :> Simp[-PolyLog[2 
, (-c)*e*x^n]/n, x] /; FreeQ[{c, d, e, n}, x] && EqQ[c*d, 1]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 3799
Int[((c_.) + (d_.)*(x_))^(m_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(n_.) 
, x_Symbol] :> Simp[(2*a)^n   Int[(c + d*x)^m*Sin[(1/2)*(e + Pi*(a/(2*b))) 
+ f*(x/2)]^(2*n), x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && EqQ[a^2 - b^ 
2, 0] && IntegerQ[n] && (GtQ[n, 0] || IGtQ[m, 0])
 

rule 4201
Int[((c_.) + (d_.)*(x_))^(m_.)*tan[(e_.) + (Complex[0, fz_])*(f_.)*(x_)], x 
_Symbol] :> Simp[(-I)*((c + d*x)^(m + 1)/(d*(m + 1))), x] + Simp[2*I   Int[ 
(c + d*x)^m*(E^(2*((-I)*e + f*fz*x))/(1 + E^(2*((-I)*e + f*fz*x)))), x], x] 
 /; FreeQ[{c, d, e, f, fz}, x] && IGtQ[m, 0]
 

rule 4254
Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> Simp[-d^(-1)   Subst[Int[Exp 
andIntegrand[(1 + x^2)^(n/2 - 1), x], x], x, Cot[c + d*x]], x] /; FreeQ[{c, 
 d}, x] && IGtQ[n/2, 0]
 

rule 4672
Int[csc[(e_.) + (f_.)*(x_)]^2*((c_.) + (d_.)*(x_))^(m_.), x_Symbol] :> Simp 
[(-(c + d*x)^m)*(Cot[e + f*x]/f), x] + Simp[d*(m/f)   Int[(c + d*x)^(m - 1) 
*Cot[e + f*x], x], x] /; FreeQ[{c, d, e, f}, x] && GtQ[m, 0]
 

rule 4674
Int[(csc[(e_.) + (f_.)*(x_)]*(b_.))^(n_)*((c_.) + (d_.)*(x_))^(m_), x_Symbo 
l] :> Simp[(-b^2)*(c + d*x)^m*Cot[e + f*x]*((b*Csc[e + f*x])^(n - 2)/(f*(n 
- 1))), x] + (-Simp[b^2*d*m*(c + d*x)^(m - 1)*((b*Csc[e + f*x])^(n - 2)/(f^ 
2*(n - 1)*(n - 2))), x] + Simp[b^2*d^2*m*((m - 1)/(f^2*(n - 1)*(n - 2))) 
Int[(c + d*x)^(m - 2)*(b*Csc[e + f*x])^(n - 2), x], x] + Simp[b^2*((n - 2)/ 
(n - 1))   Int[(c + d*x)^m*(b*Csc[e + f*x])^(n - 2), x], x]) /; FreeQ[{b, c 
, d, e, f}, x] && GtQ[n, 1] && NeQ[n, 2] && GtQ[m, 1]
 
Maple [A] (verified)

Time = 0.69 (sec) , antiderivative size = 313, normalized size of antiderivative = 1.56

method result size
risch \(-\frac {2 \left (3 d^{2} f^{2} x^{2} {\mathrm e}^{f x +e}+6 c d \,f^{2} x \,{\mathrm e}^{f x +e}+d^{2} x^{2} f^{2}-2 d^{2} f x \,{\mathrm e}^{2 f x +2 e}+3 c^{2} f^{2} {\mathrm e}^{f x +e}+2 c d \,f^{2} x -2 c d f \,{\mathrm e}^{2 f x +2 e}-2 d^{2} f x \,{\mathrm e}^{f x +e}+c^{2} f^{2}-2 c d f \,{\mathrm e}^{f x +e}-2 \,{\mathrm e}^{2 f x +2 e} d^{2}-4 \,{\mathrm e}^{f x +e} d^{2}-2 d^{2}\right )}{3 f^{3} a^{2} \left ({\mathrm e}^{f x +e}+1\right )^{3}}+\frac {4 d c \ln \left ({\mathrm e}^{f x +e}\right )}{3 a^{2} f^{2}}-\frac {4 d c \ln \left ({\mathrm e}^{f x +e}+1\right )}{3 a^{2} f^{2}}+\frac {2 d^{2} x^{2}}{3 a^{2} f}+\frac {4 d^{2} e x}{3 a^{2} f^{2}}+\frac {2 d^{2} e^{2}}{3 a^{2} f^{3}}-\frac {4 d^{2} \ln \left ({\mathrm e}^{f x +e}+1\right ) x}{3 a^{2} f^{2}}-\frac {4 d^{2} \operatorname {polylog}\left (2, -{\mathrm e}^{f x +e}\right )}{3 a^{2} f^{3}}-\frac {4 d^{2} e \ln \left ({\mathrm e}^{f x +e}\right )}{3 a^{2} f^{3}}\) \(313\)

Input:

int((d*x+c)^2/(a+a*cosh(f*x+e))^2,x,method=_RETURNVERBOSE)
 

Output:

-2/3*(3*d^2*f^2*x^2*exp(f*x+e)+6*c*d*f^2*x*exp(f*x+e)+d^2*x^2*f^2-2*d^2*f* 
x*exp(2*f*x+2*e)+3*c^2*f^2*exp(f*x+e)+2*c*d*f^2*x-2*c*d*f*exp(2*f*x+2*e)-2 
*d^2*f*x*exp(f*x+e)+c^2*f^2-2*c*d*f*exp(f*x+e)-2*exp(2*f*x+2*e)*d^2-4*exp( 
f*x+e)*d^2-2*d^2)/f^3/a^2/(exp(f*x+e)+1)^3+4/3/a^2*d/f^2*c*ln(exp(f*x+e))- 
4/3/a^2*d/f^2*c*ln(exp(f*x+e)+1)+2/3/a^2*d^2/f*x^2+4/3/a^2*d^2/f^2*e*x+2/3 
/a^2*d^2/f^3*e^2-4/3/a^2*d^2/f^2*ln(exp(f*x+e)+1)*x-4/3*d^2*polylog(2,-exp 
(f*x+e))/a^2/f^3-4/3/a^2*d^2/f^3*e*ln(exp(f*x+e))
 

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 963 vs. \(2 (163) = 326\).

Time = 0.10 (sec) , antiderivative size = 963, normalized size of antiderivative = 4.82 \[ \int \frac {(c+d x)^2}{(a+a \cosh (e+f x))^2} \, dx=\text {Too large to display} \] Input:

integrate((d*x+c)^2/(a+a*cosh(f*x+e))^2,x, algorithm="fricas")
 

Output:

-2/3*(d^2*e^2 - 2*c*d*e*f + c^2*f^2 - (d^2*f^2*x^2 + 2*c*d*f^2*x - d^2*e^2 
 + 2*c*d*e*f)*cosh(f*x + e)^3 - (d^2*f^2*x^2 + 2*c*d*f^2*x - d^2*e^2 + 2*c 
*d*e*f)*sinh(f*x + e)^3 - (3*d^2*f^2*x^2 - 3*d^2*e^2 + 2*d^2 + 2*(3*c*d*e 
+ c*d)*f + 2*(3*c*d*f^2 + d^2*f)*x)*cosh(f*x + e)^2 - (3*d^2*f^2*x^2 - 3*d 
^2*e^2 + 2*d^2 + 2*(3*c*d*e + c*d)*f + 2*(3*c*d*f^2 + d^2*f)*x + 3*(d^2*f^ 
2*x^2 + 2*c*d*f^2*x - d^2*e^2 + 2*c*d*e*f)*cosh(f*x + e))*sinh(f*x + e)^2 
- 2*d^2 + (3*d^2*e^2 + 3*c^2*f^2 - 2*d^2*f*x - 4*d^2 - 2*(3*c*d*e + c*d)*f 
)*cosh(f*x + e) + 2*(d^2*cosh(f*x + e)^3 + d^2*sinh(f*x + e)^3 + 3*d^2*cos 
h(f*x + e)^2 + 3*d^2*cosh(f*x + e) + 3*(d^2*cosh(f*x + e) + d^2)*sinh(f*x 
+ e)^2 + d^2 + 3*(d^2*cosh(f*x + e)^2 + 2*d^2*cosh(f*x + e) + d^2)*sinh(f* 
x + e))*dilog(-cosh(f*x + e) - sinh(f*x + e)) + 2*(d^2*f*x + (d^2*f*x + c* 
d*f)*cosh(f*x + e)^3 + (d^2*f*x + c*d*f)*sinh(f*x + e)^3 + c*d*f + 3*(d^2* 
f*x + c*d*f)*cosh(f*x + e)^2 + 3*(d^2*f*x + c*d*f + (d^2*f*x + c*d*f)*cosh 
(f*x + e))*sinh(f*x + e)^2 + 3*(d^2*f*x + c*d*f)*cosh(f*x + e) + 3*(d^2*f* 
x + c*d*f + (d^2*f*x + c*d*f)*cosh(f*x + e)^2 + 2*(d^2*f*x + c*d*f)*cosh(f 
*x + e))*sinh(f*x + e))*log(cosh(f*x + e) + sinh(f*x + e) + 1) + (3*d^2*e^ 
2 + 3*c^2*f^2 - 2*d^2*f*x - 3*(d^2*f^2*x^2 + 2*c*d*f^2*x - d^2*e^2 + 2*c*d 
*e*f)*cosh(f*x + e)^2 - 4*d^2 - 2*(3*c*d*e + c*d)*f - 2*(3*d^2*f^2*x^2 - 3 
*d^2*e^2 + 2*d^2 + 2*(3*c*d*e + c*d)*f + 2*(3*c*d*f^2 + d^2*f)*x)*cosh(f*x 
 + e))*sinh(f*x + e))/(a^2*f^3*cosh(f*x + e)^3 + a^2*f^3*sinh(f*x + e)^...
 

Sympy [F]

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

integrate((d*x+c)**2/(a+a*cosh(f*x+e))**2,x)
                                                                                    
                                                                                    
 

Output:

(Integral(c**2/(cosh(e + f*x)**2 + 2*cosh(e + f*x) + 1), x) + Integral(d** 
2*x**2/(cosh(e + f*x)**2 + 2*cosh(e + f*x) + 1), x) + Integral(2*c*d*x/(co 
sh(e + f*x)**2 + 2*cosh(e + f*x) + 1), x))/a**2
 

Maxima [F]

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

integrate((d*x+c)^2/(a+a*cosh(f*x+e))^2,x, algorithm="maxima")
 

Output:

-2/3*d^2*((f^2*x^2 - 2*(f*x*e^(2*e) + e^(2*e))*e^(2*f*x) + (3*f^2*x^2*e^e 
- 2*f*x*e^e - 4*e^e)*e^(f*x) - 2)/(a^2*f^3*e^(3*f*x + 3*e) + 3*a^2*f^3*e^( 
2*f*x + 2*e) + 3*a^2*f^3*e^(f*x + e) + a^2*f^3) - 6*integrate(1/3*x/(a^2*f 
*e^(f*x + e) + a^2*f), x)) + 4/3*c*d*((f*x*e^(3*f*x + 3*e) + (3*f*x*e^(2*e 
) + e^(2*e))*e^(2*f*x) + e^(f*x + e))/(a^2*f^2*e^(3*f*x + 3*e) + 3*a^2*f^2 
*e^(2*f*x + 2*e) + 3*a^2*f^2*e^(f*x + e) + a^2*f^2) - log((e^(f*x + e) + 1 
)*e^(-e))/(a^2*f^2)) + 2/3*c^2*(3*e^(-f*x - e)/((3*a^2*e^(-f*x - e) + 3*a^ 
2*e^(-2*f*x - 2*e) + a^2*e^(-3*f*x - 3*e) + a^2)*f) + 1/((3*a^2*e^(-f*x - 
e) + 3*a^2*e^(-2*f*x - 2*e) + a^2*e^(-3*f*x - 3*e) + a^2)*f))
 

Giac [F]

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

integrate((d*x+c)^2/(a+a*cosh(f*x+e))^2,x, algorithm="giac")
 

Output:

integrate((d*x + c)^2/(a*cosh(f*x + e) + a)^2, x)
 

Mupad [F(-1)]

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

int((c + d*x)^2/(a + a*cosh(e + f*x))^2,x)
 

Output:

int((c + d*x)^2/(a + a*cosh(e + f*x))^2, x)
 

Reduce [F]

\[ \int \frac {(c+d x)^2}{(a+a \cosh (e+f x))^2} \, dx=\frac {-4 e^{f x +e} \mathrm {log}\left (e^{f x +e}+1\right ) c d f +\frac {4 \left (\int \frac {x}{e^{4 f x +4 e}+4 e^{3 f x +3 e}+6 e^{2 f x +2 e}+4 e^{f x +e}+1}d x \right ) d^{2} f^{2}}{3}-\frac {22 e^{f x +e} \mathrm {log}\left (e^{f x +e}+1\right ) d^{2}}{3}+\frac {22 e^{2 f x +2 e} d^{2} f x}{3}+\frac {4 e^{3 f x +3 e} \left (\int \frac {x}{e^{4 f x +4 e}+4 e^{3 f x +3 e}+6 e^{2 f x +2 e}+4 e^{f x +e}+1}d x \right ) d^{2} f^{2}}{3}+4 e^{2 f x +2 e} \left (\int \frac {x}{e^{4 f x +4 e}+4 e^{3 f x +3 e}+6 e^{2 f x +2 e}+4 e^{f x +e}+1}d x \right ) d^{2} f^{2}+4 e^{f x +e} \left (\int \frac {x}{e^{4 f x +4 e}+4 e^{3 f x +3 e}+6 e^{2 f x +2 e}+4 e^{f x +e}+1}d x \right ) d^{2} f^{2}-\frac {4 \,\mathrm {log}\left (e^{f x +e}+1\right ) c d f}{3}-\frac {22 \,\mathrm {log}\left (e^{f x +e}+1\right ) d^{2}}{9}-\frac {22 e^{3 f x +3 e} d^{2}}{27}+\frac {8 e^{f x +e} d^{2}}{3}-\frac {2 c^{2} f^{2}}{3}+\frac {50 d^{2}}{27}+\frac {4 e^{3 f x +3 e} c d \,f^{2} x}{3}-\frac {4 e^{3 f x +3 e} c d f}{9}+\frac {22 e^{3 f x +3 e} d^{2} f x}{9}-2 e^{f x +e} d^{2} f^{2} x^{2}+\frac {16 e^{f x +e} d^{2} f x}{3}-\frac {22 e^{3 f x +3 e} \mathrm {log}\left (e^{f x +e}+1\right ) d^{2}}{9}-\frac {22 e^{2 f x +2 e} \mathrm {log}\left (e^{f x +e}+1\right ) d^{2}}{3}-\frac {4 e^{3 f x +3 e} \mathrm {log}\left (e^{f x +e}+1\right ) c d f}{3}-4 e^{2 f x +2 e} \mathrm {log}\left (e^{f x +e}+1\right ) c d f +4 e^{2 f x +2 e} c d \,f^{2} x -2 e^{f x +e} c^{2} f^{2}-\frac {4 c d f}{9}-\frac {2 d^{2} f^{2} x^{2}}{3}}{a^{2} f^{3} \left (e^{3 f x +3 e}+3 e^{2 f x +2 e}+3 e^{f x +e}+1\right )} \] Input:

int((d*x+c)^2/(a+a*cosh(f*x+e))^2,x)
 

Output:

(2*(18*e**(3*e + 3*f*x)*int(x/(e**(4*e + 4*f*x) + 4*e**(3*e + 3*f*x) + 6*e 
**(2*e + 2*f*x) + 4*e**(e + f*x) + 1),x)*d**2*f**2 - 18*e**(3*e + 3*f*x)*l 
og(e**(e + f*x) + 1)*c*d*f - 33*e**(3*e + 3*f*x)*log(e**(e + f*x) + 1)*d** 
2 + 18*e**(3*e + 3*f*x)*c*d*f**2*x - 6*e**(3*e + 3*f*x)*c*d*f + 33*e**(3*e 
 + 3*f*x)*d**2*f*x - 11*e**(3*e + 3*f*x)*d**2 + 54*e**(2*e + 2*f*x)*int(x/ 
(e**(4*e + 4*f*x) + 4*e**(3*e + 3*f*x) + 6*e**(2*e + 2*f*x) + 4*e**(e + f* 
x) + 1),x)*d**2*f**2 - 54*e**(2*e + 2*f*x)*log(e**(e + f*x) + 1)*c*d*f - 9 
9*e**(2*e + 2*f*x)*log(e**(e + f*x) + 1)*d**2 + 54*e**(2*e + 2*f*x)*c*d*f* 
*2*x + 99*e**(2*e + 2*f*x)*d**2*f*x + 54*e**(e + f*x)*int(x/(e**(4*e + 4*f 
*x) + 4*e**(3*e + 3*f*x) + 6*e**(2*e + 2*f*x) + 4*e**(e + f*x) + 1),x)*d** 
2*f**2 - 54*e**(e + f*x)*log(e**(e + f*x) + 1)*c*d*f - 99*e**(e + f*x)*log 
(e**(e + f*x) + 1)*d**2 - 27*e**(e + f*x)*c**2*f**2 - 27*e**(e + f*x)*d**2 
*f**2*x**2 + 72*e**(e + f*x)*d**2*f*x + 36*e**(e + f*x)*d**2 + 18*int(x/(e 
**(4*e + 4*f*x) + 4*e**(3*e + 3*f*x) + 6*e**(2*e + 2*f*x) + 4*e**(e + f*x) 
 + 1),x)*d**2*f**2 - 18*log(e**(e + f*x) + 1)*c*d*f - 33*log(e**(e + f*x) 
+ 1)*d**2 - 9*c**2*f**2 - 6*c*d*f - 9*d**2*f**2*x**2 + 25*d**2))/(27*a**2* 
f**3*(e**(3*e + 3*f*x) + 3*e**(2*e + 2*f*x) + 3*e**(e + f*x) + 1))