3.227 \(\int \frac{e^x}{(a-\tanh (2 x))^2} \, dx\)

Optimal. Leaf size=152 \[ -\frac{(4 a+1) \tan ^{-1}\left (\frac{\sqrt [4]{1-a} e^x}{\sqrt [4]{a+1}}\right )}{2 (1-a)^2 (a+1)^{3/2} \sqrt [4]{1-a^2}}-\frac{(4 a+1) \tanh ^{-1}\left (\frac{\sqrt [4]{1-a} e^x}{\sqrt [4]{a+1}}\right )}{2 (1-a)^2 (a+1)^{3/2} \sqrt [4]{1-a^2}}+\frac{e^x}{(1-a)^2}+\frac{e^x}{(1-a)^2 (a+1) \left ((a-1) e^{4 x}+a+1\right )} \]

[Out]

E^x/(1 - a)^2 + E^x/((1 - a)^2*(1 + a)*(1 + a + (-1 + a)*E^(4*x))) - ((1 + 4*a)*ArcTan[((1 - a)^(1/4)*E^x)/(1
+ a)^(1/4)])/(2*(1 - a)^2*(1 + a)^(3/2)*(1 - a^2)^(1/4)) - ((1 + 4*a)*ArcTanh[((1 - a)^(1/4)*E^x)/(1 + a)^(1/4
)])/(2*(1 - a)^2*(1 + a)^(3/2)*(1 - a^2)^(1/4))

________________________________________________________________________________________

Rubi [A]  time = 0.1764, antiderivative size = 152, normalized size of antiderivative = 1., number of steps used = 7, number of rules used = 6, integrand size = 14, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.429, Rules used = {2282, 390, 385, 212, 208, 205} \[ -\frac{(4 a+1) \tan ^{-1}\left (\frac{\sqrt [4]{1-a} e^x}{\sqrt [4]{a+1}}\right )}{2 (1-a)^2 (a+1)^{3/2} \sqrt [4]{1-a^2}}-\frac{(4 a+1) \tanh ^{-1}\left (\frac{\sqrt [4]{1-a} e^x}{\sqrt [4]{a+1}}\right )}{2 (1-a)^2 (a+1)^{3/2} \sqrt [4]{1-a^2}}+\frac{e^x}{(1-a)^2}+\frac{e^x}{(1-a)^2 (a+1) \left ((a-1) e^{4 x}+a+1\right )} \]

Antiderivative was successfully verified.

[In]

Int[E^x/(a - Tanh[2*x])^2,x]

[Out]

E^x/(1 - a)^2 + E^x/((1 - a)^2*(1 + a)*(1 + a + (-1 + a)*E^(4*x))) - ((1 + 4*a)*ArcTan[((1 - a)^(1/4)*E^x)/(1
+ a)^(1/4)])/(2*(1 - a)^2*(1 + a)^(3/2)*(1 - a^2)^(1/4)) - ((1 + 4*a)*ArcTanh[((1 - a)^(1/4)*E^x)/(1 + a)^(1/4
)])/(2*(1 - a)^2*(1 + a)^(3/2)*(1 - a^2)^(1/4))

Rule 2282

Int[u_, x_Symbol] :> With[{v = FunctionOfExponential[u, x]}, Dist[v/D[v, x], Subst[Int[FunctionOfExponentialFu
nction[u, x]/x, x], x, v], x]] /; FunctionOfExponentialQ[u, x] &&  !MatchQ[u, (w_)*((a_.)*(v_)^(n_))^(m_) /; F
reeQ[{a, m, n}, x] && IntegerQ[m*n]] &&  !MatchQ[u, E^((c_.)*((a_.) + (b_.)*x))*(F_)[v_] /; FreeQ[{a, b, c}, x
] && InverseFunctionQ[F[x]]]

