Integrand size = 12, antiderivative size = 60 \[ \int \sqrt {a+b \tanh ^2(x)} \, dx=-\sqrt {b} \text {arctanh}\left (\frac {\sqrt {b} \tanh (x)}{\sqrt {a+b \tanh ^2(x)}}\right )+\sqrt {a+b} \text {arctanh}\left (\frac {\sqrt {a+b} \tanh (x)}{\sqrt {a+b \tanh ^2(x)}}\right ) \] Output:
-b^(1/2)*arctanh(b^(1/2)*tanh(x)/(a+b*tanh(x)^2)^(1/2))+(a+b)^(1/2)*arctan h((a+b)^(1/2)*tanh(x)/(a+b*tanh(x)^2)^(1/2))
Time = 0.22 (sec) , antiderivative size = 81, normalized size of antiderivative = 1.35 \[ \int \sqrt {a+b \tanh ^2(x)} \, dx=\sqrt {-a-b} \arctan \left (\frac {\sqrt {b} \text {sech}^2(x)+\tanh (x) \sqrt {a+b \tanh ^2(x)}}{\sqrt {-a-b}}\right )+\sqrt {b} \log \left (-\sqrt {b} \tanh (x)+\sqrt {a+b \tanh ^2(x)}\right ) \] Input:
Integrate[Sqrt[a + b*Tanh[x]^2],x]
Output:
Sqrt[-a - b]*ArcTan[(Sqrt[b]*Sech[x]^2 + Tanh[x]*Sqrt[a + b*Tanh[x]^2])/Sq rt[-a - b]] + Sqrt[b]*Log[-(Sqrt[b]*Tanh[x]) + Sqrt[a + b*Tanh[x]^2]]
Time = 0.33 (sec) , antiderivative size = 60, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.583, Rules used = {3042, 4144, 301, 224, 219, 291, 219}
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 \sqrt {a+b \tanh ^2(x)} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \sqrt {a-b \tan (i x)^2}dx\) |
\(\Big \downarrow \) 4144 |
\(\displaystyle \int \frac {\sqrt {a+b \tanh ^2(x)}}{1-\tanh ^2(x)}d\tanh (x)\) |
\(\Big \downarrow \) 301 |
\(\displaystyle (a+b) \int \frac {1}{\left (1-\tanh ^2(x)\right ) \sqrt {b \tanh ^2(x)+a}}d\tanh (x)-b \int \frac {1}{\sqrt {b \tanh ^2(x)+a}}d\tanh (x)\) |
\(\Big \downarrow \) 224 |
\(\displaystyle (a+b) \int \frac {1}{\left (1-\tanh ^2(x)\right ) \sqrt {b \tanh ^2(x)+a}}d\tanh (x)-b \int \frac {1}{1-\frac {b \tanh ^2(x)}{b \tanh ^2(x)+a}}d\frac {\tanh (x)}{\sqrt {b \tanh ^2(x)+a}}\) |
\(\Big \downarrow \) 219 |
\(\displaystyle (a+b) \int \frac {1}{\left (1-\tanh ^2(x)\right ) \sqrt {b \tanh ^2(x)+a}}d\tanh (x)-\sqrt {b} \text {arctanh}\left (\frac {\sqrt {b} \tanh (x)}{\sqrt {a+b \tanh ^2(x)}}\right )\) |
\(\Big \downarrow \) 291 |
\(\displaystyle (a+b) \int \frac {1}{1-\frac {(a+b) \tanh ^2(x)}{b \tanh ^2(x)+a}}d\frac {\tanh (x)}{\sqrt {b \tanh ^2(x)+a}}-\sqrt {b} \text {arctanh}\left (\frac {\sqrt {b} \tanh (x)}{\sqrt {a+b \tanh ^2(x)}}\right )\) |
\(\Big \downarrow \) 219 |
\(\displaystyle \sqrt {a+b} \text {arctanh}\left (\frac {\sqrt {a+b} \tanh (x)}{\sqrt {a+b \tanh ^2(x)}}\right )-\sqrt {b} \text {arctanh}\left (\frac {\sqrt {b} \tanh (x)}{\sqrt {a+b \tanh ^2(x)}}\right )\) |
Input:
Int[Sqrt[a + b*Tanh[x]^2],x]
Output:
-(Sqrt[b]*ArcTanh[(Sqrt[b]*Tanh[x])/Sqrt[a + b*Tanh[x]^2]]) + Sqrt[a + b]* ArcTanh[(Sqrt[a + b]*Tanh[x])/Sqrt[a + b*Tanh[x]^2]]
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))* ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && NegQ[a/b] && (Gt Q[a, 0] || LtQ[b, 0])
Int[1/Sqrt[(a_) + (b_.)*(x_)^2], x_Symbol] :> Subst[Int[1/(1 - b*x^2), x], x, x/Sqrt[a + b*x^2]] /; FreeQ[{a, b}, x] && !GtQ[a, 0]
Int[1/(Sqrt[(a_) + (b_.)*(x_)^2]*((c_) + (d_.)*(x_)^2)), x_Symbol] :> Subst [Int[1/(c - (b*c - a*d)*x^2), x], x, x/Sqrt[a + b*x^2]] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0]
Int[((a_) + (b_.)*(x_)^2)^(p_.)/((c_) + (d_.)*(x_)^2), x_Symbol] :> Simp[b/ d Int[(a + b*x^2)^(p - 1), x], x] - Simp[(b*c - a*d)/d Int[(a + b*x^2)^ (p - 1)/(c + d*x^2), x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && GtQ[p, 0] && (EqQ[p, 1/2] || EqQ[Denominator[p], 4] || (EqQ[p, 2/3] && E qQ[b*c + 3*a*d, 0]))
Int[((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_), x_Symbol] :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Simp[c*(ff/f) Subst[Int[(a + b* (ff*x)^n)^p/(c^2 + ff^2*x^2), x], x, c*(Tan[e + f*x]/ff)], x]] /; FreeQ[{a, b, c, e, f, n, p}, x] && (IntegersQ[n, p] || IGtQ[p, 0] || EqQ[n^2, 4] || EqQ[n^2, 16])
Leaf count of result is larger than twice the leaf count of optimal. \(237\) vs. \(2(48)=96\).
Time = 0.05 (sec) , antiderivative size = 238, normalized size of antiderivative = 3.97
method | result | size |
derivativedivides | \(-\frac {\sqrt {b \left (\tanh \left (x \right )-1\right )^{2}+2 b \left (\tanh \left (x \right )-1\right )+a +b}}{2}-\frac {\sqrt {b}\, \ln \left (\frac {b \left (\tanh \left (x \right )-1\right )+b}{\sqrt {b}}+\sqrt {b \left (\tanh \left (x \right )-1\right )^{2}+2 b \left (\tanh \left (x \right )-1\right )+a +b}\right )}{2}+\frac {\sqrt {a +b}\, \ln \left (\frac {2 a +2 b +2 b \left (\tanh \left (x \right )-1\right )+2 \sqrt {a +b}\, \sqrt {b \left (\tanh \left (x \right )-1\right )^{2}+2 b \left (\tanh \left (x \right )-1\right )+a +b}}{\tanh \left (x \right )-1}\right )}{2}+\frac {\sqrt {b \left (\tanh \left (x \right )+1\right )^{2}-2 b \left (\tanh \left (x \right )+1\right )+a +b}}{2}-\frac {\sqrt {b}\, \ln \left (\frac {b \left (\tanh \left (x \right )+1\right )-b}{\sqrt {b}}+\sqrt {b \left (\tanh \left (x \right )+1\right )^{2}-2 b \left (\tanh \left (x \right )+1\right )+a +b}\right )}{2}-\frac {\sqrt {a +b}\, \ln \left (\frac {2 a +2 b -2 b \left (\tanh \left (x \right )+1\right )+2 \sqrt {a +b}\, \sqrt {b \left (\tanh \left (x \right )+1\right )^{2}-2 b \left (\tanh \left (x \right )+1\right )+a +b}}{\tanh \left (x \right )+1}\right )}{2}\) | \(238\) |
default | \(-\frac {\sqrt {b \left (\tanh \left (x \right )-1\right )^{2}+2 b \left (\tanh \left (x \right )-1\right )+a +b}}{2}-\frac {\sqrt {b}\, \ln \left (\frac {b \left (\tanh \left (x \right )-1\right )+b}{\sqrt {b}}+\sqrt {b \left (\tanh \left (x \right )-1\right )^{2}+2 b \left (\tanh \left (x \right )-1\right )+a +b}\right )}{2}+\frac {\sqrt {a +b}\, \ln \left (\frac {2 a +2 b +2 b \left (\tanh \left (x \right )-1\right )+2 \sqrt {a +b}\, \sqrt {b \left (\tanh \left (x \right )-1\right )^{2}+2 b \left (\tanh \left (x \right )-1\right )+a +b}}{\tanh \left (x \right )-1}\right )}{2}+\frac {\sqrt {b \left (\tanh \left (x \right )+1\right )^{2}-2 b \left (\tanh \left (x \right )+1\right )+a +b}}{2}-\frac {\sqrt {b}\, \ln \left (\frac {b \left (\tanh \left (x \right )+1\right )-b}{\sqrt {b}}+\sqrt {b \left (\tanh \left (x \right )+1\right )^{2}-2 b \left (\tanh \left (x \right )+1\right )+a +b}\right )}{2}-\frac {\sqrt {a +b}\, \ln \left (\frac {2 a +2 b -2 b \left (\tanh \left (x \right )+1\right )+2 \sqrt {a +b}\, \sqrt {b \left (\tanh \left (x \right )+1\right )^{2}-2 b \left (\tanh \left (x \right )+1\right )+a +b}}{\tanh \left (x \right )+1}\right )}{2}\) | \(238\) |
Input:
int((a+b*tanh(x)^2)^(1/2),x,method=_RETURNVERBOSE)
Output:
-1/2*(b*(tanh(x)-1)^2+2*b*(tanh(x)-1)+a+b)^(1/2)-1/2*b^(1/2)*ln((b*(tanh(x )-1)+b)/b^(1/2)+(b*(tanh(x)-1)^2+2*b*(tanh(x)-1)+a+b)^(1/2))+1/2*(a+b)^(1/ 2)*ln((2*a+2*b+2*b*(tanh(x)-1)+2*(a+b)^(1/2)*(b*(tanh(x)-1)^2+2*b*(tanh(x) -1)+a+b)^(1/2))/(tanh(x)-1))+1/2*(b*(tanh(x)+1)^2-2*b*(tanh(x)+1)+a+b)^(1/ 2)-1/2*b^(1/2)*ln((b*(tanh(x)+1)-b)/b^(1/2)+(b*(tanh(x)+1)^2-2*b*(tanh(x)+ 1)+a+b)^(1/2))-1/2*(a+b)^(1/2)*ln((2*a+2*b-2*b*(tanh(x)+1)+2*(a+b)^(1/2)*( b*(tanh(x)+1)^2-2*b*(tanh(x)+1)+a+b)^(1/2))/(tanh(x)+1))
Leaf count of result is larger than twice the leaf count of optimal. 481 vs. \(2 (48) = 96\).
Time = 0.19 (sec) , antiderivative size = 3303, normalized size of antiderivative = 55.05 \[ \int \sqrt {a+b \tanh ^2(x)} \, dx=\text {Too large to display} \] Input:
integrate((a+b*tanh(x)^2)^(1/2),x, algorithm="fricas")
Output:
Too large to include
\[ \int \sqrt {a+b \tanh ^2(x)} \, dx=\int \sqrt {a + b \tanh ^{2}{\left (x \right )}}\, dx \] Input:
integrate((a+b*tanh(x)**2)**(1/2),x)
Output:
Integral(sqrt(a + b*tanh(x)**2), x)
\[ \int \sqrt {a+b \tanh ^2(x)} \, dx=\int { \sqrt {b \tanh \left (x\right )^{2} + a} \,d x } \] Input:
integrate((a+b*tanh(x)^2)^(1/2),x, algorithm="maxima")
Output:
integrate(sqrt(b*tanh(x)^2 + a), x)
Leaf count of result is larger than twice the leaf count of optimal. 253 vs. \(2 (48) = 96\).
Time = 0.32 (sec) , antiderivative size = 253, normalized size of antiderivative = 4.22 \[ \int \sqrt {a+b \tanh ^2(x)} \, dx=-\frac {2 \, b \arctan \left (-\frac {\sqrt {a + b} e^{\left (2 \, x\right )} - \sqrt {a e^{\left (4 \, x\right )} + b e^{\left (4 \, x\right )} + 2 \, a e^{\left (2 \, x\right )} - 2 \, b e^{\left (2 \, x\right )} + a + b} + \sqrt {a + b}}{2 \, \sqrt {-b}}\right )}{\sqrt {-b}} - \frac {1}{2} \, \sqrt {a + b} \log \left ({\left | -{\left (\sqrt {a + b} e^{\left (2 \, x\right )} - \sqrt {a e^{\left (4 \, x\right )} + b e^{\left (4 \, x\right )} + 2 \, a e^{\left (2 \, x\right )} - 2 \, b e^{\left (2 \, x\right )} + a + b}\right )} {\left (a + b\right )} - \sqrt {a + b} {\left (a - b\right )} \right |}\right ) - \frac {1}{2} \, \sqrt {a + b} \log \left ({\left | -\sqrt {a + b} e^{\left (2 \, x\right )} + \sqrt {a e^{\left (4 \, x\right )} + b e^{\left (4 \, x\right )} + 2 \, a e^{\left (2 \, x\right )} - 2 \, b e^{\left (2 \, x\right )} + a + b} + \sqrt {a + b} \right |}\right ) + \frac {1}{2} \, \sqrt {a + b} \log \left ({\left | -\sqrt {a + b} e^{\left (2 \, x\right )} + \sqrt {a e^{\left (4 \, x\right )} + b e^{\left (4 \, x\right )} + 2 \, a e^{\left (2 \, x\right )} - 2 \, b e^{\left (2 \, x\right )} + a + b} - \sqrt {a + b} \right |}\right ) \] Input:
integrate((a+b*tanh(x)^2)^(1/2),x, algorithm="giac")
Output:
-2*b*arctan(-1/2*(sqrt(a + b)*e^(2*x) - sqrt(a*e^(4*x) + b*e^(4*x) + 2*a*e ^(2*x) - 2*b*e^(2*x) + a + b) + sqrt(a + b))/sqrt(-b))/sqrt(-b) - 1/2*sqrt (a + b)*log(abs(-(sqrt(a + b)*e^(2*x) - sqrt(a*e^(4*x) + b*e^(4*x) + 2*a*e ^(2*x) - 2*b*e^(2*x) + a + b))*(a + b) - sqrt(a + b)*(a - b))) - 1/2*sqrt( a + b)*log(abs(-sqrt(a + b)*e^(2*x) + sqrt(a*e^(4*x) + b*e^(4*x) + 2*a*e^( 2*x) - 2*b*e^(2*x) + a + b) + sqrt(a + b))) + 1/2*sqrt(a + b)*log(abs(-sqr t(a + b)*e^(2*x) + sqrt(a*e^(4*x) + b*e^(4*x) + 2*a*e^(2*x) - 2*b*e^(2*x) + a + b) - sqrt(a + b)))
Timed out. \[ \int \sqrt {a+b \tanh ^2(x)} \, dx=\int \sqrt {b\,{\mathrm {tanh}\left (x\right )}^2+a} \,d x \] Input:
int((a + b*tanh(x)^2)^(1/2),x)
Output:
int((a + b*tanh(x)^2)^(1/2), x)
\[ \int \sqrt {a+b \tanh ^2(x)} \, dx=\int \sqrt {\tanh \left (x \right )^{2} b +a}d x \] Input:
int((a+b*tanh(x)^2)^(1/2),x)
Output:
int(sqrt(tanh(x)**2*b + a),x)