\(\int e^x \tanh (4 x) \, dx\) [223]

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

Optimal result

Integrand size = 8, antiderivative size = 366 \[ \int e^x \tanh (4 x) \, dx=e^x+\frac {\arctan \left (\frac {\sqrt {2-\sqrt {2}}-2 e^x}{\sqrt {2+\sqrt {2}}}\right )}{2 \sqrt {2 \left (2-\sqrt {2}\right )}}+\frac {\arctan \left (\frac {\sqrt {2+\sqrt {2}}-2 e^x}{\sqrt {2-\sqrt {2}}}\right )}{2 \sqrt {2 \left (2+\sqrt {2}\right )}}-\frac {\arctan \left (\frac {\sqrt {2-\sqrt {2}}+2 e^x}{\sqrt {2+\sqrt {2}}}\right )}{2 \sqrt {2 \left (2-\sqrt {2}\right )}}-\frac {\arctan \left (\frac {\sqrt {2+\sqrt {2}}+2 e^x}{\sqrt {2-\sqrt {2}}}\right )}{2 \sqrt {2 \left (2+\sqrt {2}\right )}}+\frac {1}{8} \sqrt {2-\sqrt {2}} \log \left (1-\sqrt {2-\sqrt {2}} e^x+e^{2 x}\right )-\frac {1}{8} \sqrt {2-\sqrt {2}} \log \left (1+\sqrt {2-\sqrt {2}} e^x+e^{2 x}\right )+\frac {1}{8} \sqrt {2+\sqrt {2}} \log \left (1-\sqrt {2+\sqrt {2}} e^x+e^{2 x}\right )-\frac {1}{8} \sqrt {2+\sqrt {2}} \log \left (1+\sqrt {2+\sqrt {2}} e^x+e^{2 x}\right ) \]

[Out]

exp(x)+1/8*ln(1+exp(2*x)-exp(x)*(2-2^(1/2))^(1/2))*(2-2^(1/2))^(1/2)-1/8*ln(1+exp(2*x)+exp(x)*(2-2^(1/2))^(1/2
))*(2-2^(1/2))^(1/2)+1/2*arctan((-2*exp(x)+(2-2^(1/2))^(1/2))/(2+2^(1/2))^(1/2))/(4-2*2^(1/2))^(1/2)-1/2*arcta
n((2*exp(x)+(2-2^(1/2))^(1/2))/(2+2^(1/2))^(1/2))/(4-2*2^(1/2))^(1/2)+1/8*ln(1+exp(2*x)-exp(x)*(2+2^(1/2))^(1/
2))*(2+2^(1/2))^(1/2)-1/8*ln(1+exp(2*x)+exp(x)*(2+2^(1/2))^(1/2))*(2+2^(1/2))^(1/2)+1/2*arctan((-2*exp(x)+(2+2
^(1/2))^(1/2))/(2-2^(1/2))^(1/2))/(4+2*2^(1/2))^(1/2)-1/2*arctan((2*exp(x)+(2+2^(1/2))^(1/2))/(2-2^(1/2))^(1/2
))/(4+2*2^(1/2))^(1/2)

Rubi [A] (verified)

