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

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

[Out]

(b^2*e*f - b*(c*d*f + a*e*g + a*d*h) - 2*a*(c*e*f - c*d*g - a*e*h) - (2*c^2*d*f + b*(b*d - a*e)*h - c*(b*e*f +
b*d*g - 2*a*e*g + 2*a*d*h))*x)/((b^2 - 4*a*c)*(c*d^2 - b*d*e + a*e^2)*(a + b*x + c*x^2)) + ((4*c^3*d^3*f + b*
e*(4*a*b*d*e*h - 2*a^2*e^2*h + b^2*(e^2*f - d*e*g - d^2*h)) - 2*c^2*d*(b*d*(3*e*f + d*g) - 2*a*(3*e^2*f - d*e*
g + d^2*h)) + 2*c*e*(2*b^2*d^2*g + 2*a^2*e*(e*g - d*h) - a*b*(3*e^2*f + d*e*g + d^2*h)))*ArcTanh[(b + 2*c*x)/S
qrt[b^2 - 4*a*c]])/((b^2 - 4*a*c)^(3/2)*(c*d^2 - b*d*e + a*e^2)^2) + (e*(e^2*f - d*e*g + d^2*h)*Log[d + e*x])/
(c*d^2 - b*d*e + a*e^2)^2 - (e*(e^2*f - d*e*g + d^2*h)*Log[a + b*x + c*x^2])/(2*(c*d^2 - b*d*e + a*e^2)^2)

________________________________________________________________________________________

Rubi [A]  time = 1.08674, antiderivative size = 407, normalized size of antiderivative = 1., number of steps used = 7, number of rules used = 6, integrand size = 30, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.2, Rules used = {1646, 800, 634, 618, 206, 628} $\frac{\tanh ^{-1}\left (\frac{b+2 c x}{\sqrt{b^2-4 a c}}\right ) \left (2 c e \left (2 a^2 e (e g-d h)-a b \left (d^2 h+d e g+3 e^2 f\right )+2 b^2 d^2 g\right )+b e \left (-2 a^2 e^2 h+4 a b d e h+b^2 \left (d^2 (-h)-d e g+e^2 f\right )\right )-2 c^2 d \left (b d (d g+3 e f)-2 a \left (d^2 h-d e g+3 e^2 f\right )\right )+4 c^3 d^3 f\right )}{\left (b^2-4 a c\right )^{3/2} \left (a e^2-b d e+c d^2\right )^2}+\frac{-x \left (-c (2 a d h-2 a e g+b d g+b e f)+b h (b d-a e)+2 c^2 d f\right )-b (a d h+a e g+c d f)-2 a (-a e h-c d g+c e f)+b^2 e f}{\left (b^2-4 a c\right ) \left (a+b x+c x^2\right ) \left (a e^2-b d e+c d^2\right )}-\frac{e \log \left (a+b x+c x^2\right ) \left (d^2 h-d e g+e^2 f\right )}{2 \left (a e^2-b d e+c d^2\right )^2}+\frac{e \log (d+e x) \left (d^2 h-d e g+e^2 f\right )}{\left (a e^2-b d e+c d^2\right )^2}$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

(b^2*e*f - b*(c*d*f + a*e*g + a*d*h) - 2*a*(c*e*f - c*d*g - a*e*h) - (2*c^2*d*f + b*(b*d - a*e)*h - c*(b*e*f +
b*d*g - 2*a*e*g + 2*a*d*h))*x)/((b^2 - 4*a*c)*(c*d^2 - b*d*e + a*e^2)*(a + b*x + c*x^2)) + ((4*c^3*d^3*f + b*
e*(4*a*b*d*e*h - 2*a^2*e^2*h + b^2*(e^2*f - d*e*g - d^2*h)) - 2*c^2*d*(b*d*(3*e*f + d*g) - 2*a*(3*e^2*f - d*e*
g + d^2*h)) + 2*c*e*(2*b^2*d^2*g + 2*a^2*e*(e*g - d*h) - a*b*(3*e^2*f + d*e*g + d^2*h)))*ArcTanh[(b + 2*c*x)/S
qrt[b^2 - 4*a*c]])/((b^2 - 4*a*c)^(3/2)*(c*d^2 - b*d*e + a*e^2)^2) + (e*(e^2*f - d*e*g + d^2*h)*Log[d + e*x])/
(c*d^2 - b*d*e + a*e^2)^2 - (e*(e^2*f - d*e*g + d^2*h)*Log[a + b*x + c*x^2])/(2*(c*d^2 - b*d*e + a*e^2)^2)

