3.622 $$\int \frac{1}{(a \text{sech}(x)+b \tanh (x))^4} \, dx$$

Optimal. Leaf size=146 $\frac{a \left (2 a^2+3 b^2\right ) \tanh ^{-1}\left (\frac{b-a \tanh \left (\frac{x}{2}\right )}{\sqrt{a^2+b^2}}\right )}{b^4 \left (a^2+b^2\right )^{3/2}}+\frac{a \cosh ^3(x)}{2 b \left (a^2+b^2\right ) (a+b \sinh (x))^2}-\frac{\cosh (x) \left (2 \left (a^2+b^2\right )+a b \sinh (x)\right )}{2 b^3 \left (a^2+b^2\right ) (a+b \sinh (x))}-\frac{\cosh ^3(x)}{3 b (a+b \sinh (x))^3}+\frac{x}{b^4}$

[Out]

x/b^4 + (a*(2*a^2 + 3*b^2)*ArcTanh[(b - a*Tanh[x/2])/Sqrt[a^2 + b^2]])/(b^4*(a^2 + b^2)^(3/2)) - Cosh[x]^3/(3*
b*(a + b*Sinh[x])^3) + (a*Cosh[x]^3)/(2*b*(a^2 + b^2)*(a + b*Sinh[x])^2) - (Cosh[x]*(2*(a^2 + b^2) + a*b*Sinh[
x]))/(2*b^3*(a^2 + b^2)*(a + b*Sinh[x]))

________________________________________________________________________________________

Rubi [A]  time = 0.365036, antiderivative size = 146, normalized size of antiderivative = 1., number of steps used = 8, number of rules used = 8, integrand size = 11, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.727, Rules used = {4391, 2693, 2864, 2863, 2735, 2660, 618, 206} $\frac{a \left (2 a^2+3 b^2\right ) \tanh ^{-1}\left (\frac{b-a \tanh \left (\frac{x}{2}\right )}{\sqrt{a^2+b^2}}\right )}{b^4 \left (a^2+b^2\right )^{3/2}}+\frac{a \cosh ^3(x)}{2 b \left (a^2+b^2\right ) (a+b \sinh (x))^2}-\frac{\cosh (x) \left (2 \left (a^2+b^2\right )+a b \sinh (x)\right )}{2 b^3 \left (a^2+b^2\right ) (a+b \sinh (x))}-\frac{\cosh ^3(x)}{3 b (a+b \sinh (x))^3}+\frac{x}{b^4}$

Antiderivative was successfully veriﬁed.

[In]

Int[(a*Sech[x] + b*Tanh[x])^(-4),x]

[Out]

x/b^4 + (a*(2*a^2 + 3*b^2)*ArcTanh[(b - a*Tanh[x/2])/Sqrt[a^2 + b^2]])/(b^4*(a^2 + b^2)^(3/2)) - Cosh[x]^3/(3*
b*(a + b*Sinh[x])^3) + (a*Cosh[x]^3)/(2*b*(a^2 + b^2)*(a + b*Sinh[x])^2) - (Cosh[x]*(2*(a^2 + b^2) + a*b*Sinh[
x]))/(2*b^3*(a^2 + b^2)*(a + b*Sinh[x]))

Rule 4391

Int[(u_.)*((b_.)*sec[(c_.) + (d_.)*(x_)]^(n_.) + (a_.)*tan[(c_.) + (d_.)*(x_)]^(n_.))^(p_), x_Symbol] :> Int[A
ctivateTrig[u]*Sec[c + d*x]^(n*p)*(b + a*Sin[c + d*x]^n)^p, x] /; FreeQ[{a, b, c, d}, x] && IntegersQ[n, p]

