### 3.105 $$\int \frac{d+e x+f x^2}{(g+h x) \sqrt{a+c x^2}} \, dx$$

Optimal. Leaf size=130 $-\frac{\left (d h^2-e g h+f g^2\right ) \tanh ^{-1}\left (\frac{a h-c g x}{\sqrt{a+c x^2} \sqrt{a h^2+c g^2}}\right )}{h^2 \sqrt{a h^2+c g^2}}-\frac{\tanh ^{-1}\left (\frac{\sqrt{c} x}{\sqrt{a+c x^2}}\right ) (f g-e h)}{\sqrt{c} h^2}+\frac{f \sqrt{a+c x^2}}{c h}$

[Out]

(f*Sqrt[a + c*x^2])/(c*h) - ((f*g - e*h)*ArcTanh[(Sqrt[c]*x)/Sqrt[a + c*x^2]])/(Sqrt[c]*h^2) - ((f*g^2 - e*g*h
+ d*h^2)*ArcTanh[(a*h - c*g*x)/(Sqrt[c*g^2 + a*h^2]*Sqrt[a + c*x^2])])/(h^2*Sqrt[c*g^2 + a*h^2])

________________________________________________________________________________________

Rubi [A]  time = 0.174346, antiderivative size = 130, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 5, integrand size = 29, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.172, Rules used = {1654, 844, 217, 206, 725} $-\frac{\left (d h^2-e g h+f g^2\right ) \tanh ^{-1}\left (\frac{a h-c g x}{\sqrt{a+c x^2} \sqrt{a h^2+c g^2}}\right )}{h^2 \sqrt{a h^2+c g^2}}-\frac{\tanh ^{-1}\left (\frac{\sqrt{c} x}{\sqrt{a+c x^2}}\right ) (f g-e h)}{\sqrt{c} h^2}+\frac{f \sqrt{a+c x^2}}{c h}$

Antiderivative was successfully veriﬁed.

[In]

Int[(d + e*x + f*x^2)/((g + h*x)*Sqrt[a + c*x^2]),x]

[Out]

(f*Sqrt[a + c*x^2])/(c*h) - ((f*g - e*h)*ArcTanh[(Sqrt[c]*x)/Sqrt[a + c*x^2]])/(Sqrt[c]*h^2) - ((f*g^2 - e*g*h
+ d*h^2)*ArcTanh[(a*h - c*g*x)/(Sqrt[c*g^2 + a*h^2]*Sqrt[a + c*x^2])])/(h^2*Sqrt[c*g^2 + a*h^2])

Rule 1654