Time = 0.18 (sec) , antiderivative size = 366, normalized size of antiderivative = 1.00, number of steps used = 21, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 1.000, Rules used = {2320, 396, 219, 1183, 648, 632, 210, 642} \[ \int e^x \tanh (4 x) \, dx=\frac {\arctan \left (\frac {\sqrt {2-\sqrt {2}}-2 e^x}{\sqrt {2+\sqrt {2}}}\right )}{2 \sqrt {2 \left (2-\sqrt {2}\right )}}+\frac {\arctan \left (\frac {\sqrt {2+\sqrt {2}}-2 e^x}{\sqrt {2-\sqrt {2}}}\right )}{2 \sqrt {2 \left (2+\sqrt {2}\right )}}-\frac {\arctan \left (\frac {2 e^x+\sqrt {2-\sqrt {2}}}{\sqrt {2+\sqrt {2}}}\right )}{2 \sqrt {2 \left (2-\sqrt {2}\right )}}-\frac {\arctan \left (\frac {2 e^x+\sqrt {2+\sqrt {2}}}{\sqrt {2-\sqrt {2}}}\right )}{2 \sqrt {2 \left (2+\sqrt {2}\right )}}+e^x+\frac {1}{8} \sqrt {2-\sqrt {2}} \log \left (-\sqrt {2-\sqrt {2}} e^x+e^{2 x}+1\right )-\frac {1}{8} \sqrt {2-\sqrt {2}} \log \left (\sqrt {2-\sqrt {2}} e^x+e^{2 x}+1\right )+\frac {1}{8} \sqrt {2+\sqrt {2}} \log \left (-\sqrt {2+\sqrt {2}} e^x+e^{2 x}+1\right )-\frac {1}{8} \sqrt {2+\sqrt {2}} \log \left (\sqrt {2+\sqrt {2}} e^x+e^{2 x}+1\right ) \]

[In]

Int[E^x*Tanh[4*x],x]

[Out]

E^x + ArcTan[(Sqrt[2 - Sqrt[2]] - 2*E^x)/Sqrt[2 + Sqrt[2]]]/(2*Sqrt[2*(2 - Sqrt[2])]) + ArcTan[(Sqrt[2 + Sqrt[
2]] - 2*E^x)/Sqrt[2 - Sqrt[2]]]/(2*Sqrt[2*(2 + Sqrt[2])]) - ArcTan[(Sqrt[2 - Sqrt[2]] + 2*E^x)/Sqrt[2 + Sqrt[2
]]]/(2*Sqrt[2*(2 - Sqrt[2])]) - ArcTan[(Sqrt[2 + Sqrt[2]] + 2*E^x)/Sqrt[2 - Sqrt[2]]]/(2*Sqrt[2*(2 + Sqrt[2])]
) + (Sqrt[2 - Sqrt[2]]*Log[1 - Sqrt[2 - Sqrt[2]]*E^x + E^(2*x)])/8 - (Sqrt[2 - Sqrt[2]]*Log[1 + Sqrt[2 - Sqrt[
2]]*E^x + E^(2*x)])/8 + (Sqrt[2 + Sqrt[2]]*Log[1 - Sqrt[2 + Sqrt[2]]*E^x + E^(2*x)])/8 - (Sqrt[2 + Sqrt[2]]*Lo
g[1 + Sqrt[2 + Sqrt[2]]*E^x + E^(2*x)])/8

Rule 210

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

Rule 219

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

Rule 396

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

Rule 632

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 642