Rule 2693

Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_), x_Symbol] :> Simp[(g*(g*
Cos[e + f*x])^(p - 1)*(a + b*Sin[e + f*x])^(m + 1))/(b*f*(m + 1)), x] + Dist[(g^2*(p - 1))/(b*(m + 1)), Int[(g
*Cos[e + f*x])^(p - 2)*(a + b*Sin[e + f*x])^(m + 1)*Sin[e + f*x], x], x] /; FreeQ[{a, b, e, f, g}, x] && NeQ[a
^2 - b^2, 0] && LtQ[m, -1] && GtQ[p, 1] && IntegersQ[2*m, 2*p]

Rule 2864

Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*sin[(e_.)
+ (f_.)*(x_)]), x_Symbol] :> -Simp[((b*c - a*d)*(g*Cos[e + f*x])^(p + 1)*(a + b*Sin[e + f*x])^(m + 1))/(f*g*(a
^2 - b^2)*(m + 1)), x] + Dist[1/((a^2 - b^2)*(m + 1)), Int[(g*Cos[e + f*x])^p*(a + b*Sin[e + f*x])^(m + 1)*Sim
p[(a*c - b*d)*(m + 1) - (b*c - a*d)*(m + p + 2)*Sin[e + f*x], x], x], x] /; FreeQ[{a, b, c, d, e, f, g, p}, x]
&& NeQ[a^2 - b^2, 0] && LtQ[m, -1] && IntegerQ[2*m]

Rule 2863

Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*sin[(e_.)
+ (f_.)*(x_)]), x_Symbol] :> Simp[(g*(g*Cos[e + f*x])^(p - 1)*(a + b*Sin[e + f*x])^(m + 1)*(b*c*(m + p + 1) -
a*d*p + b*d*(m + 1)*Sin[e + f*x]))/(b^2*f*(m + 1)*(m + p + 1)), x] + Dist[(g^2*(p - 1))/(b^2*(m + 1)*(m + p +
1)), Int[(g*Cos[e + f*x])^(p - 2)*(a + b*Sin[e + f*x])^(m + 1)*Simp[b*d*(m + 1) + (b*c*(m + p + 1) - a*d*p)*Si
n[e + f*x], x], x], x] /; FreeQ[{a, b, c, d, e, f, g}, x] && NeQ[a^2 - b^2, 0] && LtQ[m, -1] && GtQ[p, 1] && N
eQ[m + p + 1, 0] && IntegerQ[2*m]

