Integrand size = 10, antiderivative size = 88 \[ \int e^x \tanh ^2(3 x) \, dx=e^x+\frac {2 e^x}{3 \left (1+e^{6 x}\right )}-\frac {2 \arctan \left (e^x\right )}{9}+\frac {1}{9} \arctan \left (\sqrt {3}-2 e^x\right )-\frac {1}{9} \arctan \left (\sqrt {3}+2 e^x\right )-\frac {\text {arctanh}\left (\frac {\sqrt {3} e^x}{1+e^{2 x}}\right )}{3 \sqrt {3}} \] Output:
exp(x)+2*exp(x)/(3+3*exp(6*x))-2/9*arctan(exp(x))-1/9*arctan(-3^(1/2)+2*ex p(x))-1/9*arctan(3^(1/2)+2*exp(x))-1/9*arctanh(3^(1/2)*exp(x)/(1+exp(2*x)) )*3^(1/2)
Result contains higher order function than in optimal. Order 9 vs. order 3 in optimal.
Time = 0.07 (sec) , antiderivative size = 97, normalized size of antiderivative = 1.10 \[ \int e^x \tanh ^2(3 x) \, dx=e^x+\frac {2 e^x}{3 \left (1+e^{6 x}\right )}-\frac {2 \arctan \left (e^x\right )}{9}-\frac {1}{9} \text {RootSum}\left [1-\text {$\#$1}^2+\text {$\#$1}^4\&,\frac {-2 x+2 \log \left (e^x-\text {$\#$1}\right )+x \text {$\#$1}^2-\log \left (e^x-\text {$\#$1}\right ) \text {$\#$1}^2}{-\text {$\#$1}+2 \text {$\#$1}^3}\&\right ] \] Input:
Integrate[E^x*Tanh[3*x]^2,x]
Output:
E^x + (2*E^x)/(3*(1 + E^(6*x))) - (2*ArcTan[E^x])/9 - RootSum[1 - #1^2 + # 1^4 & , (-2*x + 2*Log[E^x - #1] + x*#1^2 - Log[E^x - #1]*#1^2)/(-#1 + 2*#1 ^3) & ]/9
Time = 0.41 (sec) , antiderivative size = 113, normalized size of antiderivative = 1.28, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.300, Rules used = {2720, 915, 2009}
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^x \tanh ^2(3 x) \, dx\) |
\(\Big \downarrow \) 2720 |
\(\displaystyle \int \frac {\left (1-e^{6 x}\right )^2}{\left (e^{6 x}+1\right )^2}de^x\) |
\(\Big \downarrow \) 915 |
\(\displaystyle \int \left (1-\frac {4 e^{6 x}}{\left (e^{6 x}+1\right )^2}\right )de^x\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle -\frac {2}{9} \arctan \left (e^x\right )+\frac {1}{9} \arctan \left (\sqrt {3}-2 e^x\right )-\frac {1}{9} \arctan \left (2 e^x+\sqrt {3}\right )+e^x+\frac {2 e^x}{3 \left (e^{6 x}+1\right )}+\frac {\log \left (-\sqrt {3} e^x+e^{2 x}+1\right )}{6 \sqrt {3}}-\frac {\log \left (\sqrt {3} e^x+e^{2 x}+1\right )}{6 \sqrt {3}}\) |
Input:
Int[E^x*Tanh[3*x]^2,x]
Output:
E^x + (2*E^x)/(3*(1 + E^(6*x))) - (2*ArcTan[E^x])/9 + ArcTan[Sqrt[3] - 2*E ^x]/9 - ArcTan[Sqrt[3] + 2*E^x]/9 + Log[1 - Sqrt[3]*E^x + E^(2*x)]/(6*Sqrt [3]) - Log[1 + Sqrt[3]*E^x + E^(2*x)]/(6*Sqrt[3])
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] && ILtQ[q, 0] && GeQ[p, -q]
Int[u_, x_Symbol] :> With[{v = FunctionOfExponential[u, x]}, Simp[v/D[v, x] Subst[Int[FunctionOfExponentialFunction[u, x]/x, x], x, v], x]] /; Funct ionOfExponentialQ[u, x] && !MatchQ[u, (w_)*((a_.)*(v_)^(n_))^(m_) /; FreeQ [{a, m, n}, x] && IntegerQ[m*n]] && !MatchQ[u, E^((c_.)*((a_.) + (b_.)*x)) *(F_)[v_] /; FreeQ[{a, b, c}, x] && InverseFunctionQ[F[x]]]
Result contains higher order function than in optimal. Order 9 vs. order 3.
Time = 0.63 (sec) , antiderivative size = 59, normalized size of antiderivative = 0.67
method | result | size |
risch | \({\mathrm e}^{x}+\frac {2 \,{\mathrm e}^{x}}{3 \left ({\mathrm e}^{6 x}+1\right )}+\left (\munderset {\textit {\_R} =\operatorname {RootOf}\left (6561 \textit {\_Z}^{4}-81 \textit {\_Z}^{2}+1\right )}{\sum }\textit {\_R} \ln \left ({\mathrm e}^{x}-9 \textit {\_R} \right )\right )+\frac {i \ln \left ({\mathrm e}^{x}-i\right )}{9}-\frac {i \ln \left ({\mathrm e}^{x}+i\right )}{9}\) | \(59\) |
Input:
int(exp(x)*tanh(3*x)^2,x,method=_RETURNVERBOSE)
Output:
exp(x)+2/3*exp(x)/(exp(6*x)+1)+sum(_R*ln(exp(x)-9*_R),_R=RootOf(6561*_Z^4- 81*_Z^2+1))+1/9*I*ln(exp(x)-I)-1/9*I*ln(exp(x)+I)
Leaf count of result is larger than twice the leaf count of optimal. 549 vs. \(2 (64) = 128\).
Time = 0.09 (sec) , antiderivative size = 549, normalized size of antiderivative = 6.24 \[ \int e^x \tanh ^2(3 x) \, dx=\text {Too large to display} \] Input:
integrate(exp(x)*tanh(3*x)^2,x, algorithm="fricas")
Output:
1/18*(18*cosh(x)^7 + 378*cosh(x)^5*sinh(x)^2 + 630*cosh(x)^4*sinh(x)^3 + 6 30*cosh(x)^3*sinh(x)^4 + 378*cosh(x)^2*sinh(x)^5 + 126*cosh(x)*sinh(x)^6 + 18*sinh(x)^7 - 2*(cosh(x)^6 + 6*cosh(x)^5*sinh(x) + 15*cosh(x)^4*sinh(x)^ 2 + 20*cosh(x)^3*sinh(x)^3 + 15*cosh(x)^2*sinh(x)^4 + 6*cosh(x)*sinh(x)^5 + sinh(x)^6 + 1)*arctan(sqrt(3) + 2*cosh(x) + 2*sinh(x)) - 2*(cosh(x)^6 + 6*cosh(x)^5*sinh(x) + 15*cosh(x)^4*sinh(x)^2 + 20*cosh(x)^3*sinh(x)^3 + 15 *cosh(x)^2*sinh(x)^4 + 6*cosh(x)*sinh(x)^5 + sinh(x)^6 + 1)*arctan(-sqrt(3 ) + 2*cosh(x) + 2*sinh(x)) - 4*(cosh(x)^6 + 6*cosh(x)^5*sinh(x) + 15*cosh( x)^4*sinh(x)^2 + 20*cosh(x)^3*sinh(x)^3 + 15*cosh(x)^2*sinh(x)^4 + 6*cosh( x)*sinh(x)^5 + sinh(x)^6 + 1)*arctan(cosh(x) + sinh(x)) - (sqrt(3)*cosh(x) ^6 + 6*sqrt(3)*cosh(x)^5*sinh(x) + 15*sqrt(3)*cosh(x)^4*sinh(x)^2 + 20*sqr t(3)*cosh(x)^3*sinh(x)^3 + 15*sqrt(3)*cosh(x)^2*sinh(x)^4 + 6*sqrt(3)*cosh (x)*sinh(x)^5 + sqrt(3)*sinh(x)^6 + sqrt(3))*log((sqrt(3) + 2*cosh(x))/(co sh(x) - sinh(x))) + (sqrt(3)*cosh(x)^6 + 6*sqrt(3)*cosh(x)^5*sinh(x) + 15* sqrt(3)*cosh(x)^4*sinh(x)^2 + 20*sqrt(3)*cosh(x)^3*sinh(x)^3 + 15*sqrt(3)* cosh(x)^2*sinh(x)^4 + 6*sqrt(3)*cosh(x)*sinh(x)^5 + sqrt(3)*sinh(x)^6 + sq rt(3))*log(-(sqrt(3) - 2*cosh(x))/(cosh(x) - sinh(x))) + 6*(21*cosh(x)^6 + 5)*sinh(x) + 30*cosh(x))/(cosh(x)^6 + 6*cosh(x)^5*sinh(x) + 15*cosh(x)^4* sinh(x)^2 + 20*cosh(x)^3*sinh(x)^3 + 15*cosh(x)^2*sinh(x)^4 + 6*cosh(x)*si nh(x)^5 + sinh(x)^6 + 1)
\[ \int e^x \tanh ^2(3 x) \, dx=\int e^{x} \tanh ^{2}{\left (3 x \right )}\, dx \] Input:
integrate(exp(x)*tanh(3*x)**2,x)
Output:
Integral(exp(x)*tanh(3*x)**2, x)
Time = 0.11 (sec) , antiderivative size = 81, normalized size of antiderivative = 0.92 \[ \int e^x \tanh ^2(3 x) \, dx=-\frac {1}{18} \, \sqrt {3} \log \left (\sqrt {3} e^{x} + e^{\left (2 \, x\right )} + 1\right ) + \frac {1}{18} \, \sqrt {3} \log \left (-\sqrt {3} e^{x} + e^{\left (2 \, x\right )} + 1\right ) + \frac {2 \, e^{x}}{3 \, {\left (e^{\left (6 \, x\right )} + 1\right )}} - \frac {1}{9} \, \arctan \left (\sqrt {3} + 2 \, e^{x}\right ) - \frac {1}{9} \, \arctan \left (-\sqrt {3} + 2 \, e^{x}\right ) - \frac {2}{9} \, \arctan \left (e^{x}\right ) + e^{x} \] Input:
integrate(exp(x)*tanh(3*x)^2,x, algorithm="maxima")
Output:
-1/18*sqrt(3)*log(sqrt(3)*e^x + e^(2*x) + 1) + 1/18*sqrt(3)*log(-sqrt(3)*e ^x + e^(2*x) + 1) + 2/3*e^x/(e^(6*x) + 1) - 1/9*arctan(sqrt(3) + 2*e^x) - 1/9*arctan(-sqrt(3) + 2*e^x) - 2/9*arctan(e^x) + e^x
Time = 0.11 (sec) , antiderivative size = 81, normalized size of antiderivative = 0.92 \[ \int e^x \tanh ^2(3 x) \, dx=-\frac {1}{18} \, \sqrt {3} \log \left (\sqrt {3} e^{x} + e^{\left (2 \, x\right )} + 1\right ) + \frac {1}{18} \, \sqrt {3} \log \left (-\sqrt {3} e^{x} + e^{\left (2 \, x\right )} + 1\right ) + \frac {2 \, e^{x}}{3 \, {\left (e^{\left (6 \, x\right )} + 1\right )}} - \frac {1}{9} \, \arctan \left (\sqrt {3} + 2 \, e^{x}\right ) - \frac {1}{9} \, \arctan \left (-\sqrt {3} + 2 \, e^{x}\right ) - \frac {2}{9} \, \arctan \left (e^{x}\right ) + e^{x} \] Input:
integrate(exp(x)*tanh(3*x)^2,x, algorithm="giac")
Output:
-1/18*sqrt(3)*log(sqrt(3)*e^x + e^(2*x) + 1) + 1/18*sqrt(3)*log(-sqrt(3)*e ^x + e^(2*x) + 1) + 2/3*e^x/(e^(6*x) + 1) - 1/9*arctan(sqrt(3) + 2*e^x) - 1/9*arctan(-sqrt(3) + 2*e^x) - 2/9*arctan(e^x) + e^x
Time = 0.33 (sec) , antiderivative size = 86, normalized size of antiderivative = 0.98 \[ \int e^x \tanh ^2(3 x) \, dx={\mathrm {e}}^x-\frac {\mathrm {atan}\left (2\,{\mathrm {e}}^x+\sqrt {3}\right )}{9}-\frac {\mathrm {atan}\left (2\,{\mathrm {e}}^x-\sqrt {3}\right )}{9}-\frac {2\,\mathrm {atan}\left ({\mathrm {e}}^x\right )}{9}+\frac {2\,{\mathrm {e}}^x}{3\,\left ({\mathrm {e}}^{6\,x}+1\right )}+\frac {\sqrt {3}\,\ln \left ({\left (\frac {2\,{\mathrm {e}}^x}{3}-\frac {\sqrt {3}}{3}\right )}^2+\frac {1}{9}\right )}{18}-\frac {\sqrt {3}\,\ln \left ({\left (\frac {2\,{\mathrm {e}}^x}{3}+\frac {\sqrt {3}}{3}\right )}^2+\frac {1}{9}\right )}{18} \] Input:
int(tanh(3*x)^2*exp(x),x)
Output:
exp(x) - atan(2*exp(x) + 3^(1/2))/9 - atan(2*exp(x) - 3^(1/2))/9 - (2*atan (exp(x)))/9 + (2*exp(x))/(3*(exp(6*x) + 1)) + (3^(1/2)*log(((2*exp(x))/3 - 3^(1/2)/3)^2 + 1/9))/18 - (3^(1/2)*log(((2*exp(x))/3 + 3^(1/2)/3)^2 + 1/9 ))/18
Time = 0.26 (sec) , antiderivative size = 182, normalized size of antiderivative = 2.07 \[ \int e^x \tanh ^2(3 x) \, dx=\frac {-4 e^{6 x} \mathit {atan} \left (e^{x}\right )-4 \mathit {atan} \left (e^{x}\right )-2 e^{6 x} \mathit {atan} \left (2 e^{x}-\sqrt {3}\right )-2 \mathit {atan} \left (2 e^{x}-\sqrt {3}\right )-2 e^{6 x} \mathit {atan} \left (2 e^{x}+\sqrt {3}\right )-2 \mathit {atan} \left (2 e^{x}+\sqrt {3}\right )+18 e^{7 x}+e^{6 x} \sqrt {3}\, \mathrm {log}\left (e^{2 x}-e^{x} \sqrt {3}+1\right )-e^{6 x} \sqrt {3}\, \mathrm {log}\left (e^{2 x}+e^{x} \sqrt {3}+1\right )+30 e^{x}+\sqrt {3}\, \mathrm {log}\left (e^{2 x}-e^{x} \sqrt {3}+1\right )-\sqrt {3}\, \mathrm {log}\left (e^{2 x}+e^{x} \sqrt {3}+1\right )}{18 e^{6 x}+18} \] Input:
int(exp(x)*tanh(3*x)^2,x)
Output:
( - 4*e**(6*x)*atan(e**x) - 4*atan(e**x) - 2*e**(6*x)*atan(2*e**x - sqrt(3 )) - 2*atan(2*e**x - sqrt(3)) - 2*e**(6*x)*atan(2*e**x + sqrt(3)) - 2*atan (2*e**x + sqrt(3)) + 18*e**(7*x) + e**(6*x)*sqrt(3)*log(e**(2*x) - e**x*sq rt(3) + 1) - e**(6*x)*sqrt(3)*log(e**(2*x) + e**x*sqrt(3) + 1) + 30*e**x + sqrt(3)*log(e**(2*x) - e**x*sqrt(3) + 1) - sqrt(3)*log(e**(2*x) + e**x*sq rt(3) + 1))/(18*(e**(6*x) + 1))