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

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.234886, antiderivative size = 168, 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 = {1651, 844, 217, 206, 725} $-\frac{\sqrt{a+c x^2} \left (d h^2-e g h+f g^2\right )}{h (g+h x) \left (a h^2+c g^2\right )}+\frac{\tanh ^{-1}\left (\frac{a h-c g x}{\sqrt{a+c x^2} \sqrt{a h^2+c g^2}}\right ) \left (a h^2 (2 f g-e h)+c \left (f g^3-d g h^2\right )\right )}{h^2 \left (a h^2+c g^2\right )^{3/2}}+\frac{f \tanh ^{-1}\left (\frac{\sqrt{c} x}{\sqrt{a+c x^2}}\right )}{\sqrt{c} h^2}$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

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

Rule 1651

Int[(Pq_)*((d_) + (e_.)*(x_))^(m_)*((a_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> With[{Q = PolynomialQuotient[Pq, d
+ e*x, x], R = PolynomialRemainder[Pq, d + e*x, x]}, Simp[(e*R*(d + e*x)^(m + 1)*(a + c*x^2)^(p + 1))/((m + 1
)*(c*d^2 + a*e^2)), x] + Dist[1/((m + 1)*(c*d^2 + a*e^2)), Int[(d + e*x)^(m + 1)*(a + c*x^2)^p*ExpandToSum[(m
+ 1)*(c*d^2 + a*e^2)*Q + c*d*R*(m + 1) - c*e*R*(m + 2*p + 3)*x, x], x], x]] /; FreeQ[{a, c, d, e, p}, x] && Po
lyQ[Pq, x] && NeQ[c*d^2 + a*e^2, 0] && LtQ[m, -1]

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)^2 \sqrt{a+c x^2}} \, dx &=-\frac{\left (f g^2-e g h+d h^2\right ) \sqrt{a+c x^2}}{h \left (c g^2+a h^2\right ) (g+h x)}-\frac{\int \frac{-c d g+a f g-a e h-f \left (\frac{c g^2}{h}+a h\right ) x}{(g+h x) \sqrt{a+c x^2}} \, dx}{c g^2+a h^2}\\ &=-\frac{\left (f g^2-e g h+d h^2\right ) \sqrt{a+c x^2}}{h \left (c g^2+a h^2\right ) (g+h x)}+\frac{f \int \frac{1}{\sqrt{a+c x^2}} \, dx}{h^2}+\frac{\left (c d g-2 a f g-\frac{c f g^3}{h^2}+a e h\right ) \int \frac{1}{(g+h x) \sqrt{a+c x^2}} \, dx}{c g^2+a h^2}\\ &=-\frac{\left (f g^2-e g h+d h^2\right ) \sqrt{a+c x^2}}{h \left (c g^2+a h^2\right ) (g+h x)}+\frac{f \operatorname{Subst}\left (\int \frac{1}{1-c x^2} \, dx,x,\frac{x}{\sqrt{a+c x^2}}\right )}{h^2}-\frac{\left (c d g-2 a f g-\frac{c f g^3}{h^2}+a e h\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 )}{c g^2+a h^2}\\ &=-\frac{\left (f g^2-e g h+d h^2\right ) \sqrt{a+c x^2}}{h \left (c g^2+a h^2\right ) (g+h x)}+\frac{f \tanh ^{-1}\left (\frac{\sqrt{c} x}{\sqrt{a+c x^2}}\right )}{\sqrt{c} h^2}-\frac{\left (c d g-2 a f g-\frac{c f g^3}{h^2}+a e h\right ) \tanh ^{-1}\left (\frac{a h-c g x}{\sqrt{c g^2+a h^2} \sqrt{a+c x^2}}\right )}{\left (c g^2+a h^2\right )^{3/2}}\\ \end{align*}

Mathematica [A]  time = 0.418786, size = 218, normalized size = 1.3 $\frac{-\frac{h \sqrt{a+c x^2} \left (h (d h-e g)+f g^2\right )}{(g+h x) \left (a h^2+c g^2\right )}+\frac{\log \left (\sqrt{a+c x^2} \sqrt{a h^2+c g^2}+a h-c g x\right ) \left (a h^2 (2 f g-e h)+c \left (f g^3-d g h^2\right )\right )}{\left (a h^2+c g^2\right )^{3/2}}+\frac{\log (g+h x) \left (a h^2 (e h-2 f g)+c \left (d g h^2-f g^3\right )\right )}{\left (a h^2+c g^2\right )^{3/2}}+\frac{f \log \left (\sqrt{c} \sqrt{a+c x^2}+c x\right )}{\sqrt{c}}}{h^2}$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [B]  time = 0.249, size = 923, normalized size = 5.5 \begin{align*} \text{result too large to display} \end{align*}

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

[In]

int((f*x^2+e*x+d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3/(a*h^2+c*g^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))*f

________________________________________________________________________________________

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)^2/(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)^2/(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 )^{2}}\, 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)**2/(c*x**2+a)**(1/2),x)

[Out]

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

________________________________________________________________________________________

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

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

[In]

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

[Out]

Exception raised: RuntimeError