3.6.75 \(\int \frac {d+e e^{h+i x}}{a+b e^{h+i x}+c e^{2 h+2 i x}} \, dx\) [575]

Optimal. Leaf size=95 \[ \frac {d x}{a}+\frac {(b d-2 a e) \tanh ^{-1}\left (\frac {b+2 c e^{h+i x}}{\sqrt {b^2-4 a c}}\right )}{a \sqrt {b^2-4 a c} i}-\frac {d \log \left (a+b e^{h+i x}+c e^{2 h+2 i x}\right )}{2 a i} \]

[Out]

d*x/a-1/2*d*ln(a+b*exp(i*x+h)+c*exp(2*i*x+2*h))/a/i+(-2*a*e+b*d)*arctanh((b+2*c*exp(i*x+h))/(-4*a*c+b^2)^(1/2)
)/a/i/(-4*a*c+b^2)^(1/2)

________________________________________________________________________________________

Rubi [A]
time = 0.10, antiderivative size = 95, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 6, integrand size = 37, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.162, Rules used = {2320, 814, 648, 632, 212, 642} \begin {gather*} \frac {(b d-2 a e) \tanh ^{-1}\left (\frac {b+2 c e^{h+i x}}{\sqrt {b^2-4 a c}}\right )}{a i \sqrt {b^2-4 a c}}-\frac {d \log \left (a+b e^{h+i x}+c e^{2 h+2 i x}\right )}{2 a i}+\frac {d x}{a} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

(d*x)/a + ((b*d - 2*a*e)*ArcTanh[(b + 2*c*E^(h + i*x))/Sqrt[b^2 - 4*a*c]])/(a*Sqrt[b^2 - 4*a*c]*i) - (d*Log[a
+ b*E^(h + i*x) + c*E^(2*h + 2*i*x)])/(2*a*i)

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 632

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 642

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]

Rule 648

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 814

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 2320

Int[u_, x_Symbol] :> With[{v = FunctionOfExponential[u, x]}, Dist[v/D[v, x], Subst[Int[FunctionOfExponentialFu
nction[u, x]/x, x], x, v], x]] /; FunctionOfExponentialQ[u, x] &&  !MatchQ[u, (w_)*((a_.)*(v_)^(n_))^(m_) /; F
reeQ[{a, m, n}, x] && IntegerQ[m*n]] &&  !MatchQ[u, E^((c_.)*((a_.) + (b_.)*x))*(F_)[v_] /; FreeQ[{a, b, c}, x
] && InverseFunctionQ[F[x]]]

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]
time = 0.18, size = 100, normalized size = 1.05 \begin {gather*} \frac {\frac {(-2 b d+4 a e) \tan ^{-1}\left (\frac {b+2 c e^{h+i x}}{\sqrt {-b^2+4 a c}}\right )}{\sqrt {-b^2+4 a c}}+d \left (2 \log \left (e^{h+i x}\right )-\log \left (a+e^{h+i x} \left (b+c e^{h+i x}\right )\right )\right )}{2 a i} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(182\) vs. \(2(86)=172\).
time = 0.09, size = 183, normalized size = 1.93