Rule 2735

Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])/((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(b*x)/d
, x] - Dist[(b*c - a*d)/d, Int[1/(c + d*Sin[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d
, 0]

Rule 2660

Int[((a_) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> With[{e = FreeFactors[Tan[(c + d*x)/2], x]}, Dis
t[(2*e)/d, Subst[Int[1/(a + 2*b*e*x + a*e^2*x^2), x], x, Tan[(c + d*x)/2]/e], x]] /; FreeQ[{a, b, c, d}, x] &&
NeQ[a^2 - b^2, 0]

Rule 618

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> Dist[-2, Subst[Int[1/Simp[b^2 - 4*a*c - x^2, x], x]
, x, b + 2*c*x], x] /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0]

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
/; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rubi steps

\begin{align*} \int \frac{1}{(a \text{sech}(x)+b \tanh (x))^4} \, dx &=\int \frac{\cosh ^4(x)}{(a+b \sinh (x))^4} \, dx\\ &=-\frac{\cosh ^3(x)}{3 b (a+b \sinh (x))^3}+\frac{\int \frac{\cosh ^2(x) \sinh (x)}{(a+b \sinh (x))^3} \, dx}{b}\\ &=-\frac{\cosh ^3(x)}{3 b (a+b \sinh (x))^3}+\frac{a \cosh ^3(x)}{2 b \left (a^2+b^2\right ) (a+b \sinh (x))^2}+\frac{i \int \frac{\cosh ^2(x) (-2 i b+i a \sinh (x))}{(a+b \sinh (x))^2} \, dx}{2 b \left (a^2+b^2\right )}\\ &=-\frac{\cosh ^3(x)}{3 b (a+b \sinh (x))^3}+\frac{a \cosh ^3(x)}{2 b \left (a^2+b^2\right ) (a+b \sinh (x))^2}-\frac{\cosh (x) \left (2 \left (a^2+b^2\right )+a b \sinh (x)\right )}{2 b^3 \left (a^2+b^2\right ) (a+b \sinh (x))}+\frac{i \int \frac{i a b-2 i \left (a^2+b^2\right ) \sinh (x)}{a+b \sinh (x)} \, dx}{2 b^3 \left (a^2+b^2\right )}\\ &=\frac{x}{b^4}-\frac{\cosh ^3(x)}{3 b (a+b \sinh (x))^3}+\frac{a \cosh ^3(x)}{2 b \left (a^2+b^2\right ) (a+b \sinh (x))^2}-\frac{\cosh (x) \left (2 \left (a^2+b^2\right )+a b \sinh (x)\right )}{2 b^3 \left (a^2+b^2\right ) (a+b \sinh (x))}-\frac{\left (a \left (2 a^2+3 b^2\right )\right ) \int \frac{1}{a+b \sinh (x)} \, dx}{2 b^4 \left (a^2+b^2\right )}\\ &=\frac{x}{b^4}-\frac{\cosh ^3(x)}{3 b (a+b \sinh (x))^3}+\frac{a \cosh ^3(x)}{2 b \left (a^2+b^2\right ) (a+b \sinh (x))^2}-\frac{\cosh (x) \left (2 \left (a^2+b^2\right )+a b \sinh (x)\right )}{2 b^3 \left (a^2+b^2\right ) (a+b \sinh (x))}-\frac{\left (a \left (2 a^2+3 b^2\right )\right ) \operatorname{Subst}\left (\int \frac{1}{a+2 b x-a x^2} \, dx,x,\tanh \left (\frac{x}{2}\right )\right )}{b^4 \left (a^2+b^2\right )}\\ &=\frac{x}{b^4}-\frac{\cosh ^3(x)}{3 b (a+b \sinh (x))^3}+\frac{a \cosh ^3(x)}{2 b \left (a^2+b^2\right ) (a+b \sinh (x))^2}-\frac{\cosh (x) \left (2 \left (a^2+b^2\right )+a b \sinh (x)\right )}{2 b^3 \left (a^2+b^2\right ) (a+b \sinh (x))}+\frac{\left (2 a \left (2 a^2+3 b^2\right )\right ) \operatorname{Subst}\left (\int \frac{1}{4 \left (a^2+b^2\right )-x^2} \, dx,x,2 b-2 a \tanh \left (\frac{x}{2}\right )\right )}{b^4 \left (a^2+b^2\right )}\\ &=\frac{x}{b^4}+\frac{a \left (2 a^2+3 b^2\right ) \tanh ^{-1}\left (\frac{b-a \tanh \left (\frac{x}{2}\right )}{\sqrt{a^2+b^2}}\right )}{b^4 \left (a^2+b^2\right )^{3/2}}-\frac{\cosh ^3(x)}{3 b (a+b \sinh (x))^3}+\frac{a \cosh ^3(x)}{2 b \left (a^2+b^2\right ) (a+b \sinh (x))^2}-\frac{\cosh (x) \left (2 \left (a^2+b^2\right )+a b \sinh (x)\right )}{2 b^3 \left (a^2+b^2\right ) (a+b \sinh (x))}\\ \end{align*}

Mathematica [C]  time = 6.45567, size = 3458, normalized size = 23.68 $\text{Result too large to show}$

Warning: Unable to verify antiderivative.

[In]

Integrate[(a*Sech[x] + b*Tanh[x])^(-4),x]

[Out]

((-I)*Sech[x]*(a + b*Sinh[x])^4*(((I/3)*b*(((-I)*b)/(a - I*b) - (b*Sinh[x])/(a - I*b))^(5/2)*((I*b)/(a + I*b)
- (b*Sinh[x])/(a + I*b))^(5/2))/((((-I)*a*b)/(a - I*b) - b^2/(a - I*b))*(((-I)*a*b)/(a + I*b) + b^2/(a + I*b))
*(a + b*Sinh[x])^3) - (((I/2)*a*b^3*(((-I)*b)/(a - I*b) - (b*Sinh[x])/(a - I*b))^(5/2)*((I*b)/(a + I*b) - (b*S
inh[x])/(a + I*b))^(5/2))/((a^2 + b^2)*(((-I)*a*b)/(a - I*b) - b^2/(a - I*b))*(((-I)*a*b)/(a + I*b) + b^2/(a +
I*b))*(a + b*Sinh[x])^2) - (-(((((3*I)*a^2*b^5)/(a^2 + b^2)^2 - ((2*I)*b^5*(3*a^2 + 2*b^2))/(a^2 + b^2)^2)*((
(-I)*b)/(a - I*b) - (b*Sinh[x])/(a - I*b))^(5/2)*((I*b)/(a + I*b) - (b*Sinh[x])/(a + I*b))^(5/2))/((((-I)*a*b)
/(a - I*b) - b^2/(a - I*b))*(((-I)*a*b)/(a + I*b) + b^2/(a + I*b))*(a + b*Sinh[x]))) - ((16*Sqrt[2]*(a - I*b)*
b^6*(3*a^2 + 4*b^2)*(((-I)*b)/(a - I*b) - (b*Sinh[x])/(a - I*b))^(5/2)*Sqrt[(I*b)/(a + I*b) - (b*Sinh[x])/(a +
I*b)]*(1 - ((I/2)*(a - I*b)*(((-I)*b)/(a - I*b) - (b*Sinh[x])/(a - I*b)))/b)^(5/2)*((5*(1/(2*(1 - ((I/2)*(a -
I*b)*(((-I)*b)/(a - I*b) - (b*Sinh[x])/(a - I*b)))/b)^2) + (1 - ((I/2)*(a - I*b)*(((-I)*b)/(a - I*b) - (b*Sin
h[x])/(a - I*b)))/b)^(-1)))/8 + (((15*I)/32)*b^3*(((-I)*(a - I*b)*(((-I)*b)/(a - I*b) - (b*Sinh[x])/(a - I*b))
)/b + ((a - I*b)^2*(((-I)*b)/(a - I*b) - (b*Sinh[x])/(a - I*b))^2)/(3*b^2) + ((-1)^(1/4)*Sqrt[2]*Sqrt[a - I*b]
*ArcSin[((-1)^(1/4)*Sqrt[a - I*b]*Sqrt[((-I)*b)/(a - I*b) - (b*Sinh[x])/(a - I*b)])/(Sqrt[2]*Sqrt[b])]*Sqrt[((
-I)*b)/(a - I*b) - (b*Sinh[x])/(a - I*b)])/(Sqrt[b]*Sqrt[1 - ((I/2)*(a - I*b)*(((-I)*b)/(a - I*b) - (b*Sinh[x]
)/(a - I*b)))/b])))/((a - I*b)^3*(((-I)*b)/(a - I*b) - (b*Sinh[x])/(a - I*b))^3*(1 - ((I/2)*(a - I*b)*(((-I)*b
)/(a - I*b) - (b*Sinh[x])/(a - I*b)))/b)^2)))/(5*(a + I*b)*(a^2 + b^2)^3*Sqrt[((-I)*(a + I*b)*((I*b)/(a + I*b)
- (b*Sinh[x])/(a + I*b)))/b]) + (I*(((4*I)*a*b^7*(3*a^2 + 4*b^2))/(a^2 + b^2)^3 - (I*a*b^7*(6*a^2 + 7*b^2))/(
a^2 + b^2)^3)*((-4*Sqrt[2]*(((-I)*b)/(a - I*b) - (b*Sinh[x])/(a - I*b))^(3/2)*Sqrt[(I*b)/(a + I*b) - (b*Sinh[x
])/(a + I*b)]*(1 - ((I/2)*(a - I*b)*(((-I)*b)/(a - I*b) - (b*Sinh[x])/(a - I*b)))/b)^(5/2)*((3/(4*(1 - ((I/2)*
(a - I*b)*(((-I)*b)/(a - I*b) - (b*Sinh[x])/(a - I*b)))/b)^2) + (1 - ((I/2)*(a - I*b)*(((-I)*b)/(a - I*b) - (b
*Sinh[x])/(a - I*b)))/b)^(-1))/2 - (3*b^2*(((-I)*(a - I*b)*(((-I)*b)/(a - I*b) - (b*Sinh[x])/(a - I*b)))/b + (
(-1)^(1/4)*Sqrt[2]*Sqrt[a - I*b]*ArcSin[((-1)^(1/4)*Sqrt[a - I*b]*Sqrt[((-I)*b)/(a - I*b) - (b*Sinh[x])/(a - I
*b)])/(Sqrt[2]*Sqrt[b])]*Sqrt[((-I)*b)/(a - I*b) - (b*Sinh[x])/(a - I*b)])/(Sqrt[b]*Sqrt[1 - ((I/2)*(a - I*b)*
(((-I)*b)/(a - I*b) - (b*Sinh[x])/(a - I*b)))/b])))/(8*(a - I*b)^2*(((-I)*b)/(a - I*b) - (b*Sinh[x])/(a - I*b)
)^2*(1 - ((I/2)*(a - I*b)*(((-I)*b)/(a - I*b) - (b*Sinh[x])/(a - I*b)))/b)^2)))/(3*(a + I*b)*Sqrt[((-I)*(a + I
*b)*((I*b)/(a + I*b) - (b*Sinh[x])/(a + I*b)))/b]) - (I*((I*a*b)/(a - I*b) + b^2/(a - I*b))*(((-I)*((I*a*b)/(a
- I*b) + b^2/(a - I*b))*(((-I)*((I*a*b)/(a + I*b) - b^2/(a + I*b))*(((-2*I)*((I*a*b)/(a + I*b) - b^2/(a + I*b
))*ArcTan[(Sqrt[((-I)*a*b)/(a + I*b) + b^2/(a + I*b)]*Sqrt[((-I)*b)/(a - I*b) - (b*Sinh[x])/(a - I*b)])/(Sqrt[
(I*a*b)/(a - I*b) + b^2/(a - I*b)]*Sqrt[(I*b)/(a + I*b) - (b*Sinh[x])/(a + I*b)])])/(b*Sqrt[(I*a*b)/(a - I*b)
+ b^2/(a - I*b)]*Sqrt[((-I)*a*b)/(a + I*b) + b^2/(a + I*b)]) + ((2*I)*Sqrt[a - I*b]*ArcTanh[(Sqrt[a - I*b]*Sqr
t[((-I)*b)/(a - I*b) - (b*Sinh[x])/(a - I*b)])/(Sqrt[a + I*b]*Sqrt[(I*b)/(a + I*b) - (b*Sinh[x])/(a + I*b)])])
/(Sqrt[a + I*b]*b)))/b + ((2*I)*Sqrt[2]*(a - I*b)*Sqrt[((-I)*b)/(a - I*b) - (b*Sinh[x])/(a - I*b)]*Sqrt[(I*b)/
(a + I*b) - (b*Sinh[x])/(a + I*b)]*(1 - ((I/2)*(a - I*b)*(((-I)*b)/(a - I*b) - (b*Sinh[x])/(a - I*b)))/b)^(3/2
)*(-(((-1)^(3/4)*Sqrt[b]*ArcSin[((-1)^(1/4)*Sqrt[a - I*b]*Sqrt[((-I)*b)/(a - I*b) - (b*Sinh[x])/(a - I*b)])/(S
qrt[2]*Sqrt[b])])/(Sqrt[2]*Sqrt[a - I*b]*Sqrt[((-I)*b)/(a - I*b) - (b*Sinh[x])/(a - I*b)]*(1 - ((I/2)*(a - I*b
)*(((-I)*b)/(a - I*b) - (b*Sinh[x])/(a - I*b)))/b)^(3/2))) + 1/(2*(1 - ((I/2)*(a - I*b)*(((-I)*b)/(a - I*b) -
(b*Sinh[x])/(a - I*b)))/b))))/((a + I*b)*b*Sqrt[((-I)*(a + I*b)*((I*b)/(a + I*b) - (b*Sinh[x])/(a + I*b)))/b])
))/b - (4*Sqrt[2]*Sqrt[((-I)*b)/(a - I*b) - (b*Sinh[x])/(a - I*b)]*Sqrt[(I*b)/(a + I*b) - (b*Sinh[x])/(a + I*b
)]*(1 - ((I/2)*(a - I*b)*(((-I)*b)/(a - I*b) - (b*Sinh[x])/(a - I*b)))/b)^(5/2)*((-3*(-1)^(3/4)*Sqrt[b]*ArcSin
[((-1)^(1/4)*Sqrt[a - I*b]*Sqrt[((-I)*b)/(a - I*b) - (b*Sinh[x])/(a - I*b)])/(Sqrt[2]*Sqrt[b])])/(4*Sqrt[2]*Sq
rt[a - I*b]*Sqrt[((-I)*b)/(a - I*b) - (b*Sinh[x])/(a - I*b)]*(1 - ((I/2)*(a - I*b)*(((-I)*b)/(a - I*b) - (b*Si
nh[x])/(a - I*b)))/b)^(5/2)) + (3/(2*(1 - ((I/2)*(a - I*b)*(((-I)*b)/(a - I*b) - (b*Sinh[x])/(a - I*b)))/b)^2)
+ (1 - ((I/2)*(a - I*b)*(((-I)*b)/(a - I*b) - (b*Sinh[x])/(a - I*b)))/b)^(-1))/4))/((a + I*b)*Sqrt[((-I)*(a +
I*b)*((I*b)/(a + I*b) - (b*Sinh[x])/(a + I*b)))/b])))/b))/b)/((((-I)*a*b)/(a - I*b) - b^2/(a - I*b))*(((-I)*a
*b)/(a + I*b) + b^2/(a + I*b))))/(2*(((-I)*a*b)/(a - I*b) - b^2/(a - I*b))*(((-I)*a*b)/(a + I*b) + b^2/(a + I*
b))))/(3*(((-I)*a*b)/(a - I*b) - b^2/(a - I*b))*(((-I)*a*b)/(a + I*b) + b^2/(a + I*b)))))/((1 - (a + b*Sinh[x]
)/(a - I*b))^(3/2)*(1 - (a + b*Sinh[x])/(a + I*b))^(3/2)*(a*Sech[x] + b*Tanh[x])^4)

________________________________________________________________________________________

Maple [B]  time = 0.109, size = 972, normalized size = 6.7 \begin{align*} \text{result too large to display} \end{align*}

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

[In]

int(1/(a*sech(x)+b*tanh(x))^4,x)

[Out]

2/3*b/(a*tanh(1/2*x)^2-2*tanh(1/2*x)*b-a)^3/(a^2+b^2)+1/b^2/(a*tanh(1/2*x)^2-2*tanh(1/2*x)*b-a)^3*a^3/(a^2+b^2
)*tanh(1/2*x)^5+2*b^2/(a*tanh(1/2*x)^2-2*tanh(1/2*x)*b-a)^3/a/(a^2+b^2)*tanh(1/2*x)^5+2/b^3/(a*tanh(1/2*x)^2-2
*tanh(1/2*x)*b-a)^3/(a^2+b^2)*a^4*tanh(1/2*x)^4-3/b/(a*tanh(1/2*x)^2-2*tanh(1/2*x)*b-a)^3/(a^2+b^2)*a^2*tanh(1
/2*x)^4-4*b^3/(a*tanh(1/2*x)^2-2*tanh(1/2*x)*b-a)^3/(a^2+b^2)/a^2*tanh(1/2*x)^4-12/b^2/(a*tanh(1/2*x)^2-2*tanh
(1/2*x)*b-a)^3*a^3/(a^2+b^2)*tanh(1/2*x)^3+8/3*b^2/(a*tanh(1/2*x)^2-2*tanh(1/2*x)*b-a)^3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(1/2*x)+1)-1/b^4*ln(tanh(1/2*x)-1)

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

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

[In]

integrate(1/(a*sech(x)+b*tanh(x))^4,x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [B]  time = 3.08197, size = 6724, normalized size = 46.05 \begin{align*} \text{result too large to display} \end{align*}

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

[In]

integrate(1/(a*sech(x)+b*tanh(x))^4,x, algorithm="fricas")

[Out]

-1/6*(6*(a^4*b^3 + 2*a^2*b^5 + b^7)*x*cosh(x)^6 + 6*(a^4*b^3 + 2*a^2*b^5 + b^7)*x*sinh(x)^6 - 22*a^4*b^3 - 38*
a^2*b^5 - 16*b^7 + 6*(6*a^5*b^2 + 11*a^3*b^4 + 5*a*b^6 + 6*(a^5*b^2 + 2*a^3*b^4 + a*b^6)*x)*cosh(x)^5 + 6*(6*a
^5*b^2 + 11*a^3*b^4 + 5*a*b^6 + 6*(a^4*b^3 + 2*a^2*b^5 + b^7)*x*cosh(x) + 6*(a^5*b^2 + 2*a^3*b^4 + a*b^6)*x)*s
inh(x)^5 + 6*(18*a^6*b + 27*a^4*b^3 + 5*a^2*b^5 - 4*b^7 + 3*(4*a^6*b + 7*a^4*b^3 + 2*a^2*b^5 - b^7)*x)*cosh(x)
^4 + 6*(18*a^6*b + 27*a^4*b^3 + 5*a^2*b^5 - 4*b^7 + 15*(a^4*b^3 + 2*a^2*b^5 + b^7)*x*cosh(x)^2 + 3*(4*a^6*b +
7*a^4*b^3 + 2*a^2*b^5 - b^7)*x + 5*(6*a^5*b^2 + 11*a^3*b^4 + 5*a*b^6 + 6*(a^5*b^2 + 2*a^3*b^4 + a*b^6)*x)*cosh
(x))*sinh(x)^4 + 4*(22*a^7 + 5*a^5*b^2 - 41*a^3*b^4 - 24*a*b^6 + 6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b^9 + b^11)*cosh(x)^2 + 10*(a^5*b^6 + 2*a^3*b^8 + a*b^10)*cosh(x))*sinh(x)^4 - 4*(2*a^7*
b^4 + a^5*b^6 - 4*a^3*b^8 - 3*a*b^10)*cosh(x)^3 - 4*(2*a^7*b^4 + a^5*b^6 - 4*a^3*b^8 - 3*a*b^10 + 5*(a^4*b^7 +
2*a^2*b^9 + b^11)*cosh(x)^3 + 15*(a^5*b^6 + 2*a^3*b^8 + a*b^10)*cosh(x)^2 + 3*(4*a^6*b^5 + 7*a^4*b^7 + 2*a^2*
b^9 - b^11)*cosh(x))*sinh(x)^3 + 3*(4*a^6*b^5 + 7*a^4*b^7 + 2*a^2*b^9 - b^11)*cosh(x)^2 + 3*(4*a^6*b^5 + 7*a^4
*b^7 + 2*a^2*b^9 - b^11 - 5*(a^4*b^7 + 2*a^2*b^9 + b^11)*cosh(x)^4 - 20*(a^5*b^6 + 2*a^3*b^8 + a*b^10)*cosh(x)
^3 - 6*(4*a^6*b^5 + 7*a^4*b^7 + 2*a^2*b^9 - b^11)*cosh(x)^2 - 4*(2*a^7*b^4 + a^5*b^6 - 4*a^3*b^8 - 3*a*b^10)*c
osh(x))*sinh(x)^2 - 6*(a^5*b^6 + 2*a^3*b^8 + a*b^10)*cosh(x) - 6*(a^5*b^6 + 2*a^3*b^8 + a*b^10 + (a^4*b^7 + 2*
a^2*b^9 + b^11)*cosh(x)^5 + 5*(a^5*b^6 + 2*a^3*b^8 + a*b^10)*cosh(x)^4 + 2*(4*a^6*b^5 + 7*a^4*b^7 + 2*a^2*b^9
- b^11)*cosh(x)^3 + 2*(2*a^7*b^4 + a^5*b^6 - 4*a^3*b^8 - 3*a*b^10)*cosh(x)^2 - (4*a^6*b^5 + 7*a^4*b^7 + 2*a^2*
b^9 - b^11)*cosh(x))*sinh(x))

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{1}{\left (a \operatorname{sech}{\left (x \right )} + b \tanh{\left (x \right )}\right )^{4}}\, dx \end{align*}

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

[In]

integrate(1/(a*sech(x)+b*tanh(x))**4,x)

[Out]

Integral((a*sech(x) + b*tanh(x))**(-4), x)

________________________________________________________________________________________

Giac [A]  time = 1.18791, size = 360, normalized size = 2.47 \begin{align*} -\frac{{\left (2 \, a^{3} + 3 \, a b^{2}\right )} \log \left (\frac{{\left | 2 \, b e^{x} + 2 \, a - 2 \, \sqrt{a^{2} + b^{2}} \right |}}{{\left | 2 \, b e^{x} + 2 \, a + 2 \, \sqrt{a^{2} + b^{2}} \right |}}\right )}{2 \,{\left (a^{2} b^{4} + b^{6}\right )} \sqrt{a^{2} + b^{2}}} + \frac{18 \, a^{3} b^{2} e^{\left (5 \, x\right )} + 15 \, a b^{4} e^{\left (5 \, x\right )} + 54 \, a^{4} b e^{\left (4 \, x\right )} + 27 \, a^{2} b^{3} e^{\left (4 \, x\right )} - 12 \, b^{5} e^{\left (4 \, x\right )} + 44 \, a^{5} e^{\left (3 \, x\right )} - 34 \, a^{3} b^{2} e^{\left (3 \, x\right )} - 48 \, a b^{4} e^{\left (3 \, x\right )} - 78 \, a^{4} b e^{\left (2 \, x\right )} - 36 \, a^{2} b^{3} e^{\left (2 \, x\right )} + 12 \, b^{5} e^{\left (2 \, x\right )} + 48 \, a^{3} b^{2} e^{x} + 33 \, a b^{4} e^{x} - 11 \, a^{2} b^{3} - 8 \, b^{5}}{3 \,{\left (a^{2} b^{4} + b^{6}\right )}{\left (b e^{\left (2 \, x\right )} + 2 \, a e^{x} - b\right )}^{3}} + \frac{x}{b^{4}} \end{align*}

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

[In]

integrate(1/(a*sech(x)+b*tanh(x))^4,x, algorithm="giac")

[Out]

-1/2*(2*a^3 + 3*a*b^2)*log(abs(2*b*e^x + 2*a - 2*sqrt(a^2 + b^2))/abs(2*b*e^x + 2*a + 2*sqrt(a^2 + b^2)))/((a^
2*b^4 + b^6)*sqrt(a^2 + b^2)) + 1/3*(18*a^3*b^2*e^(5*x) + 15*a*b^4*e^(5*x) + 54*a^4*b*e^(4*x) + 27*a^2*b^3*e^(
4*x) - 12*b^5*e^(4*x) + 44*a^5*e^(3*x) - 34*a^3*b^2*e^(3*x) - 48*a*b^4*e^(3*x) - 78*a^4*b*e^(2*x) - 36*a^2*b^3
*e^(2*x) + 12*b^5*e^(2*x) + 48*a^3*b^2*e^x + 33*a*b^4*e^x - 11*a^2*b^3 - 8*b^5)/((a^2*b^4 + b^6)*(b*e^(2*x) +
2*a*e^x - b)^3) + x/b^4