Integrand size = 8, antiderivative size = 70 \[ \int e^x \tanh (3 x) \, dx=e^x-\frac {2 \arctan \left (e^x\right )}{3}+\frac {1}{3} \arctan \left (\sqrt {3}-2 e^x\right )-\frac {1}{3} \arctan \left (\sqrt {3}+2 e^x\right )-\frac {\text {arctanh}\left (\frac {\sqrt {3} e^x}{1+e^{2 x}}\right )}{\sqrt {3}} \] Output:
exp(x)-2/3*arctan(exp(x))-1/3*arctan(-3^(1/2)+2*exp(x))-1/3*arctan(3^(1/2) +2*exp(x))-1/3*arctanh(3^(1/2)*exp(x)/(1+exp(2*x)))*3^(1/2)
Result contains higher order function than in optimal. Order 5 vs. order 3 in optimal.
Time = 0.01 (sec) , antiderivative size = 24, normalized size of antiderivative = 0.34 \[ \int e^x \tanh (3 x) \, dx=e^x-2 e^x \operatorname {Hypergeometric2F1}\left (\frac {1}{6},1,\frac {7}{6},-e^{6 x}\right ) \] Input:
Integrate[E^x*Tanh[3*x],x]
Output:
E^x - 2*E^x*Hypergeometric2F1[1/6, 1, 7/6, -E^(6*x)]
Time = 0.33 (sec) , antiderivative size = 104, normalized size of antiderivative = 1.49, number of steps used = 12, number of rules used = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 1.375, Rules used = {2720, 25, 913, 753, 27, 216, 1142, 25, 1083, 217, 1103}
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 (3 x) \, dx\) |
\(\Big \downarrow \) 2720 |
\(\displaystyle \int -\frac {1-e^{6 x}}{e^{6 x}+1}de^x\) |
\(\Big \downarrow \) 25 |
\(\displaystyle -\int \frac {1-e^{6 x}}{1+e^{6 x}}de^x\) |
\(\Big \downarrow \) 913 |
\(\displaystyle e^x-2 \int \frac {1}{1+e^{6 x}}de^x\) |
\(\Big \downarrow \) 753 |
\(\displaystyle e^x-2 \left (\frac {1}{3} \int \frac {1}{1+e^{2 x}}de^x+\frac {1}{3} \int \frac {2-\sqrt {3} e^x}{2 \left (1-\sqrt {3} e^x+e^{2 x}\right )}de^x+\frac {1}{3} \int \frac {2+\sqrt {3} e^x}{2 \left (1+\sqrt {3} e^x+e^{2 x}\right )}de^x\right )\) |
\(\Big \downarrow \) 27 |
\(\displaystyle e^x-2 \left (\frac {1}{3} \int \frac {1}{1+e^{2 x}}de^x+\frac {1}{6} \int \frac {2-\sqrt {3} e^x}{1-\sqrt {3} e^x+e^{2 x}}de^x+\frac {1}{6} \int \frac {2+\sqrt {3} e^x}{1+\sqrt {3} e^x+e^{2 x}}de^x\right )\) |
\(\Big \downarrow \) 216 |
\(\displaystyle e^x-2 \left (\frac {1}{6} \int \frac {2-\sqrt {3} e^x}{1-\sqrt {3} e^x+e^{2 x}}de^x+\frac {1}{6} \int \frac {2+\sqrt {3} e^x}{1+\sqrt {3} e^x+e^{2 x}}de^x+\frac {\arctan \left (e^x\right )}{3}\right )\) |
\(\Big \downarrow \) 1142 |
\(\displaystyle e^x-2 \left (\frac {1}{6} \left (\frac {1}{2} \int \frac {1}{1-\sqrt {3} e^x+e^{2 x}}de^x-\frac {1}{2} \sqrt {3} \int -\frac {\sqrt {3}-2 e^x}{1-\sqrt {3} e^x+e^{2 x}}de^x\right )+\frac {1}{6} \left (\frac {1}{2} \int \frac {1}{1+\sqrt {3} e^x+e^{2 x}}de^x+\frac {1}{2} \sqrt {3} \int \frac {\sqrt {3}+2 e^x}{1+\sqrt {3} e^x+e^{2 x}}de^x\right )+\frac {\arctan \left (e^x\right )}{3}\right )\) |
\(\Big \downarrow \) 25 |
\(\displaystyle e^x-2 \left (\frac {1}{6} \left (\frac {1}{2} \int \frac {1}{1-\sqrt {3} e^x+e^{2 x}}de^x+\frac {1}{2} \sqrt {3} \int \frac {\sqrt {3}-2 e^x}{1-\sqrt {3} e^x+e^{2 x}}de^x\right )+\frac {1}{6} \left (\frac {1}{2} \int \frac {1}{1+\sqrt {3} e^x+e^{2 x}}de^x+\frac {1}{2} \sqrt {3} \int \frac {\sqrt {3}+2 e^x}{1+\sqrt {3} e^x+e^{2 x}}de^x\right )+\frac {\arctan \left (e^x\right )}{3}\right )\) |
\(\Big \downarrow \) 1083 |
\(\displaystyle e^x-2 \left (\frac {1}{6} \left (\frac {1}{2} \sqrt {3} \int \frac {\sqrt {3}-2 e^x}{1-\sqrt {3} e^x+e^{2 x}}de^x-\int \frac {1}{-1-e^{2 x}}d\left (-\sqrt {3}+2 e^x\right )\right )+\frac {1}{6} \left (\frac {1}{2} \sqrt {3} \int \frac {\sqrt {3}+2 e^x}{1+\sqrt {3} e^x+e^{2 x}}de^x-\int \frac {1}{-1-e^{2 x}}d\left (\sqrt {3}+2 e^x\right )\right )+\frac {\arctan \left (e^x\right )}{3}\right )\) |
\(\Big \downarrow \) 217 |
\(\displaystyle e^x-2 \left (\frac {1}{6} \left (\frac {1}{2} \sqrt {3} \int \frac {\sqrt {3}-2 e^x}{1-\sqrt {3} e^x+e^{2 x}}de^x-\arctan \left (\sqrt {3}-2 e^x\right )\right )+\frac {1}{6} \left (\frac {1}{2} \sqrt {3} \int \frac {\sqrt {3}+2 e^x}{1+\sqrt {3} e^x+e^{2 x}}de^x+\arctan \left (2 e^x+\sqrt {3}\right )\right )+\frac {\arctan \left (e^x\right )}{3}\right )\) |
\(\Big \downarrow \) 1103 |
\(\displaystyle e^x-2 \left (\frac {\arctan \left (e^x\right )}{3}+\frac {1}{6} \left (-\arctan \left (\sqrt {3}-2 e^x\right )-\frac {1}{2} \sqrt {3} \log \left (-\sqrt {3} e^x+e^{2 x}+1\right )\right )+\frac {1}{6} \left (\arctan \left (2 e^x+\sqrt {3}\right )+\frac {1}{2} \sqrt {3} \log \left (\sqrt {3} e^x+e^{2 x}+1\right )\right )\right )\) |
Input:
Int[E^x*Tanh[3*x],x]
Output:
E^x - 2*(ArcTan[E^x]/3 + (-ArcTan[Sqrt[3] - 2*E^x] - (Sqrt[3]*Log[1 - Sqrt [3]*E^x + E^(2*x)])/2)/6 + (ArcTan[Sqrt[3] + 2*E^x] + (Sqrt[3]*Log[1 + Sqr t[3]*E^x + E^(2*x)])/2)/6)
Int[(a_)*(Fx_), x_Symbol] :> Simp[a Int[Fx, x], x] /; FreeQ[a, x] && !Ma tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*A rcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a , 0] || GtQ[b, 0])
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])
Int[((a_) + (b_.)*(x_)^(n_))^(-1), x_Symbol] :> Module[{r = Numerator[Rt[a/ b, n]], s = Denominator[Rt[a/b, n]], k, u, v}, Simp[u = Int[(r - s*Cos[(2*k - 1)*(Pi/n)]*x)/(r^2 - 2*r*s*Cos[(2*k - 1)*(Pi/n)]*x + s^2*x^2), x] + Int[ (r + s*Cos[(2*k - 1)*(Pi/n)]*x)/(r^2 + 2*r*s*Cos[(2*k - 1)*(Pi/n)]*x + s^2* x^2), x]; 2*(r^2/(a*n)) Int[1/(r^2 + s^2*x^2), x] + 2*(r/(a*n)) Sum[u, {k, 1, (n - 2)/4}], x]] /; FreeQ[{a, b}, x] && IGtQ[(n - 2)/4, 0] && PosQ[a /b]
Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Si mp[d*x*((a + b*x^n)^(p + 1)/(b*(n*(p + 1) + 1))), x] - Simp[(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, p}, x] && NeQ[b*c - a*d, 0] && NeQ[n*(p + 1) + 1, 0]
Int[((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> Simp[-2 Subst[I nt[1/Simp[b^2 - 4*a*c - x^2, x], x], x, b + 2*c*x], x] /; FreeQ[{a, b, c}, x]
Int[((d_) + (e_.)*(x_))/((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> S imp[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]
Int[((d_.) + (e_.)*(x_))/((a_) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> S imp[(2*c*d - b*e)/(2*c) Int[1/(a + b*x + c*x^2), x], x] + Simp[e/(2*c) Int[(b + 2*c*x)/(a + b*x + c*x^2), x], x] /; FreeQ[{a, b, c, d, e}, x]
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.55 (sec) , antiderivative size = 47, normalized size of antiderivative = 0.67
method | result | size |
risch | \({\mathrm e}^{x}+\left (\munderset {\textit {\_R} =\operatorname {RootOf}\left (81 \textit {\_Z}^{4}-9 \textit {\_Z}^{2}+1\right )}{\sum }\textit {\_R} \ln \left ({\mathrm e}^{x}-3 \textit {\_R} \right )\right )+\frac {i \ln \left ({\mathrm e}^{x}-i\right )}{3}-\frac {i \ln \left ({\mathrm e}^{x}+i\right )}{3}\) | \(47\) |
Input:
int(exp(x)*tanh(3*x),x,method=_RETURNVERBOSE)
Output:
exp(x)+sum(_R*ln(exp(x)-3*_R),_R=RootOf(81*_Z^4-9*_Z^2+1))+1/3*I*ln(exp(x) -I)-1/3*I*ln(exp(x)+I)
Time = 0.10 (sec) , antiderivative size = 94, normalized size of antiderivative = 1.34 \[ \int e^x \tanh (3 x) \, dx=-\frac {1}{6} \, \sqrt {3} \log \left (\frac {\sqrt {3} + 2 \, \cosh \left (x\right )}{\cosh \left (x\right ) - \sinh \left (x\right )}\right ) + \frac {1}{6} \, \sqrt {3} \log \left (-\frac {\sqrt {3} - 2 \, \cosh \left (x\right )}{\cosh \left (x\right ) - \sinh \left (x\right )}\right ) - \frac {1}{3} \, \arctan \left (\sqrt {3} + 2 \, \cosh \left (x\right ) + 2 \, \sinh \left (x\right )\right ) - \frac {1}{3} \, \arctan \left (-\sqrt {3} + 2 \, \cosh \left (x\right ) + 2 \, \sinh \left (x\right )\right ) - \frac {2}{3} \, \arctan \left (\cosh \left (x\right ) + \sinh \left (x\right )\right ) + \cosh \left (x\right ) + \sinh \left (x\right ) \] Input:
integrate(exp(x)*tanh(3*x),x, algorithm="fricas")
Output:
-1/6*sqrt(3)*log((sqrt(3) + 2*cosh(x))/(cosh(x) - sinh(x))) + 1/6*sqrt(3)* log(-(sqrt(3) - 2*cosh(x))/(cosh(x) - sinh(x))) - 1/3*arctan(sqrt(3) + 2*c osh(x) + 2*sinh(x)) - 1/3*arctan(-sqrt(3) + 2*cosh(x) + 2*sinh(x)) - 2/3*a rctan(cosh(x) + sinh(x)) + cosh(x) + sinh(x)
\[ \int e^x \tanh (3 x) \, dx=\int e^{x} \tanh {\left (3 x \right )}\, dx \] Input:
integrate(exp(x)*tanh(3*x),x)
Output:
Integral(exp(x)*tanh(3*x), x)
Time = 0.12 (sec) , antiderivative size = 69, normalized size of antiderivative = 0.99 \[ \int e^x \tanh (3 x) \, dx=-\frac {1}{6} \, \sqrt {3} \log \left (\sqrt {3} e^{x} + e^{\left (2 \, x\right )} + 1\right ) + \frac {1}{6} \, \sqrt {3} \log \left (-\sqrt {3} e^{x} + e^{\left (2 \, x\right )} + 1\right ) - \frac {1}{3} \, \arctan \left (\sqrt {3} + 2 \, e^{x}\right ) - \frac {1}{3} \, \arctan \left (-\sqrt {3} + 2 \, e^{x}\right ) - \frac {2}{3} \, \arctan \left (e^{x}\right ) + e^{x} \] Input:
integrate(exp(x)*tanh(3*x),x, algorithm="maxima")
Output:
-1/6*sqrt(3)*log(sqrt(3)*e^x + e^(2*x) + 1) + 1/6*sqrt(3)*log(-sqrt(3)*e^x + e^(2*x) + 1) - 1/3*arctan(sqrt(3) + 2*e^x) - 1/3*arctan(-sqrt(3) + 2*e^ x) - 2/3*arctan(e^x) + e^x
Time = 0.11 (sec) , antiderivative size = 69, normalized size of antiderivative = 0.99 \[ \int e^x \tanh (3 x) \, dx=-\frac {1}{6} \, \sqrt {3} \log \left (\sqrt {3} e^{x} + e^{\left (2 \, x\right )} + 1\right ) + \frac {1}{6} \, \sqrt {3} \log \left (-\sqrt {3} e^{x} + e^{\left (2 \, x\right )} + 1\right ) - \frac {1}{3} \, \arctan \left (\sqrt {3} + 2 \, e^{x}\right ) - \frac {1}{3} \, \arctan \left (-\sqrt {3} + 2 \, e^{x}\right ) - \frac {2}{3} \, \arctan \left (e^{x}\right ) + e^{x} \] Input:
integrate(exp(x)*tanh(3*x),x, algorithm="giac")
Output:
-1/6*sqrt(3)*log(sqrt(3)*e^x + e^(2*x) + 1) + 1/6*sqrt(3)*log(-sqrt(3)*e^x + e^(2*x) + 1) - 1/3*arctan(sqrt(3) + 2*e^x) - 1/3*arctan(-sqrt(3) + 2*e^ x) - 2/3*arctan(e^x) + e^x
Time = 2.35 (sec) , antiderivative size = 70, normalized size of antiderivative = 1.00 \[ \int e^x \tanh (3 x) \, dx={\mathrm {e}}^x-\frac {\mathrm {atan}\left (2\,{\mathrm {e}}^x+\sqrt {3}\right )}{3}-\frac {\mathrm {atan}\left (2\,{\mathrm {e}}^x-\sqrt {3}\right )}{3}-\frac {2\,\mathrm {atan}\left ({\mathrm {e}}^x\right )}{3}+\frac {\sqrt {3}\,\ln \left ({\left (2\,{\mathrm {e}}^x-\sqrt {3}\right )}^2+1\right )}{6}-\frac {\sqrt {3}\,\ln \left ({\left (2\,{\mathrm {e}}^x+\sqrt {3}\right )}^2+1\right )}{6} \] Input:
int(tanh(3*x)*exp(x),x)
Output:
exp(x) - atan(2*exp(x) + 3^(1/2))/3 - atan(2*exp(x) - 3^(1/2))/3 - (2*atan (exp(x)))/3 + (3^(1/2)*log((2*exp(x) - 3^(1/2))^2 + 1))/6 - (3^(1/2)*log(( 2*exp(x) + 3^(1/2))^2 + 1))/6
Time = 0.23 (sec) , antiderivative size = 71, normalized size of antiderivative = 1.01 \[ \int e^x \tanh (3 x) \, dx=-\frac {2 \mathit {atan} \left (e^{x}\right )}{3}-\frac {\mathit {atan} \left (2 e^{x}-\sqrt {3}\right )}{3}-\frac {\mathit {atan} \left (2 e^{x}+\sqrt {3}\right )}{3}+e^{x}+\frac {\sqrt {3}\, \mathrm {log}\left (e^{2 x}-e^{x} \sqrt {3}+1\right )}{6}-\frac {\sqrt {3}\, \mathrm {log}\left (e^{2 x}+e^{x} \sqrt {3}+1\right )}{6} \] Input:
int(exp(x)*tanh(3*x),x)
Output:
( - 4*atan(e**x) - 2*atan(2*e**x - sqrt(3)) - 2*atan(2*e**x + sqrt(3)) + 6 *e**x + sqrt(3)*log(e**(2*x) - e**x*sqrt(3) + 1) - sqrt(3)*log(e**(2*x) + e**x*sqrt(3) + 1))/6