3.5.75 \(\int (d+e x+f \sqrt {a+b x+\frac {e^2 x^2}{f^2}}) \, dx\) [475]

Optimal. Leaf size=118 \[ d x+\frac {e x^2}{2}+\frac {f \left (b f^2+2 e^2 x\right ) \sqrt {a+b x+\frac {e^2 x^2}{f^2}}}{4 e^2}+\frac {f^2 \left (4 a e^2-b^2 f^2\right ) \tanh ^{-1}\left (\frac {b f^2+2 e^2 x}{2 e f \sqrt {a+b x+\frac {e^2 x^2}{f^2}}}\right )}{8 e^3} \]

[Out]

d*x+1/2*e*x^2+1/8*f^2*(-b^2*f^2+4*a*e^2)*arctanh(1/2*(b*f^2+2*e^2*x)/e/f/(a+b*x+e^2*x^2/f^2)^(1/2))/e^3+1/4*f*
(b*f^2+2*e^2*x)*(a+b*x+e^2*x^2/f^2)^(1/2)/e^2

________________________________________________________________________________________

Rubi [A]
time = 0.05, antiderivative size = 118, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 26, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.115, Rules used = {626, 635, 212} \begin {gather*} \frac {f^2 \left (4 a e^2-b^2 f^2\right ) \tanh ^{-1}\left (\frac {b f^2+2 e^2 x}{2 e f \sqrt {a+b x+\frac {e^2 x^2}{f^2}}}\right )}{8 e^3}+\frac {f \left (b f^2+2 e^2 x\right ) \sqrt {a+b x+\frac {e^2 x^2}{f^2}}}{4 e^2}+d x+\frac {e x^2}{2} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

d*x + (e*x^2)/2 + (f*(b*f^2 + 2*e^2*x)*Sqrt[a + b*x + (e^2*x^2)/f^2])/(4*e^2) + (f^2*(4*a*e^2 - b^2*f^2)*ArcTa
nh[(b*f^2 + 2*e^2*x)/(2*e*f*Sqrt[a + b*x + (e^2*x^2)/f^2])])/(8*e^3)

Rule 212

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] && (GtQ[a, 0] || LtQ[b, 0])

Rule 626

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Simp[(b + 2*c*x)*((a + b*x + c*x^2)^p/(2*c*(2*p + 1
))), x] - Dist[p*((b^2 - 4*a*c)/(2*c*(2*p + 1))), Int[(a + b*x + c*x^2)^(p - 1), x], x] /; FreeQ[{a, b, c}, x]
 && NeQ[b^2 - 4*a*c, 0] && GtQ[p, 0] && IntegerQ[4*p]

Rule 635

Int[1/Sqrt[(a_) + (b_.)*(x_) + (c_.)*(x_)^2], x_Symbol] :> Dist[2, Subst[Int[1/(4*c - x^2), x], x, (b + 2*c*x)
/Sqrt[a + b*x + c*x^2]], x] /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0]

Rubi steps

\begin {align*} \int \left (d+e x+f \sqrt {a+b x+\frac {e^2 x^2}{f^2}}\right ) \, dx &=d x+\frac {e x^2}{2}+f \int \sqrt {a+b x+\frac {e^2 x^2}{f^2}} \, dx\\ &=d x+\frac {e x^2}{2}+\frac {f \left (b f^2+2 e^2 x\right ) \sqrt {a+b x+\frac {e^2 x^2}{f^2}}}{4 e^2}+\frac {1}{8} \left (f \left (4 a-\frac {b^2 f^2}{e^2}\right )\right ) \int \frac {1}{\sqrt {a+b x+\frac {e^2 x^2}{f^2}}} \, dx\\ &=d x+\frac {e x^2}{2}+\frac {f \left (b f^2+2 e^2 x\right ) \sqrt {a+b x+\frac {e^2 x^2}{f^2}}}{4 e^2}+\frac {1}{4} \left (f \left (4 a-\frac {b^2 f^2}{e^2}\right )\right ) \text {Subst}\left (\int \frac {1}{\frac {4 e^2}{f^2}-x^2} \, dx,x,\frac {b+\frac {2 e^2 x}{f^2}}{\sqrt {a+b x+\frac {e^2 x^2}{f^2}}}\right )\\ &=d x+\frac {e x^2}{2}+\frac {f \left (b f^2+2 e^2 x\right ) \sqrt {a+b x+\frac {e^2 x^2}{f^2}}}{4 e^2}+\frac {f^2 \left (4 a e^2-b^2 f^2\right ) \tanh ^{-1}\left (\frac {b f^2+2 e^2 x}{2 e f \sqrt {a+b x+\frac {e^2 x^2}{f^2}}}\right )}{8 e^3}\\ \end {align*}