Rule 390

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_))^(q_), x_Symbol] :> Int[PolynomialDivide[(a + b*x^n)
^p, (c + d*x^n)^(-q), x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && IGtQ[n, 0] && IGtQ[p, 0] && ILt
Q[q, 0] && GeQ[p, -q]

Rule 385

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> -Simp[((b*c - a*d)*x*(a + b*x^n)^(p +
 1))/(a*b*n*(p + 1)), x] - Dist[(a*d - b*c*(n*(p + 1) + 1))/(a*b*n*(p + 1)), Int[(a + b*x^n)^(p + 1), x], x] /
; FreeQ[{a, b, c, d, n, p}, x] && NeQ[b*c - a*d, 0] && (LtQ[p, -1] || ILtQ[1/n + p, 0])

Rule 212

Int[((a_) + (b_.)*(x_)^4)^(-1), x_Symbol] :> With[{r = Numerator[Rt[-(a/b), 2]], s = Denominator[Rt[-(a/b), 2]
]}, Dist[r/(2*a), Int[1/(r - s*x^2), x], x] + Dist[r/(2*a), Int[1/(r + s*x^2), x], x]] /; FreeQ[{a, b}, x] &&
 !GtQ[a/b, 0]

Rule 208

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

Rule 205

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]*ArcTan[x/Rt[a/b, 2]])/a, x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rubi steps

\begin{align*} \int \frac{e^x}{(a-\tanh (2 x))^2} \, dx &=\operatorname{Subst}\left (\int \frac{\left (1+x^4\right )^2}{\left (1+a-(1-a) x^4\right )^2} \, dx,x,e^x\right )\\ &=\operatorname{Subst}\left (\int \left (\frac{1}{(-1+a)^2}-\frac{4 \left (a-(1-a) x^4\right )}{(-1+a)^2 \left (1+a+(-1+a) x^4\right )^2}\right ) \, dx,x,e^x\right )\\ &=\frac{e^x}{(1-a)^2}-\frac{4 \operatorname{Subst}\left (\int \frac{a-(1-a) x^4}{\left (1+a+(-1+a) x^4\right )^2} \, dx,x,e^x\right )}{(1-a)^2}\\ &=\frac{e^x}{(1-a)^2}+\frac{e^x}{(1-a)^2 (1+a) \left (1+a-(1-a) e^{4 x}\right )}-\frac{(1+4 a) \operatorname{Subst}\left (\int \frac{1}{1+a+(-1+a) x^4} \, dx,x,e^x\right )}{(1-a)^2 (1+a)}\\ &=\frac{e^x}{(1-a)^2}+\frac{e^x}{(1-a)^2 (1+a) \left (1+a-(1-a) e^{4 x}\right )}-\frac{(1+4 a) \operatorname{Subst}\left (\int \frac{1}{\sqrt{1+a}-\sqrt{1-a} x^2} \, dx,x,e^x\right )}{2 (1-a)^2 (1+a)^{3/2}}-\frac{(1+4 a) \operatorname{Subst}\left (\int \frac{1}{\sqrt{1+a}+\sqrt{1-a} x^2} \, dx,x,e^x\right )}{2 (1-a)^2 (1+a)^{3/2}}\\ &=\frac{e^x}{(1-a)^2}+\frac{e^x}{(1-a)^2 (1+a) \left (1+a-(1-a) e^{4 x}\right )}-\frac{(1+4 a) \tan ^{-1}\left (\frac{\sqrt [4]{1-a} e^x}{\sqrt [4]{1+a}}\right )}{2 (1-a)^2 (1+a)^{3/2} \sqrt [4]{1-a^2}}-\frac{(1+4 a) \tanh ^{-1}\left (\frac{\sqrt [4]{1-a} e^x}{\sqrt [4]{1+a}}\right )}{2 (1-a)^2 (1+a)^{3/2} \sqrt [4]{1-a^2}}\\ \end{align*}