method result size
default \(-\frac {d \ln \left (a +b \,{\mathrm e}^{i x} {\mathrm e}^{h}+c \,{\mathrm e}^{2 i x} {\mathrm e}^{2 h}\right )}{2 i a}-\frac {d \,{\mathrm e}^{h} b \arctan \left (\frac {{\mathrm e}^{h} b +2 \,{\mathrm e}^{2 h} {\mathrm e}^{i x} c}{\sqrt {4 a c \,{\mathrm e}^{2 h}-{\mathrm e}^{2 h} b^{2}}}\right )}{i a \sqrt {4 a c \,{\mathrm e}^{2 h}-{\mathrm e}^{2 h} b^{2}}}+\frac {d \ln \left ({\mathrm e}^{i x}\right )}{i a}+\frac {2 e \,{\mathrm e}^{h} \arctan \left (\frac {{\mathrm e}^{h} b +2 \,{\mathrm e}^{2 h} {\mathrm e}^{i x} c}{\sqrt {4 a c \,{\mathrm e}^{2 h}-{\mathrm e}^{2 h} b^{2}}}\right )}{i \sqrt {4 a c \,{\mathrm e}^{2 h}-{\mathrm e}^{2 h} b^{2}}}\) \(183\)
risch \(\frac {4 a c d \,i^{2} x}{4 a^{2} c \,i^{2}-a \,b^{2} i^{2}}-\frac {b^{2} d \,i^{2} x}{4 a^{2} c \,i^{2}-a \,b^{2} i^{2}}+\frac {4 a c d h i}{4 a^{2} c \,i^{2}-a \,b^{2} i^{2}}-\frac {b^{2} d h i}{4 a^{2} c \,i^{2}-a \,b^{2} i^{2}}-\frac {2 \ln \left ({\mathrm e}^{i x +h}+\frac {2 b a e -b^{2} d +\sqrt {-16 a^{3} c \,e^{2}+4 a^{2} b^{2} e^{2}+16 a^{2} b c d e -4 a \,b^{3} d e -4 a \,b^{2} c \,d^{2}+b^{4} d^{2}}}{2 c \left (2 a e -b d \right )}\right ) c d}{\left (4 c a -b^{2}\right ) i}+\frac {\ln \left ({\mathrm e}^{i x +h}+\frac {2 b a e -b^{2} d +\sqrt {-16 a^{3} c \,e^{2}+4 a^{2} b^{2} e^{2}+16 a^{2} b c d e -4 a \,b^{3} d e -4 a \,b^{2} c \,d^{2}+b^{4} d^{2}}}{2 c \left (2 a e -b d \right )}\right ) b^{2} d}{2 a \left (4 c a -b^{2}\right ) i}+\frac {\ln \left ({\mathrm e}^{i x +h}+\frac {2 b a e -b^{2} d +\sqrt {-16 a^{3} c \,e^{2}+4 a^{2} b^{2} e^{2}+16 a^{2} b c d e -4 a \,b^{3} d e -4 a \,b^{2} c \,d^{2}+b^{4} d^{2}}}{2 c \left (2 a e -b d \right )}\right ) \sqrt {-16 a^{3} c \,e^{2}+4 a^{2} b^{2} e^{2}+16 a^{2} b c d e -4 a \,b^{3} d e -4 a \,b^{2} c \,d^{2}+b^{4} d^{2}}}{2 a \left (4 c a -b^{2}\right ) i}-\frac {2 \ln \left ({\mathrm e}^{i x +h}-\frac {-2 b a e +b^{2} d +\sqrt {-16 a^{3} c \,e^{2}+4 a^{2} b^{2} e^{2}+16 a^{2} b c d e -4 a \,b^{3} d e -4 a \,b^{2} c \,d^{2}+b^{4} d^{2}}}{2 c \left (2 a e -b d \right )}\right ) c d}{\left (4 c a -b^{2}\right ) i}+\frac {\ln \left ({\mathrm e}^{i x +h}-\frac {-2 b a e +b^{2} d +\sqrt {-16 a^{3} c \,e^{2}+4 a^{2} b^{2} e^{2}+16 a^{2} b c d e -4 a \,b^{3} d e -4 a \,b^{2} c \,d^{2}+b^{4} d^{2}}}{2 c \left (2 a e -b d \right )}\right ) b^{2} d}{2 a \left (4 c a -b^{2}\right ) i}-\frac {\ln \left ({\mathrm e}^{i x +h}-\frac {-2 b a e +b^{2} d +\sqrt {-16 a^{3} c \,e^{2}+4 a^{2} b^{2} e^{2}+16 a^{2} b c d e -4 a \,b^{3} d e -4 a \,b^{2} c \,d^{2}+b^{4} d^{2}}}{2 c \left (2 a e -b d \right )}\right ) \sqrt {-16 a^{3} c \,e^{2}+4 a^{2} b^{2} e^{2}+16 a^{2} b c d e -4 a \,b^{3} d e -4 a \,b^{2} c \,d^{2}+b^{4} d^{2}}}{2 a \left (4 c a -b^{2}\right ) i}\) \(915\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((d+e*exp(i*x+h))/(a+b*exp(i*x+h)+c*exp(2*i*x+2*h)),x,method=_RETURNVERBOSE)

[Out]

-1/2*d/i/a*ln(a+b*exp(i*x)*exp(h)+c*exp(i*x)^2*exp(2*h))-d/i/a*exp(h)*b/(4*a*c*exp(2*h)-exp(h)^2*b^2)^(1/2)*ar
ctan((exp(h)*b+2*exp(2*h)*exp(i*x)*c)/(4*a*c*exp(2*h)-exp(h)^2*b^2)^(1/2))+d/i/a*ln(exp(i*x))+2*e*exp(h)/i/(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))