________________________________________________________________________________________

Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(478\) vs. \(2(118)=236\).
time = 2.26, size = 478, normalized size = 4.05 \begin {gather*} d x+\frac {e x^2}{2}+\frac {f \left (b f^2+2 e^2 x\right ) \sqrt {a+x \left (b+\frac {e^2 x}{f^2}\right )}}{4 e^2}+\frac {f \left (4 a e^2 f-b^2 f^3\right ) \sqrt {a+x \left (b+\frac {e^2 x}{f^2}\right )} \tanh ^{-1}\left (\frac {-2 e \sqrt {\frac {e^2}{f^2}} x+2 e \sqrt {a+b x+\frac {e^2 x^2}{f^2}}}{b f}\right )}{8 e^3 \sqrt {a+b x+\frac {e^2 x^2}{f^2}}}+\frac {b^2 \sqrt {\frac {e^2}{f^2}} f^5 \sqrt {a+x \left (b+\frac {e^2 x}{f^2}\right )} \log \left (b f+2 e \sqrt {\frac {e^2}{f^2}} x-2 e \sqrt {a+b x+\frac {e^2 x^2}{f^2}}\right )}{16 e^4 \sqrt {a+b x+\frac {e^2 x^2}{f^2}}}-\frac {\sqrt {\frac {e^2}{f^2}} f \left (4 a e^2 f^2-b^2 f^4\right ) \sqrt {a+x \left (b+\frac {e^2 x}{f^2}\right )} \log \left (b f-2 e \sqrt {\frac {e^2}{f^2}} x+2 e \sqrt {a+b x+\frac {e^2 x^2}{f^2}}\right )}{16 e^4 \sqrt {a+b x+\frac {e^2 x^2}{f^2}}}-\frac {a f \sqrt {a+x \left (b+\frac {e^2 x}{f^2}\right )} \log \left (-b e f-2 e^2 \sqrt {\frac {e^2}{f^2}} x+2 e^2 \sqrt {a+b x+\frac {e^2 x^2}{f^2}}\right )}{4 \sqrt {\frac {e^2}{f^2}} \sqrt {a+b x+\frac {e^2 x^2}{f^2}}} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

d*x + (e*x^2)/2 + (f*(b*f^2 + 2*e^2*x)*Sqrt[a + x*(b + (e^2*x)/f^2)])/(4*e^2) + (f*(4*a*e^2*f - b^2*f^3)*Sqrt[
a + x*(b + (e^2*x)/f^2)]*ArcTanh[(-2*e*Sqrt[e^2/f^2]*x + 2*e*Sqrt[a + b*x + (e^2*x^2)/f^2])/(b*f)])/(8*e^3*Sqr
t[a + b*x + (e^2*x^2)/f^2]) + (b^2*Sqrt[e^2/f^2]*f^5*Sqrt[a + x*(b + (e^2*x)/f^2)]*Log[b*f + 2*e*Sqrt[e^2/f^2]
*x - 2*e*Sqrt[a + b*x + (e^2*x^2)/f^2]])/(16*e^4*Sqrt[a + b*x + (e^2*x^2)/f^2]) - (Sqrt[e^2/f^2]*f*(4*a*e^2*f^
2 - b^2*f^4)*Sqrt[a + x*(b + (e^2*x)/f^2)]*Log[b*f - 2*e*Sqrt[e^2/f^2]*x + 2*e*Sqrt[a + b*x + (e^2*x^2)/f^2]])
/(16*e^4*Sqrt[a + b*x + (e^2*x^2)/f^2]) - (a*f*Sqrt[a + x*(b + (e^2*x)/f^2)]*Log[-(b*e*f) - 2*e^2*Sqrt[e^2/f^2
]*x + 2*e^2*Sqrt[a + b*x + (e^2*x^2)/f^2]])/(4*Sqrt[e^2/f^2]*Sqrt[a + b*x + (e^2*x^2)/f^2])

________________________________________________________________________________________

Maple [A]
time = 0.31, size = 173, normalized size = 1.47