Int[(Pq_)*((d_) + (e_.)*(x_))^(m_.)*((a_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> With[{q = Expon[Pq, x], f = Coeff
[Pq, x, Expon[Pq, x]]}, Simp[(f*(d + e*x)^(m + q - 1)*(a + c*x^2)^(p + 1))/(c*e^(q - 1)*(m + q + 2*p + 1)), x]
+ Dist[1/(c*e^q*(m + q + 2*p + 1)), Int[(d + e*x)^m*(a + c*x^2)^p*ExpandToSum[c*e^q*(m + q + 2*p + 1)*Pq - c*
f*(m + q + 2*p + 1)*(d + e*x)^q - f*(d + e*x)^(q - 2)*(a*e^2*(m + q - 1) - c*d^2*(m + q + 2*p + 1) - 2*c*d*e*(
m + q + p)*x), x], x], x] /; GtQ[q, 1] && NeQ[m + q + 2*p + 1, 0]] /; FreeQ[{a, c, d, e, m, p}, x] && PolyQ[Pq
, x] && NeQ[c*d^2 + a*e^2, 0] &&  !(EqQ[d, 0] && True) &&  !(IGtQ[m, 0] && RationalQ[a, c, d, e] && (IntegerQ[
p] || ILtQ[p + 1/2, 0]))

Rule 844

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Dist[g/e, Int[(d
+ e*x)^(m + 1)*(a + c*x^2)^p, x], x] + Dist[(e*f - d*g)/e, Int[(d + e*x)^m*(a + c*x^2)^p, x], x] /; FreeQ[{a,
c, d, e, f, g, m, p}, x] && NeQ[c*d^2 + a*e^2, 0] &&  !IGtQ[m, 0]

Rule 217

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]

Rule 206

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

Rule 725

Int[1/(((d_) + (e_.)*(x_))*Sqrt[(a_) + (c_.)*(x_)^2]), x_Symbol] :> -Subst[Int[1/(c*d^2 + a*e^2 - x^2), x], x,
(a*e - c*d*x)/Sqrt[a + c*x^2]] /; FreeQ[{a, c, d, e}, x]

Rubi steps

\begin{align*} \int \frac{d+e x+f x^2}{(g+h x) \sqrt{a+c x^2}} \, dx &=\frac{f \sqrt{a+c x^2}}{c h}+\frac{\int \frac{c d h^2-c h (f g-e h) x}{(g+h x) \sqrt{a+c x^2}} \, dx}{c h^2}\\ &=\frac{f \sqrt{a+c x^2}}{c h}-\frac{(f g-e h) \int \frac{1}{\sqrt{a+c x^2}} \, dx}{h^2}+\frac{\left (f g^2-e g h+d h^2\right ) \int \frac{1}{(g+h x) \sqrt{a+c x^2}} \, dx}{h^2}\\ &=\frac{f \sqrt{a+c x^2}}{c h}-\frac{(f g-e h) \operatorname{Subst}\left (\int \frac{1}{1-c x^2} \, dx,x,\frac{x}{\sqrt{a+c x^2}}\right )}{h^2}-\frac{\left (f g^2-e g h+d h^2\right ) \operatorname{Subst}\left (\int \frac{1}{c g^2+a h^2-x^2} \, dx,x,\frac{a h-c g x}{\sqrt{a+c x^2}}\right )}{h^2}\\ &=\frac{f \sqrt{a+c x^2}}{c h}-\frac{(f g-e h) \tanh ^{-1}\left (\frac{\sqrt{c} x}{\sqrt{a+c x^2}}\right )}{\sqrt{c} h^2}-\frac{\left (f g^2-e g h+d h^2\right ) \tanh ^{-1}\left (\frac{a h-c g x}{\sqrt{c g^2+a h^2} \sqrt{a+c x^2}}\right )}{h^2 \sqrt{c g^2+a h^2}}\\ \end{align*}

Mathematica [A]  time = 0.230856, size = 125, normalized size = 0.96 $\frac{-\frac{\left (h (d h-e g)+f g^2\right ) \tanh ^{-1}\left (\frac{a h-c g x}{\sqrt{a+c x^2} \sqrt{a h^2+c g^2}}\right )}{\sqrt{a h^2+c g^2}}+\frac{\tanh ^{-1}\left (\frac{\sqrt{c} x}{\sqrt{a+c x^2}}\right ) (e h-f g)}{\sqrt{c}}+\frac{f h \sqrt{a+c x^2}}{c}}{h^2}$

Antiderivative was successfully veriﬁed.

[In]

Integrate[(d + e*x + f*x^2)/((g + h*x)*Sqrt[a + c*x^2]),x]

[Out]

((f*h*Sqrt[a + c*x^2])/c + ((-(f*g) + e*h)*ArcTanh[(Sqrt[c]*x)/Sqrt[a + c*x^2]])/Sqrt[c] - ((f*g^2 + h*(-(e*g)
+ d*h))*ArcTanh[(a*h - c*g*x)/(Sqrt[c*g^2 + a*h^2]*Sqrt[a + c*x^2])])/Sqrt[c*g^2 + a*h^2])/h^2

________________________________________________________________________________________

Maple [B]  time = 0.236, size = 453, normalized size = 3.5 \begin{align*}{\frac{f}{ch}\sqrt{c{x}^{2}+a}}+{\frac{e}{h}\ln \left ( x\sqrt{c}+\sqrt{c{x}^{2}+a} \right ){\frac{1}{\sqrt{c}}}}-{\frac{fg}{{h}^{2}}\ln \left ( x\sqrt{c}+\sqrt{c{x}^{2}+a} \right ){\frac{1}{\sqrt{c}}}}-{\frac{d}{h}\ln \left ({ \left ( 2\,{\frac{a{h}^{2}+c{g}^{2}}{{h}^{2}}}-2\,{\frac{cg}{h} \left ( x+{\frac{g}{h}} \right ) }+2\,\sqrt{{\frac{a{h}^{2}+c{g}^{2}}{{h}^{2}}}}\sqrt{ \left ( x+{\frac{g}{h}} \right ) ^{2}c-2\,{\frac{cg}{h} \left ( x+{\frac{g}{h}} \right ) }+{\frac{a{h}^{2}+c{g}^{2}}{{h}^{2}}}} \right ) \left ( x+{\frac{g}{h}} \right ) ^{-1}} \right ){\frac{1}{\sqrt{{\frac{a{h}^{2}+c{g}^{2}}{{h}^{2}}}}}}}+{\frac{eg}{{h}^{2}}\ln \left ({ \left ( 2\,{\frac{a{h}^{2}+c{g}^{2}}{{h}^{2}}}-2\,{\frac{cg}{h} \left ( x+{\frac{g}{h}} \right ) }+2\,\sqrt{{\frac{a{h}^{2}+c{g}^{2}}{{h}^{2}}}}\sqrt{ \left ( x+{\frac{g}{h}} \right ) ^{2}c-2\,{\frac{cg}{h} \left ( x+{\frac{g}{h}} \right ) }+{\frac{a{h}^{2}+c{g}^{2}}{{h}^{2}}}} \right ) \left ( x+{\frac{g}{h}} \right ) ^{-1}} \right ){\frac{1}{\sqrt{{\frac{a{h}^{2}+c{g}^{2}}{{h}^{2}}}}}}}-{\frac{f{g}^{2}}{{h}^{3}}\ln \left ({ \left ( 2\,{\frac{a{h}^{2}+c{g}^{2}}{{h}^{2}}}-2\,{\frac{cg}{h} \left ( x+{\frac{g}{h}} \right ) }+2\,\sqrt{{\frac{a{h}^{2}+c{g}^{2}}{{h}^{2}}}}\sqrt{ \left ( x+{\frac{g}{h}} \right ) ^{2}c-2\,{\frac{cg}{h} \left ( x+{\frac{g}{h}} \right ) }+{\frac{a{h}^{2}+c{g}^{2}}{{h}^{2}}}} \right ) \left ( x+{\frac{g}{h}} \right ) ^{-1}} \right ){\frac{1}{\sqrt{{\frac{a{h}^{2}+c{g}^{2}}{{h}^{2}}}}}}} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

int((f*x^2+e*x+d)/(h*x+g)/(c*x^2+a)^(1/2),x)

[Out]

f*(c*x^2+a)^(1/2)/c/h+1/h*e*ln(x*c^(1/2)+(c*x^2+a)^(1/2))/c^(1/2)-1/h^2*f*g*ln(x*c^(1/2)+(c*x^2+a)^(1/2))/c^(1
/2)-1/h/((a*h^2+c*g^2)/h^2)^(1/2)*ln((2*(a*h^2+c*g^2)/h^2-2*c*g/h*(x+g/h)+2*((a*h^2+c*g^2)/h^2)^(1/2)*((x+g/h)
^2*c-2*c*g/h*(x+g/h)+(a*h^2+c*g^2)/h^2)^(1/2))/(x+g/h))*d+1/h^2/((a*h^2+c*g^2)/h^2)^(1/2)*ln((2*(a*h^2+c*g^2)/
h^2-2*c*g/h*(x+g/h)+2*((a*h^2+c*g^2)/h^2)^(1/2)*((x+g/h)^2*c-2*c*g/h*(x+g/h)+(a*h^2+c*g^2)/h^2)^(1/2))/(x+g/h)
)*e*g-1/h^3/((a*h^2+c*g^2)/h^2)^(1/2)*ln((2*(a*h^2+c*g^2)/h^2-2*c*g/h*(x+g/h)+2*((a*h^2+c*g^2)/h^2)^(1/2)*((x+
g/h)^2*c-2*c*g/h*(x+g/h)+(a*h^2+c*g^2)/h^2)^(1/2))/(x+g/h))*f*g^2

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate((f*x^2+e*x+d)/(h*x+g)/(c*x^2+a)^(1/2),x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate((f*x^2+e*x+d)/(h*x+g)/(c*x^2+a)^(1/2),x, algorithm="fricas")

[Out]

Timed out

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{d + e x + f x^{2}}{\sqrt{a + c x^{2}} \left (g + h x\right )}\, dx \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate((f*x**2+e*x+d)/(h*x+g)/(c*x**2+a)**(1/2),x)

[Out]

Integral((d + e*x + f*x**2)/(sqrt(a + c*x**2)*(g + h*x)), x)

________________________________________________________________________________________

Giac [A]  time = 1.21738, size = 186, normalized size = 1.43 \begin{align*} \frac{\sqrt{c x^{2} + a} f}{c h} + \frac{2 \,{\left (f g^{2} + d h^{2} - g h e\right )} \arctan \left (-\frac{{\left (\sqrt{c} x - \sqrt{c x^{2} + a}\right )} h + \sqrt{c} g}{\sqrt{-c g^{2} - a h^{2}}}\right )}{\sqrt{-c g^{2} - a h^{2}} h^{2}} + \frac{{\left (\sqrt{c} f g - \sqrt{c} h e\right )} \log \left ({\left | -\sqrt{c} x + \sqrt{c x^{2} + a} \right |}\right )}{c h^{2}} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate((f*x^2+e*x+d)/(h*x+g)/(c*x^2+a)^(1/2),x, algorithm="giac")

[Out]

sqrt(c*x^2 + a)*f/(c*h) + 2*(f*g^2 + d*h^2 - g*h*e)*arctan(-((sqrt(c)*x - sqrt(c*x^2 + a))*h + sqrt(c)*g)/sqrt
(-c*g^2 - a*h^2))/(sqrt(-c*g^2 - a*h^2)*h^2) + (sqrt(c)*f*g - sqrt(c)*h*e)*log(abs(-sqrt(c)*x + sqrt(c*x^2 + a
)))/(c*h^2)