Mathematica [C]  time = 0.139498, size = 107, normalized size = 0.7 \[ \frac{(4 a+1) \text{RootSum}\left [\text{$\#$1}^4 a-\text{$\#$1}^4+a+1\& ,\frac{x-\log \left (e^x-\text{$\#$1}\right )}{\text{$\#$1}^3}\& \right ]+\frac{4 (a-1) e^x \left (a^2 \left (e^{4 x}+1\right )+2 a-e^{4 x}+2\right )}{a e^{4 x}+a-e^{4 x}+1}}{4 (a-1)^3 (a+1)} \]

Antiderivative was successfully verified.

[In]

Integrate[E^x/(a - Tanh[2*x])^2,x]

[Out]

((4*(-1 + a)*E^x*(2 + 2*a - E^(4*x) + a^2*(1 + E^(4*x))))/(1 + a - E^(4*x) + a*E^(4*x)) + (1 + 4*a)*RootSum[1
+ a - #1^4 + a*#1^4 & , (x - Log[E^x - #1])/#1^3 & ])/(4*(-1 + a)^3*(1 + a))

________________________________________________________________________________________

Maple [C]  time = 0.194, size = 476, normalized size = 3.1 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(exp(x)/(a-tanh(2*x))^2,x)

[Out]

-2/(-1+a)^2/(tanh(1/2*x)-1)+1/(-1+a)^2/(a*tanh(1/2*x)^4-4*tanh(1/2*x)^3+6*a*tanh(1/2*x)^2-4*tanh(1/2*x)+a)/(1+
a)*tanh(1/2*x)^3-2/(-1+a)^2/(a*tanh(1/2*x)^4-4*tanh(1/2*x)^3+6*a*tanh(1/2*x)^2-4*tanh(1/2*x)+a)/a/(1+a)*tanh(1
/2*x)^3+3/(-1+a)^2/(a*tanh(1/2*x)^4-4*tanh(1/2*x)^3+6*a*tanh(1/2*x)^2-4*tanh(1/2*x)+a)/(1+a)*tanh(1/2*x)^2-2/(
-1+a)^2/(a*tanh(1/2*x)^4-4*tanh(1/2*x)^3+6*a*tanh(1/2*x)^2-4*tanh(1/2*x)+a)/a/(1+a)*tanh(1/2*x)-1/(-1+a)^2/(a*
tanh(1/2*x)^4-4*tanh(1/2*x)^3+6*a*tanh(1/2*x)^2-4*tanh(1/2*x)+a)/(1+a)*tanh(1/2*x)+1/(-1+a)^2/(a*tanh(1/2*x)^4
-4*tanh(1/2*x)^3+6*a*tanh(1/2*x)^2-4*tanh(1/2*x)+a)/(1+a)-1/4/(-1+a)^2/(1+a)*sum((_R^2-2*_R+1)/(_R^3*a-3*_R^2+
3*_R*a-1)*ln(tanh(1/2*x)-_R),_R=RootOf(_Z^4*a-4*_Z^3+6*_Z^2*a-4*_Z+a))-1/(-1+a)^2/(1+a)*sum((_R^2-2*_R+1)/(_R^
3*a-3*_R^2+3*_R*a-1)*ln(tanh(1/2*x)-_R),_R=RootOf(_Z^4*a-4*_Z^3+6*_Z^2*a-4*_Z+a))*a

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(exp(x)/(a-tanh(2*x))^2,x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [B]  time = 2.34791, size = 2920, normalized size = 19.21 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(exp(x)/(a-tanh(2*x))^2,x, algorithm="fricas")

[Out]

-1/4*(4*(a^4 - 2*a^2 + (a^4 - 2*a^3 + 2*a - 1)*e^(4*x) + 1)*(-(256*a^4 + 256*a^3 + 96*a^2 + 16*a + 1)/(a^16 -
2*a^15 - 6*a^14 + 14*a^13 + 14*a^12 - 42*a^11 - 14*a^10 + 70*a^9 - 70*a^7 + 14*a^6 + 42*a^5 - 14*a^4 - 14*a^3
+ 6*a^2 + 2*a - 1))^(1/4)*arctan(-((4*a^13 - 7*a^12 - 18*a^11 + 36*a^10 + 30*a^9 - 75*a^8 - 20*a^7 + 80*a^6 -
45*a^4 + 6*a^3 + 12*a^2 - 2*a - 1)*(-(256*a^4 + 256*a^3 + 96*a^2 + 16*a + 1)/(a^16 - 2*a^15 - 6*a^14 + 14*a^13
 + 14*a^12 - 42*a^11 - 14*a^10 + 70*a^9 - 70*a^7 + 14*a^6 + 42*a^5 - 14*a^4 - 14*a^3 + 6*a^2 + 2*a - 1))^(3/4)
*e^x - (a^12 - 2*a^11 - 4*a^10 + 10*a^9 + 5*a^8 - 20*a^7 + 20*a^5 - 5*a^4 - 10*a^3 + 4*a^2 + 2*a - 1)*sqrt((16
*a^2 + 8*a + 1)*e^(2*x) + (a^8 - 4*a^6 + 6*a^4 - 4*a^2 + 1)*sqrt(-(256*a^4 + 256*a^3 + 96*a^2 + 16*a + 1)/(a^1
6 - 2*a^15 - 6*a^14 + 14*a^13 + 14*a^12 - 42*a^11 - 14*a^10 + 70*a^9 - 70*a^7 + 14*a^6 + 42*a^5 - 14*a^4 - 14*
a^3 + 6*a^2 + 2*a - 1)))*(-(256*a^4 + 256*a^3 + 96*a^2 + 16*a + 1)/(a^16 - 2*a^15 - 6*a^14 + 14*a^13 + 14*a^12
 - 42*a^11 - 14*a^10 + 70*a^9 - 70*a^7 + 14*a^6 + 42*a^5 - 14*a^4 - 14*a^3 + 6*a^2 + 2*a - 1))^(3/4))/(256*a^4
 + 256*a^3 + 96*a^2 + 16*a + 1)) + (a^4 - 2*a^2 + (a^4 - 2*a^3 + 2*a - 1)*e^(4*x) + 1)*(-(256*a^4 + 256*a^3 +
96*a^2 + 16*a + 1)/(a^16 - 2*a^15 - 6*a^14 + 14*a^13 + 14*a^12 - 42*a^11 - 14*a^10 + 70*a^9 - 70*a^7 + 14*a^6
+ 42*a^5 - 14*a^4 - 14*a^3 + 6*a^2 + 2*a - 1))^(1/4)*log((4*a + 1)*e^x + (a^4 - 2*a^2 + 1)*(-(256*a^4 + 256*a^
3 + 96*a^2 + 16*a + 1)/(a^16 - 2*a^15 - 6*a^14 + 14*a^13 + 14*a^12 - 42*a^11 - 14*a^10 + 70*a^9 - 70*a^7 + 14*
a^6 + 42*a^5 - 14*a^4 - 14*a^3 + 6*a^2 + 2*a - 1))^(1/4)) - (a^4 - 2*a^2 + (a^4 - 2*a^3 + 2*a - 1)*e^(4*x) + 1
)*(-(256*a^4 + 256*a^3 + 96*a^2 + 16*a + 1)/(a^16 - 2*a^15 - 6*a^14 + 14*a^13 + 14*a^12 - 42*a^11 - 14*a^10 +
70*a^9 - 70*a^7 + 14*a^6 + 42*a^5 - 14*a^4 - 14*a^3 + 6*a^2 + 2*a - 1))^(1/4)*log((4*a + 1)*e^x - (a^4 - 2*a^2
 + 1)*(-(256*a^4 + 256*a^3 + 96*a^2 + 16*a + 1)/(a^16 - 2*a^15 - 6*a^14 + 14*a^13 + 14*a^12 - 42*a^11 - 14*a^1
0 + 70*a^9 - 70*a^7 + 14*a^6 + 42*a^5 - 14*a^4 - 14*a^3 + 6*a^2 + 2*a - 1))^(1/4)) - 4*(a^2 - 1)*e^(5*x) - 4*(
a^2 + 2*a + 2)*e^x)/(a^4 - 2*a^2 + (a^4 - 2*a^3 + 2*a - 1)*e^(4*x) + 1)

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{e^{x}}{\left (a - \tanh{\left (2 x \right )}\right )^{2}}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(exp(x)/(a-tanh(2*x))**2,x)

[Out]

Integral(exp(x)/(a - tanh(2*x))**2, x)

________________________________________________________________________________________

Giac [B]  time = 1.27103, size = 616, normalized size = 4.05 \begin{align*} -\frac{{\left (a^{4} - 2 \, a^{3} + 2 \, a - 1\right )}^{\frac{1}{4}}{\left (4 \, a + 1\right )} \arctan \left (\frac{\sqrt{2}{\left (\sqrt{2} \left (\frac{a + 1}{a - 1}\right )^{\frac{1}{4}} + 2 \, e^{x}\right )}}{2 \, \left (\frac{a + 1}{a - 1}\right )^{\frac{1}{4}}}\right )}{2 \,{\left (\sqrt{2} a^{5} - \sqrt{2} a^{4} - 2 \, \sqrt{2} a^{3} + 2 \, \sqrt{2} a^{2} + \sqrt{2} a - \sqrt{2}\right )}} - \frac{{\left (a^{4} - 2 \, a^{3} + 2 \, a - 1\right )}^{\frac{1}{4}}{\left (4 \, a + 1\right )} \arctan \left (-\frac{\sqrt{2}{\left (\sqrt{2} \left (\frac{a + 1}{a - 1}\right )^{\frac{1}{4}} - 2 \, e^{x}\right )}}{2 \, \left (\frac{a + 1}{a - 1}\right )^{\frac{1}{4}}}\right )}{2 \,{\left (\sqrt{2} a^{5} - \sqrt{2} a^{4} - 2 \, \sqrt{2} a^{3} + 2 \, \sqrt{2} a^{2} + \sqrt{2} a - \sqrt{2}\right )}} - \frac{{\left (a^{4} - 2 \, a^{3} + 2 \, a - 1\right )}^{\frac{1}{4}}{\left (4 \, a + 1\right )} \log \left (\sqrt{2} \left (\frac{a + 1}{a - 1}\right )^{\frac{1}{4}} e^{x} + \sqrt{\frac{a + 1}{a - 1}} + e^{\left (2 \, x\right )}\right )}{4 \,{\left (\sqrt{2} a^{5} - \sqrt{2} a^{4} - 2 \, \sqrt{2} a^{3} + 2 \, \sqrt{2} a^{2} + \sqrt{2} a - \sqrt{2}\right )}} + \frac{{\left (a^{4} - 2 \, a^{3} + 2 \, a - 1\right )}^{\frac{1}{4}}{\left (4 \, a + 1\right )} \log \left (-\sqrt{2} \left (\frac{a + 1}{a - 1}\right )^{\frac{1}{4}} e^{x} + \sqrt{\frac{a + 1}{a - 1}} + e^{\left (2 \, x\right )}\right )}{4 \,{\left (\sqrt{2} a^{5} - \sqrt{2} a^{4} - 2 \, \sqrt{2} a^{3} + 2 \, \sqrt{2} a^{2} + \sqrt{2} a - \sqrt{2}\right )}} + \frac{e^{x}}{a^{2} - 2 \, a + 1} + \frac{e^{x}}{{\left (a^{3} - a^{2} - a + 1\right )}{\left (a e^{\left (4 \, x\right )} + a - e^{\left (4 \, x\right )} + 1\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(exp(x)/(a-tanh(2*x))^2,x, algorithm="giac")

[Out]

-1/2*(a^4 - 2*a^3 + 2*a - 1)^(1/4)*(4*a + 1)*arctan(1/2*sqrt(2)*(sqrt(2)*((a + 1)/(a - 1))^(1/4) + 2*e^x)/((a
+ 1)/(a - 1))^(1/4))/(sqrt(2)*a^5 - sqrt(2)*a^4 - 2*sqrt(2)*a^3 + 2*sqrt(2)*a^2 + sqrt(2)*a - sqrt(2)) - 1/2*(
a^4 - 2*a^3 + 2*a - 1)^(1/4)*(4*a + 1)*arctan(-1/2*sqrt(2)*(sqrt(2)*((a + 1)/(a - 1))^(1/4) - 2*e^x)/((a + 1)/
(a - 1))^(1/4))/(sqrt(2)*a^5 - sqrt(2)*a^4 - 2*sqrt(2)*a^3 + 2*sqrt(2)*a^2 + sqrt(2)*a - sqrt(2)) - 1/4*(a^4 -
 2*a^3 + 2*a - 1)^(1/4)*(4*a + 1)*log(sqrt(2)*((a + 1)/(a - 1))^(1/4)*e^x + sqrt((a + 1)/(a - 1)) + e^(2*x))/(
sqrt(2)*a^5 - sqrt(2)*a^4 - 2*sqrt(2)*a^3 + 2*sqrt(2)*a^2 + sqrt(2)*a - sqrt(2)) + 1/4*(a^4 - 2*a^3 + 2*a - 1)
^(1/4)*(4*a + 1)*log(-sqrt(2)*((a + 1)/(a - 1))^(1/4)*e^x + sqrt((a + 1)/(a - 1)) + e^(2*x))/(sqrt(2)*a^5 - sq
rt(2)*a^4 - 2*sqrt(2)*a^3 + 2*sqrt(2)*a^2 + sqrt(2)*a - sqrt(2)) + e^x/(a^2 - 2*a + 1) + e^x/((a^3 - a^2 - a +
 1)*(a*e^(4*x) + a - e^(4*x) + 1))