Rule 1646

Int[(Pq_)*((d_.) + (e_.)*(x_))^(m_.)*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> With[{Q = Polynomi
alQuotient[(d + e*x)^m*Pq, a + b*x + c*x^2, x], f = Coeff[PolynomialRemainder[(d + e*x)^m*Pq, a + b*x + c*x^2,
x], x, 0], g = Coeff[PolynomialRemainder[(d + e*x)^m*Pq, a + b*x + c*x^2, x], x, 1]}, Simp[((b*f - 2*a*g + (2
*c*f - b*g)*x)*(a + b*x + c*x^2)^(p + 1))/((p + 1)*(b^2 - 4*a*c)), x] + Dist[1/((p + 1)*(b^2 - 4*a*c)), Int[(d
+ e*x)^m*(a + b*x + c*x^2)^(p + 1)*ExpandToSum[((p + 1)*(b^2 - 4*a*c)*Q)/(d + e*x)^m - ((2*p + 3)*(2*c*f - b*
g))/(d + e*x)^m, x], x], x]] /; FreeQ[{a, b, c, d, e}, x] && PolyQ[Pq, x] && NeQ[b^2 - 4*a*c, 0] && NeQ[c*d^2
- b*d*e + a*e^2, 0] && LtQ[p, -1] && ILtQ[m, 0]

Rule 800

Int[(((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_)))/((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Int[Exp
andIntegrand[((d + e*x)^m*(f + g*x))/(a + b*x + c*x^2), x], x] /; FreeQ[{a, b, c, d, e, f, g}, x] && NeQ[b^2 -
4*a*c, 0] && NeQ[c*d^2 - b*d*e + a*e^2, 0] && IntegerQ[m]

Rule 634

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

Rule 618

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> Dist[-2, Subst[Int[1/Simp[b^2 - 4*a*c - x^2, x], x]
, x, b + 2*c*x], x] /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 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 628

Int[((d_) + (e_.)*(x_))/((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Simp[(d*Log[RemoveContent[a + b*x +
c*x^2, x]])/b, x] /; FreeQ[{a, b, c, d, e}, x] && EqQ[2*c*d - b*e, 0]

Rubi steps

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

Mathematica [A]  time = 1.14962, size = 405, normalized size = 1. $-\frac{\tan ^{-1}\left (\frac{b+2 c x}{\sqrt{4 a c-b^2}}\right ) \left (2 c e \left (2 a^2 e (d h-e g)+a b \left (d^2 h+d e g+3 e^2 f\right )-2 b^2 d^2 g\right )+b e \left (2 a^2 e^2 h-4 a b d e h+b^2 \left (d^2 h+d e g-e^2 f\right )\right )+2 c^2 d \left (b d (d g+3 e f)-2 a \left (d^2 h-d e g+3 e^2 f\right )\right )-4 c^3 d^3 f\right )}{\left (4 a c-b^2\right )^{3/2} \left (e (a e-b d)+c d^2\right )^2}+\frac{-2 a^2 e h+a b (d h+e (g-h x))+2 a c (e (f+g x)-d (g+h x))+b^2 (d h x-e f)+b c (d (f-g x)-e f x)+2 c^2 d f x}{\left (b^2-4 a c\right ) (a+x (b+c x)) \left (e (b d-a e)-c d^2\right )}+\frac{e \log (d+e x) \left (d^2 h-d e g+e^2 f\right )}{\left (e (a e-b d)+c d^2\right )^2}-\frac{e \log (a+x (b+c x)) \left (d^2 h-d e g+e^2 f\right )}{2 \left (e (a e-b d)+c d^2\right )^2}$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [B]  time = 0.199, size = 3202, normalized size = 7.9 \begin{align*} \text{output too large to display} \end{align*}

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

[In]

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

[Out]

1/(a*e^2-b*d*e+c*d^2)^2/(c*x^2+b*x+a)/(4*a*c-b^2)*x*a*b*c*d^2*e*h-3/(a*e^2-b*d*e+c*d^2)^2/(c*x^2+b*x+a)/(4*a*c
-b^2)*x*a*b*c*d*e^2*g-2/(a*e^2-b*d*e+c*d^2)^2/(c*x^2+b*x+a)/(4*a*c-b^2)*a^2*c*d*e^2*g-1/(a*e^2-b*d*e+c*d^2)^2/
(c*x^2+b*x+a)/(4*a*c-b^2)*a*b^2*d^2*e*h+e^3/(a*e^2-b*d*e+c*d^2)^2*ln(e*x+d)*f-4/(a*e^2-b*d*e+c*d^2)^2/(4*a*c-b
^2)^(3/2)*arctan((2*c*x+b)/(4*a*c-b^2)^(1/2))*a^2*c*d*e^2*h+4/(a*e^2-b*d*e+c*d^2)^2/(4*a*c-b^2)^(3/2)*arctan((
2*c*x+b)/(4*a*c-b^2)^(1/2))*a*b^2*d*e^2*h-6/(a*e^2-b*d*e+c*d^2)^2/(4*a*c-b^2)^(3/2)*arctan((2*c*x+b)/(4*a*c-b^
2)^(1/2))*a*b*c*e^3*f-4/(a*e^2-b*d*e+c*d^2)^2/(4*a*c-b^2)^(3/2)*arctan((2*c*x+b)/(4*a*c-b^2)^(1/2))*a*c^2*d^2*
e*g+12/(a*e^2-b*d*e+c*d^2)^2/(4*a*c-b^2)^(3/2)*arctan((2*c*x+b)/(4*a*c-b^2)^(1/2))*a*c^2*d*e^2*f-1/(a*e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/(a*e^2-b*d*e+c*d^2)^2/(4*a*c-b^2)^(3/2)*arctan((2*c*x+b)/(4*a*c-b^2)^(1/2))*b^3*d*e^2*g-2/(a*e^2-b*d*e+
c*d^2)^2/(4*a*c-b^2)^(3/2)*arctan((2*c*x+b)/(4*a*c-b^2)^(1/2))*b*c^2*d^3*g+2/(a*e^2-b*d*e+c*d^2)^2/(c*x^2+b*x+
a)/(4*a*c-b^2)*a^2*c*e^3*f-1/(a*e^2-b*d*e+c*d^2)^2/(c*x^2+b*x+a)/(4*a*c-b^2)*a*b^2*e^3*f-2/(a*e^2-b*d*e+c*d^2)
^2/(c*x^2+b*x+a)/(4*a*c-b^2)*a*c^2*d^3*g

________________________________________________________________________________________

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((h*x^2+g*x+f)/(e*x+d)/(c*x^2+b*x+a)^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((h*x^2+g*x+f)/(e*x+d)/(c*x^2+b*x+a)^2,x, algorithm="fricas")

[Out]

Timed out

________________________________________________________________________________________

Sympy [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((h*x**2+g*x+f)/(e*x+d)/(c*x**2+b*x+a)**2,x)

[Out]

Timed out

________________________________________________________________________________________

Giac [B]  time = 1.3405, size = 1161, normalized size = 2.85 \begin{align*} \text{result too large to display} \end{align*}

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

[In]

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

[Out]

-1/2*(d^2*h*e - d*g*e^2 + f*e^3)*log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