________________________________________________________________________________________

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*exp(i*x+h))/(a+b*exp(i*x+h)+c*exp(2*i*x+2*h)),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(4*a*c-b^2>0)', see `assume?` f
or more deta

________________________________________________________________________________________

Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 327 vs. \(2 (81) = 162\).
time = 0.39, size = 327, normalized size = 3.44 \begin {gather*} \frac {2 \, d x - {\left (a \sqrt {-\frac {b^{2} d^{2} - 4 \, a b d e + 4 \, a^{2} e^{2}}{a^{2} b^{2} - 4 \, a^{3} c}} - i \, d\right )} \log \left (\frac {b^{2} d e - 2 \, a b e^{2} - {\left (i \, a b^{2} - 4 i \, a^{2} c\right )} \sqrt {-\frac {b^{2} d^{2} - 4 \, a b d e + 4 \, a^{2} e^{2}}{a^{2} b^{2} - 4 \, a^{3} c}} e + 2 \, {\left (b c d - 2 \, a c e\right )} e^{\left (h + i \, x + 1\right )}}{2 \, {\left (b c d - 2 \, a c e\right )}}\right ) + {\left (a \sqrt {-\frac {b^{2} d^{2} - 4 \, a b d e + 4 \, a^{2} e^{2}}{a^{2} b^{2} - 4 \, a^{3} c}} + i \, d\right )} \log \left (\frac {b^{2} d e - 2 \, a b e^{2} - {\left (-i \, a b^{2} + 4 i \, a^{2} c\right )} \sqrt {-\frac {b^{2} d^{2} - 4 \, a b d e + 4 \, a^{2} e^{2}}{a^{2} b^{2} - 4 \, a^{3} c}} e + 2 \, {\left (b c d - 2 \, a c e\right )} e^{\left (h + i \, x + 1\right )}}{2 \, {\left (b c d - 2 \, a c e\right )}}\right )}{2 \, a} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d+e*exp(i*x+h))/(a+b*exp(i*x+h)+c*exp(2*i*x+2*h)),x, algorithm="fricas")

[Out]

1/2*(2*d*x - (a*sqrt(-(b^2*d^2 - 4*a*b*d*e + 4*a^2*e^2)/(a^2*b^2 - 4*a^3*c)) - I*d)*log(1/2*(b^2*d*e - 2*a*b*e
^2 - (I*a*b^2 - 4*I*a^2*c)*sqrt(-(b^2*d^2 - 4*a*b*d*e + 4*a^2*e^2)/(a^2*b^2 - 4*a^3*c))*e + 2*(b*c*d - 2*a*c*e
)*e^(h + I*x + 1))/(b*c*d - 2*a*c*e)) + (a*sqrt(-(b^2*d^2 - 4*a*b*d*e + 4*a^2*e^2)/(a^2*b^2 - 4*a^3*c)) + I*d)
*log(1/2*(b^2*d*e - 2*a*b*e^2 - (-I*a*b^2 + 4*I*a^2*c)*sqrt(-(b^2*d^2 - 4*a*b*d*e + 4*a^2*e^2)/(a^2*b^2 - 4*a^
3*c))*e + 2*(b*c*d - 2*a*c*e)*e^(h + I*x + 1))/(b*c*d - 2*a*c*e)))/a