Int[((d_) + (e_.)*(x_))/((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Simp[d*(Log[RemoveContent[a + b*x +
c*x^2, x]]/b), x] /; FreeQ[{a, b, c, d, e}, x] && EqQ[2*c*d - b*e, 0]

Rule 648

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

Rule 1183

Int[((d_) + (e_.)*(x_)^2)/((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4), x_Symbol] :> With[{q = Rt[a/c, 2]}, With[{r =
Rt[2*q - b/c, 2]}, Dist[1/(2*c*q*r), Int[(d*r - (d - e*q)*x)/(q - r*x + x^2), x], x] + Dist[1/(2*c*q*r), Int[(
d*r + (d - e*q)*x)/(q + r*x + x^2), x], x]]] /; FreeQ[{a, b, c, d, e}, x] && NeQ[b^2 - 4*a*c, 0] && NeQ[c*d^2
- b*d*e + a*e^2, 0] && NegQ[b^2 - 4*a*c]

Rule 2320

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

Rubi steps \begin{align*} \text {integral}& = \text {Subst}\left (\int \frac {-1+x^8}{1+x^8} \, dx,x,e^x\right ) \\ & = e^x-2 \text {Subst}\left (\int \frac {1}{1+x^8} \, dx,x,e^x\right ) \\ & = e^x-\frac {\text {Subst}\left (\int \frac {\sqrt {2}-x^2}{1-\sqrt {2} x^2+x^4} \, dx,x,e^x\right )}{\sqrt {2}}-\frac {\text {Subst}\left (\int \frac {\sqrt {2}+x^2}{1+\sqrt {2} x^2+x^4} \, dx,x,e^x\right )}{\sqrt {2}} \\ & = e^x-\frac {\text {Subst}\left (\int \frac {\sqrt {2 \left (2-\sqrt {2}\right )}-\left (-1+\sqrt {2}\right ) x}{1-\sqrt {2-\sqrt {2}} x+x^2} \, dx,x,e^x\right )}{2 \sqrt {2 \left (2-\sqrt {2}\right )}}-\frac {\text {Subst}\left (\int \frac {\sqrt {2 \left (2-\sqrt {2}\right )}+\left (-1+\sqrt {2}\right ) x}{1+\sqrt {2-\sqrt {2}} x+x^2} \, dx,x,e^x\right )}{2 \sqrt {2 \left (2-\sqrt {2}\right )}}-\frac {\text {Subst}\left (\int \frac {\sqrt {2 \left (2+\sqrt {2}\right )}-\left (1+\sqrt {2}\right ) x}{1-\sqrt {2+\sqrt {2}} x+x^2} \, dx,x,e^x\right )}{2 \sqrt {2 \left (2+\sqrt {2}\right )}}-\frac {\text {Subst}\left (\int \frac {\sqrt {2 \left (2+\sqrt {2}\right )}+\left (1+\sqrt {2}\right ) x}{1+\sqrt {2+\sqrt {2}} x+x^2} \, dx,x,e^x\right )}{2 \sqrt {2 \left (2+\sqrt {2}\right )}} \\ & = e^x-\frac {1}{4} \sqrt {\frac {1}{2} \left (3-2 \sqrt {2}\right )} \text {Subst}\left (\int \frac {1}{1-\sqrt {2+\sqrt {2}} x+x^2} \, dx,x,e^x\right )-\frac {1}{4} \sqrt {\frac {1}{2} \left (3-2 \sqrt {2}\right )} \text {Subst}\left (\int \frac {1}{1+\sqrt {2+\sqrt {2}} x+x^2} \, dx,x,e^x\right )+\frac {1}{8} \sqrt {2-\sqrt {2}} \text {Subst}\left (\int \frac {-\sqrt {2-\sqrt {2}}+2 x}{1-\sqrt {2-\sqrt {2}} x+x^2} \, dx,x,e^x\right )-\frac {1}{8} \sqrt {2-\sqrt {2}} \text {Subst}\left (\int \frac {\sqrt {2-\sqrt {2}}+2 x}{1+\sqrt {2-\sqrt {2}} x+x^2} \, dx,x,e^x\right )+\frac {1}{8} \sqrt {2+\sqrt {2}} \text {Subst}\left (\int \frac {-\sqrt {2+\sqrt {2}}+2 x}{1-\sqrt {2+\sqrt {2}} x+x^2} \, dx,x,e^x\right )-\frac {1}{8} \sqrt {2+\sqrt {2}} \text {Subst}\left (\int \frac {\sqrt {2+\sqrt {2}}+2 x}{1+\sqrt {2+\sqrt {2}} x+x^2} \, dx,x,e^x\right )-\frac {1}{4} \sqrt {\frac {1}{2} \left (3+2 \sqrt {2}\right )} \text {Subst}\left (\int \frac {1}{1-\sqrt {2-\sqrt {2}} x+x^2} \, dx,x,e^x\right )-\frac {1}{4} \sqrt {\frac {1}{2} \left (3+2 \sqrt {2}\right )} \text {Subst}\left (\int \frac {1}{1+\sqrt {2-\sqrt {2}} x+x^2} \, dx,x,e^x\right ) \\ & = e^x+\frac {1}{8} \sqrt {2-\sqrt {2}} \log \left (1-\sqrt {2-\sqrt {2}} e^x+e^{2 x}\right )-\frac {1}{8} \sqrt {2-\sqrt {2}} \log \left (1+\sqrt {2-\sqrt {2}} e^x+e^{2 x}\right )+\frac {1}{8} \sqrt {2+\sqrt {2}} \log \left (1-\sqrt {2+\sqrt {2}} e^x+e^{2 x}\right )-\frac {1}{8} \sqrt {2+\sqrt {2}} \log \left (1+\sqrt {2+\sqrt {2}} e^x+e^{2 x}\right )+\frac {1}{2} \sqrt {\frac {1}{2} \left (3-2 \sqrt {2}\right )} \text {Subst}\left (\int \frac {1}{-2+\sqrt {2}-x^2} \, dx,x,-\sqrt {2+\sqrt {2}}+2 e^x\right )+\frac {1}{2} \sqrt {\frac {1}{2} \left (3-2 \sqrt {2}\right )} \text {Subst}\left (\int \frac {1}{-2+\sqrt {2}-x^2} \, dx,x,\sqrt {2+\sqrt {2}}+2 e^x\right )+\frac {1}{2} \sqrt {\frac {1}{2} \left (3+2 \sqrt {2}\right )} \text {Subst}\left (\int \frac {1}{-2-\sqrt {2}-x^2} \, dx,x,-\sqrt {2-\sqrt {2}}+2 e^x\right )+\frac {1}{2} \sqrt {\frac {1}{2} \left (3+2 \sqrt {2}\right )} \text {Subst}\left (\int \frac {1}{-2-\sqrt {2}-x^2} \, dx,x,\sqrt {2-\sqrt {2}}+2 e^x\right ) \\ & = e^x+\frac {1}{4} \sqrt {2+\sqrt {2}} \arctan \left (\frac {\sqrt {2-\sqrt {2}}-2 e^x}{\sqrt {2+\sqrt {2}}}\right )+\frac {1}{4} \sqrt {2-\sqrt {2}} \arctan \left (\frac {\sqrt {2+\sqrt {2}}-2 e^x}{\sqrt {2-\sqrt {2}}}\right )-\frac {1}{4} \sqrt {2+\sqrt {2}} \arctan \left (\frac {\sqrt {2-\sqrt {2}}+2 e^x}{\sqrt {2+\sqrt {2}}}\right )-\frac {1}{4} \sqrt {2-\sqrt {2}} \arctan \left (\frac {\sqrt {2+\sqrt {2}}+2 e^x}{\sqrt {2-\sqrt {2}}}\right )+\frac {1}{8} \sqrt {2-\sqrt {2}} \log \left (1-\sqrt {2-\sqrt {2}} e^x+e^{2 x}\right )-\frac {1}{8} \sqrt {2-\sqrt {2}} \log \left (1+\sqrt {2-\sqrt {2}} e^x+e^{2 x}\right )+\frac {1}{8} \sqrt {2+\sqrt {2}} \log \left (1-\sqrt {2+\sqrt {2}} e^x+e^{2 x}\right )-\frac {1}{8} \sqrt {2+\sqrt {2}} \log \left (1+\sqrt {2+\sqrt {2}} e^x+e^{2 x}\right ) \\ \end{align*}

Mathematica [C] (verified)

Result contains higher order function than in optimal. Order 5 vs. order 3 in optimal.

Time = 0.02 (sec) , antiderivative size = 24, normalized size of antiderivative = 0.07 \[ \int e^x \tanh (4 x) \, dx=e^x-2 e^x \operatorname {Hypergeometric2F1}\left (\frac {1}{8},1,\frac {9}{8},-e^{8 x}\right ) \]

[In]

Integrate[E^x*Tanh[4*x],x]

[Out]

E^x - 2*E^x*Hypergeometric2F1[1/8, 1, 9/8, -E^(8*x)]

Maple [C] (verified)

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

Time = 0.16 (sec) , antiderivative size = 24, normalized size of antiderivative = 0.07

method result size
risch \({\mathrm e}^{x}+\left (\munderset {\textit {\_R} =\operatorname {RootOf}\left (65536 \textit {\_Z}^{8}+1\right )}{\sum }\textit {\_R} \ln \left ({\mathrm e}^{x}-4 \textit {\_R} \right )\right )\) \(24\)

[In]

int(exp(x)*tanh(4*x),x,method=_RETURNVERBOSE)

[Out]

exp(x)+sum(_R*ln(exp(x)-4*_R),_R=RootOf(65536*_Z^8+1))

Fricas [C] (verification not implemented)

Result contains complex when optimal does not.

Time = 0.28 (sec) , antiderivative size = 171, normalized size of antiderivative = 0.47 \[ \int e^x \tanh (4 x) \, dx=-\left (\frac {1}{8} i + \frac {1}{8}\right ) \, \sqrt {2} \left (-1\right )^{\frac {1}{8}} \log \left (\left (i + 1\right ) \, \sqrt {2} \left (-1\right )^{\frac {1}{8}} + 2 \, \cosh \left (x\right ) + 2 \, \sinh \left (x\right )\right ) + \left (\frac {1}{8} i - \frac {1}{8}\right ) \, \sqrt {2} \left (-1\right )^{\frac {1}{8}} \log \left (-\left (i - 1\right ) \, \sqrt {2} \left (-1\right )^{\frac {1}{8}} + 2 \, \cosh \left (x\right ) + 2 \, \sinh \left (x\right )\right ) - \left (\frac {1}{8} i - \frac {1}{8}\right ) \, \sqrt {2} \left (-1\right )^{\frac {1}{8}} \log \left (\left (i - 1\right ) \, \sqrt {2} \left (-1\right )^{\frac {1}{8}} + 2 \, \cosh \left (x\right ) + 2 \, \sinh \left (x\right )\right ) + \left (\frac {1}{8} i + \frac {1}{8}\right ) \, \sqrt {2} \left (-1\right )^{\frac {1}{8}} \log \left (-\left (i + 1\right ) \, \sqrt {2} \left (-1\right )^{\frac {1}{8}} + 2 \, \cosh \left (x\right ) + 2 \, \sinh \left (x\right )\right ) - \frac {1}{4} \, \left (-1\right )^{\frac {1}{8}} \log \left (\left (-1\right )^{\frac {1}{8}} + \cosh \left (x\right ) + \sinh \left (x\right )\right ) - \frac {1}{4} i \, \left (-1\right )^{\frac {1}{8}} \log \left (i \, \left (-1\right )^{\frac {1}{8}} + \cosh \left (x\right ) + \sinh \left (x\right )\right ) + \frac {1}{4} i \, \left (-1\right )^{\frac {1}{8}} \log \left (-i \, \left (-1\right )^{\frac {1}{8}} + \cosh \left (x\right ) + \sinh \left (x\right )\right ) + \frac {1}{4} \, \left (-1\right )^{\frac {1}{8}} \log \left (-\left (-1\right )^{\frac {1}{8}} + \cosh \left (x\right ) + \sinh \left (x\right )\right ) + \cosh \left (x\right ) + \sinh \left (x\right ) \]

[In]

integrate(exp(x)*tanh(4*x),x, algorithm="fricas")

[Out]

-(1/8*I + 1/8)*sqrt(2)*(-1)^(1/8)*log((I + 1)*sqrt(2)*(-1)^(1/8) + 2*cosh(x) + 2*sinh(x)) + (1/8*I - 1/8)*sqrt
(2)*(-1)^(1/8)*log(-(I - 1)*sqrt(2)*(-1)^(1/8) + 2*cosh(x) + 2*sinh(x)) - (1/8*I - 1/8)*sqrt(2)*(-1)^(1/8)*log
((I - 1)*sqrt(2)*(-1)^(1/8) + 2*cosh(x) + 2*sinh(x)) + (1/8*I + 1/8)*sqrt(2)*(-1)^(1/8)*log(-(I + 1)*sqrt(2)*(
-1)^(1/8) + 2*cosh(x) + 2*sinh(x)) - 1/4*(-1)^(1/8)*log((-1)^(1/8) + cosh(x) + sinh(x)) - 1/4*I*(-1)^(1/8)*log
(I*(-1)^(1/8) + cosh(x) + sinh(x)) + 1/4*I*(-1)^(1/8)*log(-I*(-1)^(1/8) + cosh(x) + sinh(x)) + 1/4*(-1)^(1/8)*
log(-(-1)^(1/8) + cosh(x) + sinh(x)) + cosh(x) + sinh(x)

Sympy [F]

\[ \int e^x \tanh (4 x) \, dx=\int e^{x} \tanh {\left (4 x \right )}\, dx \]

[In]

integrate(exp(x)*tanh(4*x),x)

[Out]

Integral(exp(x)*tanh(4*x), x)

Maxima [F]

\[ \int e^x \tanh (4 x) \, dx=\int { e^{x} \tanh \left (4 \, x\right ) \,d x } \]

[In]

integrate(exp(x)*tanh(4*x),x, algorithm="maxima")

[Out]

e^x - 2*integrate(e^x/(e^(8*x) + 1), x)

Giac [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 251, normalized size of antiderivative = 0.69 \[ \int e^x \tanh (4 x) \, dx=-\frac {1}{4} \, \sqrt {-\sqrt {2} + 2} \arctan \left (\frac {\sqrt {\sqrt {2} + 2} + 2 \, e^{x}}{\sqrt {-\sqrt {2} + 2}}\right ) - \frac {1}{4} \, \sqrt {-\sqrt {2} + 2} \arctan \left (-\frac {\sqrt {\sqrt {2} + 2} - 2 \, e^{x}}{\sqrt {-\sqrt {2} + 2}}\right ) - \frac {1}{4} \, \sqrt {\sqrt {2} + 2} \arctan \left (\frac {\sqrt {-\sqrt {2} + 2} + 2 \, e^{x}}{\sqrt {\sqrt {2} + 2}}\right ) - \frac {1}{4} \, \sqrt {\sqrt {2} + 2} \arctan \left (-\frac {\sqrt {-\sqrt {2} + 2} - 2 \, e^{x}}{\sqrt {\sqrt {2} + 2}}\right ) - \frac {1}{8} \, \sqrt {\sqrt {2} + 2} \log \left (\sqrt {\sqrt {2} + 2} e^{x} + e^{\left (2 \, x\right )} + 1\right ) + \frac {1}{8} \, \sqrt {\sqrt {2} + 2} \log \left (-\sqrt {\sqrt {2} + 2} e^{x} + e^{\left (2 \, x\right )} + 1\right ) - \frac {1}{8} \, \sqrt {-\sqrt {2} + 2} \log \left (\sqrt {-\sqrt {2} + 2} e^{x} + e^{\left (2 \, x\right )} + 1\right ) + \frac {1}{8} \, \sqrt {-\sqrt {2} + 2} \log \left (-\sqrt {-\sqrt {2} + 2} e^{x} + e^{\left (2 \, x\right )} + 1\right ) + e^{x} \]

[In]

integrate(exp(x)*tanh(4*x),x, algorithm="giac")

[Out]

-1/4*sqrt(-sqrt(2) + 2)*arctan((sqrt(sqrt(2) + 2) + 2*e^x)/sqrt(-sqrt(2) + 2)) - 1/4*sqrt(-sqrt(2) + 2)*arctan
(-(sqrt(sqrt(2) + 2) - 2*e^x)/sqrt(-sqrt(2) + 2)) - 1/4*sqrt(sqrt(2) + 2)*arctan((sqrt(-sqrt(2) + 2) + 2*e^x)/
sqrt(sqrt(2) + 2)) - 1/4*sqrt(sqrt(2) + 2)*arctan(-(sqrt(-sqrt(2) + 2) - 2*e^x)/sqrt(sqrt(2) + 2)) - 1/8*sqrt(
sqrt(2) + 2)*log(sqrt(sqrt(2) + 2)*e^x + e^(2*x) + 1) + 1/8*sqrt(sqrt(2) + 2)*log(-sqrt(sqrt(2) + 2)*e^x + e^(
2*x) + 1) - 1/8*sqrt(-sqrt(2) + 2)*log(sqrt(-sqrt(2) + 2)*e^x + e^(2*x) + 1) + 1/8*sqrt(-sqrt(2) + 2)*log(-sqr
t(-sqrt(2) + 2)*e^x + e^(2*x) + 1) + e^x

Mupad [B] (verification not implemented)

Time = 4.22 (sec) , antiderivative size = 457, normalized size of antiderivative = 1.25 \[ \int e^x \tanh (4 x) \, dx={\mathrm {e}}^x-\ln \left (2\,{\mathrm {e}}^x+\sqrt {\sqrt {2}+2}+\sqrt {2-\sqrt {2}}\,1{}\mathrm {i}\right )\,\left (\frac {\sqrt {\sqrt {2}+2}}{8}+\frac {\sqrt {2-\sqrt {2}}\,1{}\mathrm {i}}{8}\right )+\ln \left (2\,{\mathrm {e}}^x+\sqrt {2-\sqrt {2}}-\sqrt {\sqrt {2}+2}\,1{}\mathrm {i}\right )\,\left (-\frac {\sqrt {2-\sqrt {2}}}{8}+\frac {\sqrt {\sqrt {2}+2}\,1{}\mathrm {i}}{8}\right )+\ln \left (2\,{\mathrm {e}}^x-\sqrt {\sqrt {2}+2}-\sqrt {2-\sqrt {2}}\,1{}\mathrm {i}\right )\,\left (\frac {\sqrt {\sqrt {2}+2}}{8}+\frac {\sqrt {2-\sqrt {2}}\,1{}\mathrm {i}}{8}\right )-\ln \left (2\,{\mathrm {e}}^x-\sqrt {2-\sqrt {2}}+\sqrt {\sqrt {2}+2}\,1{}\mathrm {i}\right )\,\left (-\frac {\sqrt {2-\sqrt {2}}}{8}+\frac {\sqrt {\sqrt {2}+2}\,1{}\mathrm {i}}{8}\right )+\sqrt {2}\,\ln \left (2\,{\mathrm {e}}^x+\sqrt {2}\,\left (\frac {\sqrt {\sqrt {2}+2}}{8}+\frac {\sqrt {2-\sqrt {2}}\,1{}\mathrm {i}}{8}\right )\,\left (-4-4{}\mathrm {i}\right )\right )\,\left (\frac {\sqrt {\sqrt {2}+2}}{8}+\frac {\sqrt {2-\sqrt {2}}\,1{}\mathrm {i}}{8}\right )\,\left (\frac {1}{2}+\frac {1}{2}{}\mathrm {i}\right )+\sqrt {2}\,\ln \left (2\,{\mathrm {e}}^x+\sqrt {2}\,\left (\frac {\sqrt {\sqrt {2}+2}}{8}+\frac {\sqrt {2-\sqrt {2}}\,1{}\mathrm {i}}{8}\right )\,\left (-4+4{}\mathrm {i}\right )\right )\,\left (\frac {\sqrt {\sqrt {2}+2}}{8}+\frac {\sqrt {2-\sqrt {2}}\,1{}\mathrm {i}}{8}\right )\,\left (\frac {1}{2}-\frac {1}{2}{}\mathrm {i}\right )+\sqrt {2}\,\ln \left (2\,{\mathrm {e}}^x+\sqrt {2}\,\left (\frac {\sqrt {\sqrt {2}+2}}{8}+\frac {\sqrt {2-\sqrt {2}}\,1{}\mathrm {i}}{8}\right )\,\left (4-4{}\mathrm {i}\right )\right )\,\left (\frac {\sqrt {\sqrt {2}+2}}{8}+\frac {\sqrt {2-\sqrt {2}}\,1{}\mathrm {i}}{8}\right )\,\left (-\frac {1}{2}+\frac {1}{2}{}\mathrm {i}\right )+\sqrt {2}\,\ln \left (2\,{\mathrm {e}}^x+\sqrt {2}\,\left (\frac {\sqrt {\sqrt {2}+2}}{8}+\frac {\sqrt {2-\sqrt {2}}\,1{}\mathrm {i}}{8}\right )\,\left (4+4{}\mathrm {i}\right )\right )\,\left (\frac {\sqrt {\sqrt {2}+2}}{8}+\frac {\sqrt {2-\sqrt {2}}\,1{}\mathrm {i}}{8}\right )\,\left (-\frac {1}{2}-\frac {1}{2}{}\mathrm {i}\right ) \]

[In]

int(tanh(4*x)*exp(x),x)

[Out]

exp(x) - log(2*exp(x) + (2^(1/2) + 2)^(1/2) + (2 - 2^(1/2))^(1/2)*1i)*((2^(1/2) + 2)^(1/2)/8 + ((2 - 2^(1/2))^
(1/2)*1i)/8) + log(2*exp(x) - (2^(1/2) + 2)^(1/2)*1i + (2 - 2^(1/2))^(1/2))*(((2^(1/2) + 2)^(1/2)*1i)/8 - (2 -
 2^(1/2))^(1/2)/8) + log(2*exp(x) - (2^(1/2) + 2)^(1/2) - (2 - 2^(1/2))^(1/2)*1i)*((2^(1/2) + 2)^(1/2)/8 + ((2
 - 2^(1/2))^(1/2)*1i)/8) - log(2*exp(x) + (2^(1/2) + 2)^(1/2)*1i - (2 - 2^(1/2))^(1/2))*(((2^(1/2) + 2)^(1/2)*
1i)/8 - (2 - 2^(1/2))^(1/2)/8) + 2^(1/2)*log(2*exp(x) - 2^(1/2)*((2^(1/2) + 2)^(1/2)/8 + ((2 - 2^(1/2))^(1/2)*
1i)/8)*(4 + 4i))*((2^(1/2) + 2)^(1/2)/8 + ((2 - 2^(1/2))^(1/2)*1i)/8)*(1/2 + 1i/2) + 2^(1/2)*log(2*exp(x) - 2^
(1/2)*((2^(1/2) + 2)^(1/2)/8 + ((2 - 2^(1/2))^(1/2)*1i)/8)*(4 - 4i))*((2^(1/2) + 2)^(1/2)/8 + ((2 - 2^(1/2))^(
1/2)*1i)/8)*(1/2 - 1i/2) - 2^(1/2)*log(2*exp(x) + 2^(1/2)*((2^(1/2) + 2)^(1/2)/8 + ((2 - 2^(1/2))^(1/2)*1i)/8)
*(4 - 4i))*((2^(1/2) + 2)^(1/2)/8 + ((2 - 2^(1/2))^(1/2)*1i)/8)*(1/2 - 1i/2) - 2^(1/2)*log(2*exp(x) + 2^(1/2)*
((2^(1/2) + 2)^(1/2)/8 + ((2 - 2^(1/2))^(1/2)*1i)/8)*(4 + 4i))*((2^(1/2) + 2)^(1/2)/8 + ((2 - 2^(1/2))^(1/2)*1
i)/8)*(1/2 + 1i/2)