3.574 \(\int \frac{\left (d+e e^{h+i x}\right ) (f+g x)}{a+b e^{h+i x}+c e^{2 h+2 i x}} \, dx\)

Optimal. Leaf size=428 \[ -\frac{g \left (\frac{2 c d-b e}{\sqrt{b^2-4 a c}}+e\right ) \text{PolyLog}\left (2,-\frac{2 c e^{h+i x}}{b-\sqrt{b^2-4 a c}}\right )}{i^2 \left (b-\sqrt{b^2-4 a c}\right )}-\frac{g \left (e-\frac{2 c d-b e}{\sqrt{b^2-4 a c}}\right ) \text{PolyLog}\left (2,-\frac{2 c e^{h+i x}}{\sqrt{b^2-4 a c}+b}\right )}{i^2 \left (\sqrt{b^2-4 a c}+b\right )}-\frac{(f+g x) \left (\frac{2 c d-b e}{\sqrt{b^2-4 a c}}+e\right ) \log \left (\frac{2 c e^{h+i x}}{b-\sqrt{b^2-4 a c}}+1\right )}{i \left (b-\sqrt{b^2-4 a c}\right )}-\frac{(f+g x) \left (e-\frac{2 c d-b e}{\sqrt{b^2-4 a c}}\right ) \log \left (\frac{2 c e^{h+i x}}{\sqrt{b^2-4 a c}+b}+1\right )}{i \left (\sqrt{b^2-4 a c}+b\right )}+\frac{(f+g x)^2 \left (e-\frac{2 c d-b e}{\sqrt{b^2-4 a c}}\right )}{2 g \left (\sqrt{b^2-4 a c}+b\right )}+\frac{(f+g x)^2 \left (\frac{2 c d-b e}{\sqrt{b^2-4 a c}}+e\right )}{2 g \left (b-\sqrt{b^2-4 a c}\right )} \]

[Out]

((e - (2*c*d - b*e)/Sqrt[b^2 - 4*a*c])*(f + g*x)^2)/(2*(b + Sqrt[b^2 - 4*a*c])*g
) + ((e + (2*c*d - b*e)/Sqrt[b^2 - 4*a*c])*(f + g*x)^2)/(2*(b - Sqrt[b^2 - 4*a*c
])*g) - ((e + (2*c*d - b*e)/Sqrt[b^2 - 4*a*c])*(f + g*x)*Log[1 + (2*c*E^(h + i*x
))/(b - Sqrt[b^2 - 4*a*c])])/((b - Sqrt[b^2 - 4*a*c])*i) - ((e - (2*c*d - b*e)/S
qrt[b^2 - 4*a*c])*(f + g*x)*Log[1 + (2*c*E^(h + i*x))/(b + Sqrt[b^2 - 4*a*c])])/
((b + Sqrt[b^2 - 4*a*c])*i) - ((e + (2*c*d - b*e)/Sqrt[b^2 - 4*a*c])*g*PolyLog[2
, (-2*c*E^(h + i*x))/(b - Sqrt[b^2 - 4*a*c])])/((b - Sqrt[b^2 - 4*a*c])*i^2) - (
(e - (2*c*d - b*e)/Sqrt[b^2 - 4*a*c])*g*PolyLog[2, (-2*c*E^(h + i*x))/(b + Sqrt[
b^2 - 4*a*c])])/((b + Sqrt[b^2 - 4*a*c])*i^2)

_______________________________________________________________________________________