________________________________________________________________________________________

Sympy [A]
time = 0.55, size = 116, normalized size = 1.22 \begin {gather*} \operatorname {RootSum} {\left (z^{2} \cdot \left (4 a^{2} c i^{2} - a b^{2} i^{2}\right ) + z \left (4 a c d i - b^{2} d i\right ) + a e^{2} - b d e + c d^{2}, \left ( i \mapsto i \log {\left (e^{h + i x} + \frac {4 i a^{2} c i - i a b^{2} i + a b e + 2 a c d - b^{2} d}{2 a c e - b c d} \right )} \right )\right )} + \frac {d x}{a} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

RootSum(_z**2*(4*a**2*c*i**2 - a*b**2*i**2) + _z*(4*a*c*d*i - b**2*d*i) + a*e**2 - b*d*e + c*d**2, Lambda(_i,
_i*log(exp(h + i*x) + (4*_i*a**2*c*i - _i*a*b**2*i + a*b*e + 2*a*c*d - b**2*d)/(2*a*c*e - b*c*d)))) + d*x/a

________________________________________________________________________________________

Giac [A]
time = 4.61, size = 98, normalized size = 1.03 \begin {gather*} \frac {i \, {\left (b d e^{h} - 2 \, a e^{\left (h + 1\right )}\right )} \arctan \left (\frac {2 \, c e^{\left (h + i \, x\right )} + b}{\sqrt {-b^{2} + 4 \, a c}}\right ) e^{\left (-h\right )}}{\sqrt {-b^{2} + 4 \, a c} a} + \frac {i \, d \log \left (c e^{\left (2 \, h + 2 i \, x\right )} + b e^{\left (h + i \, x\right )} + a\right )}{2 \, a} - \frac {i \, d \log \left (e^{\left (i \, x\right )}\right )}{a} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d+e*exp(i*x+h))/(a+b*exp(i*x+h)+c*exp(2*i*x+2*h)),x, algorithm="giac")

[Out]

I*(b*d*e^h - 2*a*e^(h + 1))*arctan((2*c*e^(h + I*x) + b)/sqrt(-b^2 + 4*a*c))*e^(-h)/(sqrt(-b^2 + 4*a*c)*a) + 1
/2*I*d*log(c*e^(2*h + 2*I*x) + b*e^(h + I*x) + a)/a - I*d*log(e^(I*x))/a

________________________________________________________________________________________

Mupad [B]
time = 3.78, size = 91, normalized size = 0.96 \begin {gather*} \frac {d\,x}{a}-\frac {d\,\ln \left (a+b\,{\mathrm {e}}^{i\,x}\,{\mathrm {e}}^h+c\,{\mathrm {e}}^{2\,h}\,{\mathrm {e}}^{2\,i\,x}\right )}{2\,a\,i}+\frac {\mathrm {atan}\left (\frac {b+2\,c\,{\mathrm {e}}^{i\,x}\,{\mathrm {e}}^h}{\sqrt {4\,a\,c-b^2}}\right )\,\left (2\,a\,e-b\,d\right )}{a\,i\,\sqrt {4\,a\,c-b^2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((d + e*exp(h + i*x))/(a + b*exp(h + i*x) + c*exp(2*h + 2*i*x)),x)

[Out]

(d*x)/a - (d*log(a + b*exp(i*x)*exp(h) + c*exp(2*h)*exp(2*i*x)))/(2*a*i) + (atan((b + 2*c*exp(i*x)*exp(h))/(4*
a*c - b^2)^(1/2))*(2*a*e - b*d))/(a*i*(4*a*c - b^2)^(1/2))

________________________________________________________________________________________