Integrand size = 9, antiderivative size = 126 \[ \int \tanh ^2(a+2 \log (x)) \, dx=x+\frac {x}{1+e^{2 a} x^4}+\frac {e^{-a/2} \arctan \left (1-\sqrt {2} e^{a/2} x\right )}{2 \sqrt {2}}-\frac {e^{-a/2} \arctan \left (1+\sqrt {2} e^{a/2} x\right )}{2 \sqrt {2}}-\frac {e^{-a/2} \text {arctanh}\left (\frac {\sqrt {2} e^{a/2} x}{1+e^a x^2}\right )}{2 \sqrt {2}} \] Output:
x+x/(1+exp(2*a)*x^4)-1/4*arctan(-1+2^(1/2)*exp(1/2*a)*x)*2^(1/2)/exp(1/2*a )-1/4*arctan(1+2^(1/2)*exp(1/2*a)*x)*2^(1/2)/exp(1/2*a)-1/4*arctanh(2^(1/2 )*exp(1/2*a)*x/(1+exp(a)*x^2))*2^(1/2)/exp(1/2*a)
Time = 0.39 (sec) , antiderivative size = 146, normalized size of antiderivative = 1.16 \[ \int \tanh ^2(a+2 \log (x)) \, dx=\frac {1}{4} \left (4 x+\frac {4 x}{1+e^{2 a} x^4}+\sqrt [4]{-1} e^{-a/2} \log \left (\sqrt [4]{-1} e^{-a/2}-x\right )+(-1)^{3/4} e^{-a/2} \log \left ((-1)^{3/4} e^{-a/2}-x\right )-\sqrt [4]{-1} e^{-a/2} \log \left (\sqrt [4]{-1} e^{-a/2}+x\right )-(-1)^{3/4} e^{-a/2} \log \left ((-1)^{3/4} e^{-a/2}+x\right )\right ) \] Input:
Integrate[Tanh[a + 2*Log[x]]^2,x]
Output:
(4*x + (4*x)/(1 + E^(2*a)*x^4) + ((-1)^(1/4)*Log[(-1)^(1/4)/E^(a/2) - x])/ E^(a/2) + ((-1)^(3/4)*Log[(-1)^(3/4)/E^(a/2) - x])/E^(a/2) - ((-1)^(1/4)*L og[(-1)^(1/4)/E^(a/2) + x])/E^(a/2) - ((-1)^(3/4)*Log[(-1)^(3/4)/E^(a/2) + x])/E^(a/2))/4
Time = 0.36 (sec) , antiderivative size = 165, normalized size of antiderivative = 1.31, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {6067, 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 \tanh ^2(a+2 \log (x)) \, dx\) |
\(\Big \downarrow \) 6067 |
\(\displaystyle \int \frac {\left (e^{2 a} x^4-1\right )^2}{\left (e^{2 a} x^4+1\right )^2}dx\) |
\(\Big \downarrow \) 915 |
\(\displaystyle \int \left (1-\frac {4 e^{2 a} x^4}{\left (e^{2 a} x^4+1\right )^2}\right )dx\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {e^{-a/2} \arctan \left (1-\sqrt {2} e^{a/2} x\right )}{2 \sqrt {2}}-\frac {e^{-a/2} \arctan \left (\sqrt {2} e^{a/2} x+1\right )}{2 \sqrt {2}}+\frac {x}{e^{2 a} x^4+1}+\frac {e^{-a/2} \log \left (e^a x^2-\sqrt {2} e^{a/2} x+1\right )}{4 \sqrt {2}}-\frac {e^{-a/2} \log \left (e^a x^2+\sqrt {2} e^{a/2} x+1\right )}{4 \sqrt {2}}+x\) |
Input:
Int[Tanh[a + 2*Log[x]]^2,x]
Output:
x + x/(1 + E^(2*a)*x^4) + ArcTan[1 - Sqrt[2]*E^(a/2)*x]/(2*Sqrt[2]*E^(a/2) ) - ArcTan[1 + Sqrt[2]*E^(a/2)*x]/(2*Sqrt[2]*E^(a/2)) + Log[1 - Sqrt[2]*E^ (a/2)*x + E^a*x^2]/(4*Sqrt[2]*E^(a/2)) - Log[1 + Sqrt[2]*E^(a/2)*x + E^a*x ^2]/(4*Sqrt[2]*E^(a/2))
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[Tanh[((a_.) + Log[x_]*(b_.))*(d_.)]^(p_.), x_Symbol] :> Int[(-1 + E^(2* a*d)*x^(2*b*d))^p/(1 + E^(2*a*d)*x^(2*b*d))^p, x] /; FreeQ[{a, b, d, p}, x]
Result contains higher order function than in optimal. Order 9 vs. order 3.
Time = 0.25 (sec) , antiderivative size = 47, normalized size of antiderivative = 0.37
method | result | size |
risch | \(x +\frac {x}{1+{\mathrm e}^{2 a} x^{4}}-\frac {{\mathrm e}^{-2 a} \left (\munderset {\textit {\_R} =\operatorname {RootOf}\left ({\mathrm e}^{2 a} \textit {\_Z}^{4}+1\right )}{\sum }\frac {\ln \left (x -\textit {\_R} \right )}{\textit {\_R}^{3}}\right )}{4}\) | \(47\) |
Input:
int(tanh(a+2*ln(x))^2,x,method=_RETURNVERBOSE)
Output:
x+x/(1+exp(2*a)*x^4)-1/4*exp(-2*a)*sum(1/_R^3*ln(x-_R),_R=RootOf(exp(2*a)* _Z^4+1))
Time = 0.09 (sec) , antiderivative size = 163, normalized size of antiderivative = 1.29 \[ \int \tanh ^2(a+2 \log (x)) \, dx=\frac {8 \, x^{5} e^{\left (2 \, a\right )} - 2 \, \sqrt {2} {\left (x^{4} e^{\left (2 \, a\right )} + 1\right )} \arctan \left (\sqrt {2} x e^{\left (\frac {1}{2} \, a\right )} + 1\right ) e^{\left (-\frac {1}{2} \, a\right )} - 2 \, \sqrt {2} {\left (x^{4} e^{\left (2 \, a\right )} + 1\right )} \arctan \left (\sqrt {2} x e^{\left (\frac {1}{2} \, a\right )} - 1\right ) e^{\left (-\frac {1}{2} \, a\right )} - \sqrt {2} {\left (x^{4} e^{\left (2 \, a\right )} + 1\right )} e^{\left (-\frac {1}{2} \, a\right )} \log \left (x^{2} e^{a} + \sqrt {2} x e^{\left (\frac {1}{2} \, a\right )} + 1\right ) + \sqrt {2} {\left (x^{4} e^{\left (2 \, a\right )} + 1\right )} e^{\left (-\frac {1}{2} \, a\right )} \log \left (x^{2} e^{a} - \sqrt {2} x e^{\left (\frac {1}{2} \, a\right )} + 1\right ) + 16 \, x}{8 \, {\left (x^{4} e^{\left (2 \, a\right )} + 1\right )}} \] Input:
integrate(tanh(a+2*log(x))^2,x, algorithm="fricas")
Output:
1/8*(8*x^5*e^(2*a) - 2*sqrt(2)*(x^4*e^(2*a) + 1)*arctan(sqrt(2)*x*e^(1/2*a ) + 1)*e^(-1/2*a) - 2*sqrt(2)*(x^4*e^(2*a) + 1)*arctan(sqrt(2)*x*e^(1/2*a) - 1)*e^(-1/2*a) - sqrt(2)*(x^4*e^(2*a) + 1)*e^(-1/2*a)*log(x^2*e^a + sqrt (2)*x*e^(1/2*a) + 1) + sqrt(2)*(x^4*e^(2*a) + 1)*e^(-1/2*a)*log(x^2*e^a - sqrt(2)*x*e^(1/2*a) + 1) + 16*x)/(x^4*e^(2*a) + 1)
\[ \int \tanh ^2(a+2 \log (x)) \, dx=\int \tanh ^{2}{\left (a + 2 \log {\left (x \right )} \right )}\, dx \] Input:
integrate(tanh(a+2*ln(x))**2,x)
Output:
Integral(tanh(a + 2*log(x))**2, x)
Time = 0.15 (sec) , antiderivative size = 138, normalized size of antiderivative = 1.10 \[ \int \tanh ^2(a+2 \log (x)) \, dx=-\frac {1}{4} \, \sqrt {2} \arctan \left (\frac {1}{2} \, \sqrt {2} {\left (2 \, x e^{a} + \sqrt {2} e^{\left (\frac {1}{2} \, a\right )}\right )} e^{\left (-\frac {1}{2} \, a\right )}\right ) e^{\left (-\frac {1}{2} \, a\right )} - \frac {1}{4} \, \sqrt {2} \arctan \left (\frac {1}{2} \, \sqrt {2} {\left (2 \, x e^{a} - \sqrt {2} e^{\left (\frac {1}{2} \, a\right )}\right )} e^{\left (-\frac {1}{2} \, a\right )}\right ) e^{\left (-\frac {1}{2} \, a\right )} - \frac {1}{8} \, \sqrt {2} e^{\left (-\frac {1}{2} \, a\right )} \log \left (x^{2} e^{a} + \sqrt {2} x e^{\left (\frac {1}{2} \, a\right )} + 1\right ) + \frac {1}{8} \, \sqrt {2} e^{\left (-\frac {1}{2} \, a\right )} \log \left (x^{2} e^{a} - \sqrt {2} x e^{\left (\frac {1}{2} \, a\right )} + 1\right ) + x + \frac {x}{x^{4} e^{\left (2 \, a\right )} + 1} \] Input:
integrate(tanh(a+2*log(x))^2,x, algorithm="maxima")
Output:
-1/4*sqrt(2)*arctan(1/2*sqrt(2)*(2*x*e^a + sqrt(2)*e^(1/2*a))*e^(-1/2*a))* e^(-1/2*a) - 1/4*sqrt(2)*arctan(1/2*sqrt(2)*(2*x*e^a - sqrt(2)*e^(1/2*a))* e^(-1/2*a))*e^(-1/2*a) - 1/8*sqrt(2)*e^(-1/2*a)*log(x^2*e^a + sqrt(2)*x*e^ (1/2*a) + 1) + 1/8*sqrt(2)*e^(-1/2*a)*log(x^2*e^a - sqrt(2)*x*e^(1/2*a) + 1) + x + x/(x^4*e^(2*a) + 1)
Time = 0.13 (sec) , antiderivative size = 133, normalized size of antiderivative = 1.06 \[ \int \tanh ^2(a+2 \log (x)) \, dx=-\frac {1}{4} \, \sqrt {2} \arctan \left (\frac {1}{2} \, \sqrt {2} {\left (\sqrt {2} e^{\left (-\frac {1}{2} \, a\right )} + 2 \, x\right )} e^{\left (\frac {1}{2} \, a\right )}\right ) e^{\left (-\frac {1}{2} \, a\right )} - \frac {1}{4} \, \sqrt {2} \arctan \left (-\frac {1}{2} \, \sqrt {2} {\left (\sqrt {2} e^{\left (-\frac {1}{2} \, a\right )} - 2 \, x\right )} e^{\left (\frac {1}{2} \, a\right )}\right ) e^{\left (-\frac {1}{2} \, a\right )} - \frac {1}{8} \, \sqrt {2} e^{\left (-\frac {1}{2} \, a\right )} \log \left (\sqrt {2} x e^{\left (-\frac {1}{2} \, a\right )} + x^{2} + e^{\left (-a\right )}\right ) + \frac {1}{8} \, \sqrt {2} e^{\left (-\frac {1}{2} \, a\right )} \log \left (-\sqrt {2} x e^{\left (-\frac {1}{2} \, a\right )} + x^{2} + e^{\left (-a\right )}\right ) + x + \frac {x}{x^{4} e^{\left (2 \, a\right )} + 1} \] Input:
integrate(tanh(a+2*log(x))^2,x, algorithm="giac")
Output:
-1/4*sqrt(2)*arctan(1/2*sqrt(2)*(sqrt(2)*e^(-1/2*a) + 2*x)*e^(1/2*a))*e^(- 1/2*a) - 1/4*sqrt(2)*arctan(-1/2*sqrt(2)*(sqrt(2)*e^(-1/2*a) - 2*x)*e^(1/2 *a))*e^(-1/2*a) - 1/8*sqrt(2)*e^(-1/2*a)*log(sqrt(2)*x*e^(-1/2*a) + x^2 + e^(-a)) + 1/8*sqrt(2)*e^(-1/2*a)*log(-sqrt(2)*x*e^(-1/2*a) + x^2 + e^(-a)) + x + x/(x^4*e^(2*a) + 1)
Time = 2.29 (sec) , antiderivative size = 61, normalized size of antiderivative = 0.48 \[ \int \tanh ^2(a+2 \log (x)) \, dx=x-\frac {\mathrm {atan}\left (x\,{\left (-{\mathrm {e}}^{2\,a}\right )}^{1/4}\right )}{2\,{\left (-{\mathrm {e}}^{2\,a}\right )}^{1/4}}+\frac {x}{{\mathrm {e}}^{2\,a}\,x^4+1}+\frac {\mathrm {atan}\left (x\,{\left (-{\mathrm {e}}^{2\,a}\right )}^{1/4}\,1{}\mathrm {i}\right )\,1{}\mathrm {i}}{2\,{\left (-{\mathrm {e}}^{2\,a}\right )}^{1/4}} \] Input:
int(tanh(a + 2*log(x))^2,x)
Output:
x - atan(x*(-exp(2*a))^(1/4))/(2*(-exp(2*a))^(1/4)) + (atan(x*(-exp(2*a))^ (1/4)*1i)*1i)/(2*(-exp(2*a))^(1/4)) + x/(x^4*exp(2*a) + 1)
Time = 0.27 (sec) , antiderivative size = 309, normalized size of antiderivative = 2.45 \[ \int \tanh ^2(a+2 \log (x)) \, dx=\frac {2 e^{\frac {5 a}{2}} \sqrt {2}\, \mathit {atan} \left (\frac {e^{\frac {a}{2}} \sqrt {2}-2 e^{a} x}{e^{\frac {a}{2}} \sqrt {2}}\right ) x^{4}+2 e^{\frac {a}{2}} \sqrt {2}\, \mathit {atan} \left (\frac {e^{\frac {a}{2}} \sqrt {2}-2 e^{a} x}{e^{\frac {a}{2}} \sqrt {2}}\right )-2 e^{\frac {5 a}{2}} \sqrt {2}\, \mathit {atan} \left (\frac {e^{\frac {a}{2}} \sqrt {2}+2 e^{a} x}{e^{\frac {a}{2}} \sqrt {2}}\right ) x^{4}-2 e^{\frac {a}{2}} \sqrt {2}\, \mathit {atan} \left (\frac {e^{\frac {a}{2}} \sqrt {2}+2 e^{a} x}{e^{\frac {a}{2}} \sqrt {2}}\right )+e^{\frac {5 a}{2}} \sqrt {2}\, \mathrm {log}\left (-e^{\frac {a}{2}} \sqrt {2}\, x +e^{a} x^{2}+1\right ) x^{4}-e^{\frac {5 a}{2}} \sqrt {2}\, \mathrm {log}\left (e^{\frac {a}{2}} \sqrt {2}\, x +e^{a} x^{2}+1\right ) x^{4}+e^{\frac {a}{2}} \sqrt {2}\, \mathrm {log}\left (-e^{\frac {a}{2}} \sqrt {2}\, x +e^{a} x^{2}+1\right )-e^{\frac {a}{2}} \sqrt {2}\, \mathrm {log}\left (e^{\frac {a}{2}} \sqrt {2}\, x +e^{a} x^{2}+1\right )+8 e^{3 a} x^{5}+16 e^{a} x}{8 e^{a} \left (e^{2 a} x^{4}+1\right )} \] Input:
int(tanh(a+2*log(x))^2,x)
Output:
(2*e**((5*a)/2)*sqrt(2)*atan((e**(a/2)*sqrt(2) - 2*e**a*x)/(e**(a/2)*sqrt( 2)))*x**4 + 2*e**(a/2)*sqrt(2)*atan((e**(a/2)*sqrt(2) - 2*e**a*x)/(e**(a/2 )*sqrt(2))) - 2*e**((5*a)/2)*sqrt(2)*atan((e**(a/2)*sqrt(2) + 2*e**a*x)/(e **(a/2)*sqrt(2)))*x**4 - 2*e**(a/2)*sqrt(2)*atan((e**(a/2)*sqrt(2) + 2*e** a*x)/(e**(a/2)*sqrt(2))) + e**((5*a)/2)*sqrt(2)*log( - e**(a/2)*sqrt(2)*x + e**a*x**2 + 1)*x**4 - e**((5*a)/2)*sqrt(2)*log(e**(a/2)*sqrt(2)*x + e**a *x**2 + 1)*x**4 + e**(a/2)*sqrt(2)*log( - e**(a/2)*sqrt(2)*x + e**a*x**2 + 1) - e**(a/2)*sqrt(2)*log(e**(a/2)*sqrt(2)*x + e**a*x**2 + 1) + 8*e**(3*a )*x**5 + 16*e**a*x)/(8*e**a*(e**(2*a)*x**4 + 1))