Rubi [A]  time = 0.980133, antiderivative size = 428, normalized size of antiderivative = 1., number of steps used = 9, number of rules used = 5, integrand size = 42, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.119 \[ -\frac{g \left (\frac{2 c d-b e}{\sqrt{b^2-4 a c}}+e\right ) \text{PolyLog}\left (2,-\frac{2 c e^{h+i x}}{b-\sqrt{b^2-4 a c}}\right )}{i^2 \left (b-\sqrt{b^2-4 a c}\right )}-\frac{g \left (e-\frac{2 c d-b e}{\sqrt{b^2-4 a c}}\right ) \text{PolyLog}\left (2,-\frac{2 c e^{h+i x}}{\sqrt{b^2-4 a c}+b}\right )}{i^2 \left (\sqrt{b^2-4 a c}+b\right )}-\frac{(f+g x) \left (\frac{2 c d-b e}{\sqrt{b^2-4 a c}}+e\right ) \log \left (\frac{2 c e^{h+i x}}{b-\sqrt{b^2-4 a c}}+1\right )}{i \left (b-\sqrt{b^2-4 a c}\right )}-\frac{(f+g x) \left (e-\frac{2 c d-b e}{\sqrt{b^2-4 a c}}\right ) \log \left (\frac{2 c e^{h+i x}}{\sqrt{b^2-4 a c}+b}+1\right )}{i \left (\sqrt{b^2-4 a c}+b\right )}+\frac{(f+g x)^2 \left (e-\frac{2 c d-b e}{\sqrt{b^2-4 a c}}\right )}{2 g \left (\sqrt{b^2-4 a c}+b\right )}+\frac{(f+g x)^2 \left (\frac{2 c d-b e}{\sqrt{b^2-4 a c}}+e\right )}{2 g \left (b-\sqrt{b^2-4 a c}\right )} \]

Antiderivative was successfully verified.

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

[Out]

((e - (2*c*d - b*e)/Sqrt[b^2 - 4*a*c])*(f + g*x)^2)/(2*(b + Sqrt[b^2 - 4*a*c])*g
) + ((e + (2*c*d - b*e)/Sqrt[b^2 - 4*a*c])*(f + g*x)^2)/(2*(b - Sqrt[b^2 - 4*a*c
])*g) - ((e + (2*c*d - b*e)/Sqrt[b^2 - 4*a*c])*(f + g*x)*Log[1 + (2*c*E^(h + i*x
))/(b - Sqrt[b^2 - 4*a*c])])/((b - Sqrt[b^2 - 4*a*c])*i) - ((e - (2*c*d - b*e)/S
qrt[b^2 - 4*a*c])*(f + g*x)*Log[1 + (2*c*E^(h + i*x))/(b + Sqrt[b^2 - 4*a*c])])/
((b + Sqrt[b^2 - 4*a*c])*i) - ((e + (2*c*d - b*e)/Sqrt[b^2 - 4*a*c])*g*PolyLog[2
, (-2*c*E^(h + i*x))/(b - Sqrt[b^2 - 4*a*c])])/((b - Sqrt[b^2 - 4*a*c])*i^2) - (
(e - (2*c*d - b*e)/Sqrt[b^2 - 4*a*c])*g*PolyLog[2, (-2*c*E^(h + i*x))/(b + Sqrt[
b^2 - 4*a*c])])/((b + Sqrt[b^2 - 4*a*c])*i^2)

_______________________________________________________________________________________