method result size
default \(d x +\frac {e \,x^{2}}{2}+\frac {f^{3} \sqrt {a +b x +\frac {e^{2} x^{2}}{f^{2}}}\, b}{4 e^{2}}+\frac {f \sqrt {a +b x +\frac {e^{2} x^{2}}{f^{2}}}\, x}{2}+\frac {f \ln \left (\frac {\frac {b}{2}+\frac {e^{2} x}{f^{2}}}{\sqrt {\frac {e^{2}}{f^{2}}}}+\sqrt {a +b x +\frac {e^{2} x^{2}}{f^{2}}}\right ) a}{2 \sqrt {\frac {e^{2}}{f^{2}}}}-\frac {f^{3} \ln \left (\frac {\frac {b}{2}+\frac {e^{2} x}{f^{2}}}{\sqrt {\frac {e^{2}}{f^{2}}}}+\sqrt {a +b x +\frac {e^{2} x^{2}}{f^{2}}}\right ) b^{2}}{8 e^{2} \sqrt {\frac {e^{2}}{f^{2}}}}\) \(173\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(d+e*x+f*(a+b*x+1/f^2*e^2*x^2)^(1/2),x,method=_RETURNVERBOSE)

[Out]

d*x+1/2*e*x^2+1/4*f^3/e^2*(a+b*x+1/f^2*e^2*x^2)^(1/2)*b+1/2*f*(a+b*x+1/f^2*e^2*x^2)^(1/2)*x+1/2*f*ln((1/2*b+1/
f^2*e^2*x)/(1/f^2*e^2)^(1/2)+(a+b*x+1/f^2*e^2*x^2)^(1/2))/(1/f^2*e^2)^(1/2)*a-1/8*f^3/e^2*ln((1/2*b+1/f^2*e^2*
x)/(1/f^2*e^2)^(1/2)+(a+b*x+1/f^2*e^2*x^2)^(1/2))/(1/f^2*e^2)^(1/2)*b^2

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume(b^2*f^2-4*%e^2*a>0)', see `ass
ume?` for mo

________________________________________________________________________________________

Fricas [A]
time = 0.38, size = 117, normalized size = 0.99 \begin {gather*} \frac {1}{8} \, {\left (4 \, x^{2} e^{4} + 8 \, d x e^{3} + {\left (b^{2} f^{4} - 4 \, a f^{2} e^{2}\right )} \log \left (-b f^{2} + 2 \, f \sqrt {\frac {b f^{2} x + a f^{2} + x^{2} e^{2}}{f^{2}}} e - 2 \, x e^{2}\right ) + 2 \, {\left (b f^{3} e + 2 \, f x e^{3}\right )} \sqrt {\frac {b f^{2} x + a f^{2} + x^{2} e^{2}}{f^{2}}}\right )} e^{\left (-3\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/8*(4*x^2*e^4 + 8*d*x*e^3 + (b^2*f^4 - 4*a*f^2*e^2)*log(-b*f^2 + 2*f*sqrt((b*f^2*x + a*f^2 + x^2*e^2)/f^2)*e
- 2*x*e^2) + 2*(b*f^3*e + 2*f*x*e^3)*sqrt((b*f^2*x + a*f^2 + x^2*e^2)/f^2))*e^(-3)

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(d+e*x+f*(a+b*x+e**2*x**2/f**2)**(1/2),x)

[Out]

Integral(d + e*x + f*sqrt(a + b*x + e**2*x**2/f**2), x)

________________________________________________________________________________________

Giac [A]
time = 2.91, size = 111, normalized size = 0.94 \begin {gather*} \frac {1}{2} \, x^{2} e + d x + \frac {{\left ({\left (b^{2} f^{4} - 4 \, a f^{2} e^{2}\right )} e^{\left (-3\right )} \log \left ({\left | -b f^{2} - 2 \, {\left (x e - \sqrt {b f^{2} x + a f^{2} + x^{2} e^{2}}\right )} e \right |}\right ) + 2 \, \sqrt {b f^{2} x + a f^{2} + x^{2} e^{2}} {\left (b f^{2} e^{\left (-2\right )} + 2 \, x\right )}\right )} {\left | f \right |}}{8 \, f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/2*x^2*e + d*x + 1/8*((b^2*f^4 - 4*a*f^2*e^2)*e^(-3)*log(abs(-b*f^2 - 2*(x*e - sqrt(b*f^2*x + a*f^2 + x^2*e^2
))*e)) + 2*sqrt(b*f^2*x + a*f^2 + x^2*e^2)*(b*f^2*e^(-2) + 2*x))*abs(f)/f

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int d+e\,x+f\,\sqrt {a+b\,x+\frac {e^2\,x^2}{f^2}} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(d + e*x + f*(a + b*x + (e^2*x^2)/f^2)^(1/2),x)

[Out]

int(d + e*x + f*(a + b*x + (e^2*x^2)/f^2)^(1/2), x)

________________________________________________________________________________________