Rubi in Sympy [A]  time = 84.7189, size = 314, normalized size = 0.73 \[ \frac{g \left (b e - 2 c d + e \sqrt{- 4 a c + b^{2}}\right ) \operatorname{Li}_{2}\left (- \frac{\left (b + \sqrt{- 4 a c + b^{2}}\right ) e^{- h - i x}}{2 c}\right )}{i^{2} \left (- 4 a c + b^{2} + b \sqrt{- 4 a c + b^{2}}\right )} + \frac{g \left (b e - 2 c d - e \sqrt{- 4 a c + b^{2}}\right ) \operatorname{Li}_{2}\left (- \frac{\left (b - \sqrt{- 4 a c + b^{2}}\right ) e^{- h - i x}}{2 c}\right )}{i^{2} \left (- 4 a c + b^{2} - b \sqrt{- 4 a c + b^{2}}\right )} - \frac{\left (f + g x\right ) \left (b e - 2 c d + e \sqrt{- 4 a c + b^{2}}\right ) \log{\left (1 + \frac{\left (b + \sqrt{- 4 a c + b^{2}}\right ) e^{- h - i x}}{2 c} \right )}}{i \left (- 4 a c + b^{2} + b \sqrt{- 4 a c + b^{2}}\right )} - \frac{\left (f + g x\right ) \left (b e - 2 c d - e \sqrt{- 4 a c + b^{2}}\right ) \log{\left (1 + \frac{\left (b - \sqrt{- 4 a c + b^{2}}\right ) e^{- h - i x}}{2 c} \right )}}{i \left (- 4 a c + b^{2} - b \sqrt{- 4 a c + b^{2}}\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  rubi_integrate((d+e*exp(i*x+h))*(g*x+f)/(a+b*exp(i*x+h)+c*exp(2*i*x+2*h)),x)

[Out]

g*(b*e - 2*c*d + e*sqrt(-4*a*c + b**2))*polylog(2, -(b + sqrt(-4*a*c + b**2))*ex
p(-h - i*x)/(2*c))/(i**2*(-4*a*c + b**2 + b*sqrt(-4*a*c + b**2))) + g*(b*e - 2*c
*d - e*sqrt(-4*a*c + b**2))*polylog(2, -(b - sqrt(-4*a*c + b**2))*exp(-h - i*x)/
(2*c))/(i**2*(-4*a*c + b**2 - b*sqrt(-4*a*c + b**2))) - (f + g*x)*(b*e - 2*c*d +
 e*sqrt(-4*a*c + b**2))*log(1 + (b + sqrt(-4*a*c + b**2))*exp(-h - i*x)/(2*c))/(
i*(-4*a*c + b**2 + b*sqrt(-4*a*c + b**2))) - (f + g*x)*(b*e - 2*c*d - e*sqrt(-4*
a*c + b**2))*log(1 + (b - sqrt(-4*a*c + b**2))*exp(-h - i*x)/(2*c))/(i*(-4*a*c +
 b**2 - b*sqrt(-4*a*c + b**2)))

_______________________________________________________________________________________

Mathematica [A]  time = 4.18702, size = 574, normalized size = 1.34 \[ -\frac{g \left (d \sqrt{-\left (b^2-4 a c\right )^2}+b d \sqrt{4 a c-b^2}-2 a e \sqrt{4 a c-b^2}\right ) \text{PolyLog}\left (2,\frac{2 c e^{h+i x}}{\sqrt{b^2-4 a c}-b}\right )+g \left (d \sqrt{-\left (b^2-4 a c\right )^2}-b d \sqrt{4 a c-b^2}+2 a e \sqrt{4 a c-b^2}\right ) \text{PolyLog}\left (2,-\frac{2 c e^{h+i x}}{\sqrt{b^2-4 a c}+b}\right )+i \left (2 f \sqrt{b^2-4 a c} (b d-2 a e) \tan ^{-1}\left (\frac{b+2 c e^{h+i x}}{\sqrt{4 a c-b^2}}\right )+g x \left (d \sqrt{-\left (b^2-4 a c\right )^2}+b d \sqrt{4 a c-b^2}-2 a e \sqrt{4 a c-b^2}\right ) \log \left (\frac{2 c e^{h+i x}}{b-\sqrt{b^2-4 a c}}+1\right )+d f \sqrt{-\left (b^2-4 a c\right )^2} \log \left (a+e^{h+i x} \left (b+c e^{h+i x}\right )\right )-2 d f i x \sqrt{-\left (b^2-4 a c\right )^2}+d g x \sqrt{-\left (b^2-4 a c\right )^2} \log \left (\frac{2 c e^{h+i x}}{\sqrt{b^2-4 a c}+b}+1\right )-b d g x \sqrt{4 a c-b^2} \log \left (\frac{2 c e^{h+i x}}{\sqrt{b^2-4 a c}+b}+1\right )+d g i x^2 \left (-\sqrt{-\left (b^2-4 a c\right )^2}\right )+2 a e g x \sqrt{4 a c-b^2} \log \left (\frac{2 c e^{h+i x}}{\sqrt{b^2-4 a c}+b}+1\right )\right )}{2 a i^2 \sqrt{-\left (b^2-4 a c\right )^2}} \]

Warning: Unable to verify antiderivative.

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

[Out]

-(i*(-2*Sqrt[-(b^2 - 4*a*c)^2]*d*f*i*x - Sqrt[-(b^2 - 4*a*c)^2]*d*g*i*x^2 + 2*Sq
rt[b^2 - 4*a*c]*(b*d - 2*a*e)*f*ArcTan[(b + 2*c*E^(h + i*x))/Sqrt[-b^2 + 4*a*c]]
 + (Sqrt[-(b^2 - 4*a*c)^2]*d + b*Sqrt[-b^2 + 4*a*c]*d - 2*a*Sqrt[-b^2 + 4*a*c]*e
)*g*x*Log[1 + (2*c*E^(h + i*x))/(b - Sqrt[b^2 - 4*a*c])] + Sqrt[-(b^2 - 4*a*c)^2
]*d*g*x*Log[1 + (2*c*E^(h + i*x))/(b + Sqrt[b^2 - 4*a*c])] - b*Sqrt[-b^2 + 4*a*c
]*d*g*x*Log[1 + (2*c*E^(h + i*x))/(b + Sqrt[b^2 - 4*a*c])] + 2*a*Sqrt[-b^2 + 4*a
*c]*e*g*x*Log[1 + (2*c*E^(h + i*x))/(b + Sqrt[b^2 - 4*a*c])] + Sqrt[-(b^2 - 4*a*
c)^2]*d*f*Log[a + E^(h + i*x)*(b + c*E^(h + i*x))]) + (Sqrt[-(b^2 - 4*a*c)^2]*d
+ b*Sqrt[-b^2 + 4*a*c]*d - 2*a*Sqrt[-b^2 + 4*a*c]*e)*g*PolyLog[2, (2*c*E^(h + i*
x))/(-b + Sqrt[b^2 - 4*a*c])] + (Sqrt[-(b^2 - 4*a*c)^2]*d - b*Sqrt[-b^2 + 4*a*c]
*d + 2*a*Sqrt[-b^2 + 4*a*c]*e)*g*PolyLog[2, (-2*c*E^(h + i*x))/(b + Sqrt[b^2 - 4
*a*c])])/(2*a*Sqrt[-(b^2 - 4*a*c)^2]*i^2)

_______________________________________________________________________________________

Maple [C]  time = 0.055, size = 1261, normalized size = 3. \[ \text{result too large to display} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  int((d+e*exp(i*x+h))*(g*x+f)/(a+b*exp(i*x+h)+c*exp(2*i*x+2*h)),x)

[Out]

d*f/i/a*ln(exp(i*x))-1/2*d*f/i/a*ln(a+b*exp(i*x)*exp(h)+c*exp(i*x)^2*exp(2*h))-d
*f/i/a*exp(h)*b/(4*a*c*exp(2*h)-exp(h)^2*b^2)^(1/2)*arctan((exp(h)*b+2*exp(2*h)*
exp(i*x)*c)/(4*a*c*exp(2*h)-exp(h)^2*b^2)^(1/2))+1/2*d*g/a*x^2-1/2*d*g/i/a*x/(ex
p(h)^2*b^2-4*a*c*exp(2*h))^(1/2)*ln((2*exp(2*h)*exp(i*x)*c+exp(h)*b-(exp(h)^2*b^
2-4*a*c*exp(2*h))^(1/2))/(exp(h)*b-(exp(h)^2*b^2-4*a*c*exp(2*h))^(1/2)))*exp(h)*
b+1/2*d*g/i/a*x/(exp(h)^2*b^2-4*a*c*exp(2*h))^(1/2)*ln((2*exp(2*h)*exp(i*x)*c+ex
p(h)*b+(exp(h)^2*b^2-4*a*c*exp(2*h))^(1/2))/(exp(h)*b+(exp(h)^2*b^2-4*a*c*exp(2*
h))^(1/2)))*exp(h)*b-1/2*d*g/i/a*x*ln((2*exp(2*h)*exp(i*x)*c+exp(h)*b-(exp(h)^2*
b^2-4*a*c*exp(2*h))^(1/2))/(exp(h)*b-(exp(h)^2*b^2-4*a*c*exp(2*h))^(1/2)))-1/2*d
*g/i/a*x*ln((2*exp(2*h)*exp(i*x)*c+exp(h)*b+(exp(h)^2*b^2-4*a*c*exp(2*h))^(1/2))
/(exp(h)*b+(exp(h)^2*b^2-4*a*c*exp(2*h))^(1/2)))-1/2*d*g/i^2/a/(exp(h)^2*b^2-4*a
*c*exp(2*h))^(1/2)*dilog((2*exp(2*h)*exp(i*x)*c+exp(h)*b-(exp(h)^2*b^2-4*a*c*exp
(2*h))^(1/2))/(exp(h)*b-(exp(h)^2*b^2-4*a*c*exp(2*h))^(1/2)))*exp(h)*b+1/2*d*g/i
^2/a/(exp(h)^2*b^2-4*a*c*exp(2*h))^(1/2)*dilog((2*exp(2*h)*exp(i*x)*c+exp(h)*b+(
exp(h)^2*b^2-4*a*c*exp(2*h))^(1/2))/(exp(h)*b+(exp(h)^2*b^2-4*a*c*exp(2*h))^(1/2
)))*exp(h)*b-1/2*d*g/i^2/a*dilog((2*exp(2*h)*exp(i*x)*c+exp(h)*b-(exp(h)^2*b^2-4
*a*c*exp(2*h))^(1/2))/(exp(h)*b-(exp(h)^2*b^2-4*a*c*exp(2*h))^(1/2)))-1/2*d*g/i^
2/a*dilog((2*exp(2*h)*exp(i*x)*c+exp(h)*b+(exp(h)^2*b^2-4*a*c*exp(2*h))^(1/2))/(
exp(h)*b+(exp(h)^2*b^2-4*a*c*exp(2*h))^(1/2)))+2*e*exp(h)*f/i/(4*a*c*exp(2*h)-ex
p(h)^2*b^2)^(1/2)*arctan((exp(h)*b+2*exp(2*h)*exp(i*x)*c)/(4*a*c*exp(2*h)-exp(h)
^2*b^2)^(1/2))+e*exp(h)*g/i*x/(exp(h)^2*b^2-4*a*c*exp(2*h))^(1/2)*ln((2*exp(2*h)
*exp(i*x)*c+exp(h)*b-(exp(h)^2*b^2-4*a*c*exp(2*h))^(1/2))/(exp(h)*b-(exp(h)^2*b^
2-4*a*c*exp(2*h))^(1/2)))-e*exp(h)*g/i*x/(exp(h)^2*b^2-4*a*c*exp(2*h))^(1/2)*ln(
(2*exp(2*h)*exp(i*x)*c+exp(h)*b+(exp(h)^2*b^2-4*a*c*exp(2*h))^(1/2))/(exp(h)*b+(
exp(h)^2*b^2-4*a*c*exp(2*h))^(1/2)))+e*exp(h)*g/i^2/(exp(h)^2*b^2-4*a*c*exp(2*h)
)^(1/2)*dilog((2*exp(2*h)*exp(i*x)*c+exp(h)*b-(exp(h)^2*b^2-4*a*c*exp(2*h))^(1/2
))/(exp(h)*b-(exp(h)^2*b^2-4*a*c*exp(2*h))^(1/2)))-e*exp(h)*g/i^2/(exp(h)^2*b^2-
4*a*c*exp(2*h))^(1/2)*dilog((2*exp(2*h)*exp(i*x)*c+exp(h)*b+(exp(h)^2*b^2-4*a*c*
exp(2*h))^(1/2))/(exp(h)*b+(exp(h)^2*b^2-4*a*c*exp(2*h))^(1/2)))

_______________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((g*x + f)*(e*e^(i*x + h) + d)/(c*e^(2*i*x + 2*h) + b*e^(i*x + h) + a),x, algorithm="maxima")

[Out]

Exception raised: ValueError

_______________________________________________________________________________________

Fricas [A]  time = 0.284355, size = 936, normalized size = 2.19 \[ \text{result too large to display} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((g*x + f)*(e*e^(i*x + h) + d)/(c*e^(2*i*x + 2*h) + b*e^(i*x + h) + a),x, algorithm="fricas")

[Out]

1/2*((b^2 - 4*a*c)*d*g*i^2*x^2 + 2*(b^2 - 4*a*c)*d*f*i^2*x - ((b^2 - 4*a*c)*d*g
- (a*b*d - 2*a^2*e)*g*sqrt((b^2 - 4*a*c)/a^2))*dilog(-(2*c*e^(i*x + h) + a*sqrt(
(b^2 - 4*a*c)/a^2) + b)/(a*sqrt((b^2 - 4*a*c)/a^2) + b) + 1) - ((b^2 - 4*a*c)*d*
g + (a*b*d - 2*a^2*e)*g*sqrt((b^2 - 4*a*c)/a^2))*dilog((2*c*e^(i*x + h) - a*sqrt
((b^2 - 4*a*c)/a^2) + b)/(a*sqrt((b^2 - 4*a*c)/a^2) - b) + 1) + ((b^2 - 4*a*c)*d
*g*h - (b^2 - 4*a*c)*d*f*i - ((a*b*d - 2*a^2*e)*g*h - (a*b*d - 2*a^2*e)*f*i)*sqr
t((b^2 - 4*a*c)/a^2))*log(2*c*e^(i*x + h) + a*sqrt((b^2 - 4*a*c)/a^2) + b) + ((b
^2 - 4*a*c)*d*g*h - (b^2 - 4*a*c)*d*f*i + ((a*b*d - 2*a^2*e)*g*h - (a*b*d - 2*a^
2*e)*f*i)*sqrt((b^2 - 4*a*c)/a^2))*log(2*c*e^(i*x + h) - a*sqrt((b^2 - 4*a*c)/a^
2) + b) - ((b^2 - 4*a*c)*d*g*i*x + (b^2 - 4*a*c)*d*g*h - ((a*b*d - 2*a^2*e)*g*i*
x + (a*b*d - 2*a^2*e)*g*h)*sqrt((b^2 - 4*a*c)/a^2))*log((2*c*e^(i*x + h) + a*sqr
t((b^2 - 4*a*c)/a^2) + b)/(a*sqrt((b^2 - 4*a*c)/a^2) + b)) - ((b^2 - 4*a*c)*d*g*
i*x + (b^2 - 4*a*c)*d*g*h + ((a*b*d - 2*a^2*e)*g*i*x + (a*b*d - 2*a^2*e)*g*h)*sq
rt((b^2 - 4*a*c)/a^2))*log(-(2*c*e^(i*x + h) - a*sqrt((b^2 - 4*a*c)/a^2) + b)/(a
*sqrt((b^2 - 4*a*c)/a^2) - b)))/((a*b^2 - 4*a^2*c)*i^2)

_______________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \[ \text{Timed out} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((d+e*exp(i*x+h))*(g*x+f)/(a+b*exp(i*x+h)+c*exp(2*i*x+2*h)),x)

[Out]

Timed out

_______________________________________________________________________________________

GIAC/XCAS [F]  time = 0., size = 0, normalized size = 0. \[ \int \frac{{\left (g x + f\right )}{\left (e e^{\left (i x + h\right )} + d\right )}}{c e^{\left (2 \, i x + 2 \, h\right )} + b e^{\left (i x + h\right )} + a}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

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

[Out]

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