Integrand size = 44, antiderivative size = 599 \[ \int \frac {\left (d+e e^{h+i x}\right ) (f+g x)^2}{a+b e^{h+i x}+c e^{2 h+2 i x}} \, dx=\frac {\left (e-\frac {2 c d-b e}{\sqrt {b^2-4 a c}}\right ) (f+g x)^3}{3 \left (b+\sqrt {b^2-4 a c}\right ) g}+\frac {\left (e+\frac {2 c d-b e}{\sqrt {b^2-4 a c}}\right ) (f+g x)^3}{3 \left (b-\sqrt {b^2-4 a c}\right ) g}-\frac {\left (e+\frac {2 c d-b e}{\sqrt {b^2-4 a c}}\right ) (f+g x)^2 \log \left (1+\frac {2 c e^{h+i x}}{b-\sqrt {b^2-4 a c}}\right )}{\left (b-\sqrt {b^2-4 a c}\right ) i}-\frac {\left (e-\frac {2 c d-b e}{\sqrt {b^2-4 a c}}\right ) (f+g x)^2 \log \left (1+\frac {2 c e^{h+i x}}{b+\sqrt {b^2-4 a c}}\right )}{\left (b+\sqrt {b^2-4 a c}\right ) i}-\frac {2 \left (e+\frac {2 c d-b e}{\sqrt {b^2-4 a c}}\right ) g (f+g x) \operatorname {PolyLog}\left (2,-\frac {2 c e^{h+i x}}{b-\sqrt {b^2-4 a c}}\right )}{\left (b-\sqrt {b^2-4 a c}\right ) i^2}-\frac {2 \left (e-\frac {2 c d-b e}{\sqrt {b^2-4 a c}}\right ) g (f+g x) \operatorname {PolyLog}\left (2,-\frac {2 c e^{h+i x}}{b+\sqrt {b^2-4 a c}}\right )}{\left (b+\sqrt {b^2-4 a c}\right ) i^2}+\frac {2 \left (e+\frac {2 c d-b e}{\sqrt {b^2-4 a c}}\right ) g^2 \operatorname {PolyLog}\left (3,-\frac {2 c e^{h+i x}}{b-\sqrt {b^2-4 a c}}\right )}{\left (b-\sqrt {b^2-4 a c}\right ) i^3}+\frac {2 \left (e-\frac {2 c d-b e}{\sqrt {b^2-4 a c}}\right ) g^2 \operatorname {PolyLog}\left (3,-\frac {2 c e^{h+i x}}{b+\sqrt {b^2-4 a c}}\right )}{\left (b+\sqrt {b^2-4 a c}\right ) i^3} \]
[Out]
Time = 0.65 (sec) , antiderivative size = 599, normalized size of antiderivative = 1.00, number of steps used = 11, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.136, Rules used = {2297, 2215, 2221, 2611, 2320, 6724} \[ \int \frac {\left (d+e e^{h+i x}\right ) (f+g x)^2}{a+b e^{h+i x}+c e^{2 h+2 i x}} \, dx=-\frac {2 g (f+g x) \left (\frac {2 c d-b e}{\sqrt {b^2-4 a c}}+e\right ) \operatorname {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 {2 g (f+g x) \left (e-\frac {2 c d-b e}{\sqrt {b^2-4 a c}}\right ) \operatorname {PolyLog}\left (2,-\frac {2 c e^{h+i x}}{b+\sqrt {b^2-4 a c}}\right )}{i^2 \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 ) \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)^2 \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)^3 \left (e-\frac {2 c d-b e}{\sqrt {b^2-4 a c}}\right )}{3 g \left (\sqrt {b^2-4 a c}+b\right )}+\frac {(f+g x)^3 \left (\frac {2 c d-b e}{\sqrt {b^2-4 a c}}+e\right )}{3 g \left (b-\sqrt {b^2-4 a c}\right )}+\frac {2 g^2 \left (\frac {2 c d-b e}{\sqrt {b^2-4 a c}}+e\right ) \operatorname {PolyLog}\left (3,-\frac {2 c e^{h+i x}}{b-\sqrt {b^2-4 a c}}\right )}{i^3 \left (b-\sqrt {b^2-4 a c}\right )}+\frac {2 g^2 \left (e-\frac {2 c d-b e}{\sqrt {b^2-4 a c}}\right ) \operatorname {PolyLog}\left (3,-\frac {2 c e^{h+i x}}{b+\sqrt {b^2-4 a c}}\right )}{i^3 \left (\sqrt {b^2-4 a c}+b\right )} \]
[In]
[Out]
Rule 2215
Rule 2221
Rule 2297
Rule 2320
Rule 2611
Rule 6724
Rubi steps \begin{align*} \text {integral}& = -\left (\left (-e+\frac {2 c d-b e}{\sqrt {b^2-4 a c}}\right ) \int \frac {(f+g x)^2}{b+\sqrt {b^2-4 a c}+2 c e^{h+i x}} \, dx\right )+\left (e+\frac {2 c d-b e}{\sqrt {b^2-4 a c}}\right ) \int \frac {(f+g x)^2}{b-\sqrt {b^2-4 a c}+2 c e^{h+i x}} \, dx \\ & = \frac {\left (e-\frac {2 c d-b e}{\sqrt {b^2-4 a c}}\right ) (f+g x)^3}{3 \left (b+\sqrt {b^2-4 a c}\right ) g}+\frac {\left (e+\frac {2 c d-b e}{\sqrt {b^2-4 a c}}\right ) (f+g x)^3}{3 \left (b-\sqrt {b^2-4 a c}\right ) g}-\frac {\left (2 c \left (e-\frac {2 c d-b e}{\sqrt {b^2-4 a c}}\right )\right ) \int \frac {e^{h+i x} (f+g x)^2}{b+\sqrt {b^2-4 a c}+2 c e^{h+i x}} \, dx}{b+\sqrt {b^2-4 a c}}-\frac {\left (2 c \left (e+\frac {2 c d-b e}{\sqrt {b^2-4 a c}}\right )\right ) \int \frac {e^{h+i x} (f+g x)^2}{b-\sqrt {b^2-4 a c}+2 c e^{h+i x}} \, dx}{b-\sqrt {b^2-4 a c}} \\ & = \frac {\left (e-\frac {2 c d-b e}{\sqrt {b^2-4 a c}}\right ) (f+g x)^3}{3 \left (b+\sqrt {b^2-4 a c}\right ) g}+\frac {\left (e+\frac {2 c d-b e}{\sqrt {b^2-4 a c}}\right ) (f+g x)^3}{3 \left (b-\sqrt {b^2-4 a c}\right ) g}-\frac {\left (e+\frac {2 c d-b e}{\sqrt {b^2-4 a c}}\right ) (f+g x)^2 \log \left (1+\frac {2 c e^{h+i x}}{b-\sqrt {b^2-4 a c}}\right )}{\left (b-\sqrt {b^2-4 a c}\right ) i}-\frac {\left (e-\frac {2 c d-b e}{\sqrt {b^2-4 a c}}\right ) (f+g x)^2 \log \left (1+\frac {2 c e^{h+i x}}{b+\sqrt {b^2-4 a c}}\right )}{\left (b+\sqrt {b^2-4 a c}\right ) i}+\frac {\left (2 \left (e-\frac {2 c d-b e}{\sqrt {b^2-4 a c}}\right ) g\right ) \int (f+g x) \log \left (1+\frac {2 c e^{h+i x}}{b+\sqrt {b^2-4 a c}}\right ) \, dx}{\left (b+\sqrt {b^2-4 a c}\right ) i}+\frac {\left (2 \left (e+\frac {2 c d-b e}{\sqrt {b^2-4 a c}}\right ) g\right ) \int (f+g x) \log \left (1+\frac {2 c e^{h+i x}}{b-\sqrt {b^2-4 a c}}\right ) \, dx}{\left (b-\sqrt {b^2-4 a c}\right ) i} \\ & = \frac {\left (e-\frac {2 c d-b e}{\sqrt {b^2-4 a c}}\right ) (f+g x)^3}{3 \left (b+\sqrt {b^2-4 a c}\right ) g}+\frac {\left (e+\frac {2 c d-b e}{\sqrt {b^2-4 a c}}\right ) (f+g x)^3}{3 \left (b-\sqrt {b^2-4 a c}\right ) g}-\frac {\left (e+\frac {2 c d-b e}{\sqrt {b^2-4 a c}}\right ) (f+g x)^2 \log \left (1+\frac {2 c e^{h+i x}}{b-\sqrt {b^2-4 a c}}\right )}{\left (b-\sqrt {b^2-4 a c}\right ) i}-\frac {\left (e-\frac {2 c d-b e}{\sqrt {b^2-4 a c}}\right ) (f+g x)^2 \log \left (1+\frac {2 c e^{h+i x}}{b+\sqrt {b^2-4 a c}}\right )}{\left (b+\sqrt {b^2-4 a c}\right ) i}-\frac {2 \left (e+\frac {2 c d-b e}{\sqrt {b^2-4 a c}}\right ) g (f+g x) \text {Li}_2\left (-\frac {2 c e^{h+i x}}{b-\sqrt {b^2-4 a c}}\right )}{\left (b-\sqrt {b^2-4 a c}\right ) i^2}-\frac {2 \left (e-\frac {2 c d-b e}{\sqrt {b^2-4 a c}}\right ) g (f+g x) \text {Li}_2\left (-\frac {2 c e^{h+i x}}{b+\sqrt {b^2-4 a c}}\right )}{\left (b+\sqrt {b^2-4 a c}\right ) i^2}+\frac {\left (2 \left (e-\frac {2 c d-b e}{\sqrt {b^2-4 a c}}\right ) g^2\right ) \int \text {Li}_2\left (-\frac {2 c e^{h+i x}}{b+\sqrt {b^2-4 a c}}\right ) \, dx}{\left (b+\sqrt {b^2-4 a c}\right ) i^2}+\frac {\left (2 \left (e+\frac {2 c d-b e}{\sqrt {b^2-4 a c}}\right ) g^2\right ) \int \text {Li}_2\left (-\frac {2 c e^{h+i x}}{b-\sqrt {b^2-4 a c}}\right ) \, dx}{\left (b-\sqrt {b^2-4 a c}\right ) i^2} \\ & = \frac {\left (e-\frac {2 c d-b e}{\sqrt {b^2-4 a c}}\right ) (f+g x)^3}{3 \left (b+\sqrt {b^2-4 a c}\right ) g}+\frac {\left (e+\frac {2 c d-b e}{\sqrt {b^2-4 a c}}\right ) (f+g x)^3}{3 \left (b-\sqrt {b^2-4 a c}\right ) g}-\frac {\left (e+\frac {2 c d-b e}{\sqrt {b^2-4 a c}}\right ) (f+g x)^2 \log \left (1+\frac {2 c e^{h+i x}}{b-\sqrt {b^2-4 a c}}\right )}{\left (b-\sqrt {b^2-4 a c}\right ) i}-\frac {\left (e-\frac {2 c d-b e}{\sqrt {b^2-4 a c}}\right ) (f+g x)^2 \log \left (1+\frac {2 c e^{h+i x}}{b+\sqrt {b^2-4 a c}}\right )}{\left (b+\sqrt {b^2-4 a c}\right ) i}-\frac {2 \left (e+\frac {2 c d-b e}{\sqrt {b^2-4 a c}}\right ) g (f+g x) \text {Li}_2\left (-\frac {2 c e^{h+i x}}{b-\sqrt {b^2-4 a c}}\right )}{\left (b-\sqrt {b^2-4 a c}\right ) i^2}-\frac {2 \left (e-\frac {2 c d-b e}{\sqrt {b^2-4 a c}}\right ) g (f+g x) \text {Li}_2\left (-\frac {2 c e^{h+i x}}{b+\sqrt {b^2-4 a c}}\right )}{\left (b+\sqrt {b^2-4 a c}\right ) i^2}+\frac {\left (2 \left (e-\frac {2 c d-b e}{\sqrt {b^2-4 a c}}\right ) g^2\right ) \text {Subst}\left (\int \frac {\text {Li}_2\left (-\frac {2 c x}{b+\sqrt {b^2-4 a c}}\right )}{x} \, dx,x,e^{h+i x}\right )}{\left (b+\sqrt {b^2-4 a c}\right ) i^3}+\frac {\left (2 \left (e+\frac {2 c d-b e}{\sqrt {b^2-4 a c}}\right ) g^2\right ) \text {Subst}\left (\int \frac {\text {Li}_2\left (\frac {2 c x}{-b+\sqrt {b^2-4 a c}}\right )}{x} \, dx,x,e^{h+i x}\right )}{\left (b-\sqrt {b^2-4 a c}\right ) i^3} \\ & = \frac {\left (e-\frac {2 c d-b e}{\sqrt {b^2-4 a c}}\right ) (f+g x)^3}{3 \left (b+\sqrt {b^2-4 a c}\right ) g}+\frac {\left (e+\frac {2 c d-b e}{\sqrt {b^2-4 a c}}\right ) (f+g x)^3}{3 \left (b-\sqrt {b^2-4 a c}\right ) g}-\frac {\left (e+\frac {2 c d-b e}{\sqrt {b^2-4 a c}}\right ) (f+g x)^2 \log \left (1+\frac {2 c e^{h+i x}}{b-\sqrt {b^2-4 a c}}\right )}{\left (b-\sqrt {b^2-4 a c}\right ) i}-\frac {\left (e-\frac {2 c d-b e}{\sqrt {b^2-4 a c}}\right ) (f+g x)^2 \log \left (1+\frac {2 c e^{h+i x}}{b+\sqrt {b^2-4 a c}}\right )}{\left (b+\sqrt {b^2-4 a c}\right ) i}-\frac {2 \left (e+\frac {2 c d-b e}{\sqrt {b^2-4 a c}}\right ) g (f+g x) \text {Li}_2\left (-\frac {2 c e^{h+i x}}{b-\sqrt {b^2-4 a c}}\right )}{\left (b-\sqrt {b^2-4 a c}\right ) i^2}-\frac {2 \left (e-\frac {2 c d-b e}{\sqrt {b^2-4 a c}}\right ) g (f+g x) \text {Li}_2\left (-\frac {2 c e^{h+i x}}{b+\sqrt {b^2-4 a c}}\right )}{\left (b+\sqrt {b^2-4 a c}\right ) i^2}+\frac {2 \left (e+\frac {2 c d-b e}{\sqrt {b^2-4 a c}}\right ) g^2 \text {Li}_3\left (-\frac {2 c e^{h+i x}}{b-\sqrt {b^2-4 a c}}\right )}{\left (b-\sqrt {b^2-4 a c}\right ) i^3}+\frac {2 \left (e-\frac {2 c d-b e}{\sqrt {b^2-4 a c}}\right ) g^2 \text {Li}_3\left (-\frac {2 c e^{h+i x}}{b+\sqrt {b^2-4 a c}}\right )}{\left (b+\sqrt {b^2-4 a c}\right ) i^3} \\ \end{align*}
Leaf count is larger than twice the leaf count of optimal. \(1419\) vs. \(2(599)=1198\).
Time = 1.46 (sec) , antiderivative size = 1419, normalized size of antiderivative = 2.37 \[ \int \frac {\left (d+e e^{h+i x}\right ) (f+g x)^2}{a+b e^{h+i x}+c e^{2 h+2 i x}} \, dx=-\frac {-6 \sqrt {-\left (b^2-4 a c\right )^2} d f g i^3 x^2-2 \sqrt {-\left (b^2-4 a c\right )^2} d g^2 i^3 x^3+6 b \sqrt {b^2-4 a c} d f^2 i^2 \arctan \left (\frac {b+2 c e^{h+i x}}{\sqrt {-b^2+4 a c}}\right )-12 a \sqrt {b^2-4 a c} e f^2 i^2 \arctan \left (\frac {b+2 c e^{h+i x}}{\sqrt {-b^2+4 a c}}\right )-6 \sqrt {-\left (b^2-4 a c\right )^2} d f^2 i^2 \log \left (e^{h+i x}\right )+6 \sqrt {-\left (b^2-4 a c\right )^2} d f g i^2 x \log \left (1+\frac {2 c e^{h+i x}}{b-\sqrt {b^2-4 a c}}\right )+6 b \sqrt {-b^2+4 a c} d f g i^2 x \log \left (1+\frac {2 c e^{h+i x}}{b-\sqrt {b^2-4 a c}}\right )-12 a \sqrt {-b^2+4 a c} e f g i^2 x \log \left (1+\frac {2 c e^{h+i x}}{b-\sqrt {b^2-4 a c}}\right )+3 \sqrt {-\left (b^2-4 a c\right )^2} d g^2 i^2 x^2 \log \left (1+\frac {2 c e^{h+i x}}{b-\sqrt {b^2-4 a c}}\right )+3 b \sqrt {-b^2+4 a c} d g^2 i^2 x^2 \log \left (1+\frac {2 c e^{h+i x}}{b-\sqrt {b^2-4 a c}}\right )-6 a \sqrt {-b^2+4 a c} e g^2 i^2 x^2 \log \left (1+\frac {2 c e^{h+i x}}{b-\sqrt {b^2-4 a c}}\right )+6 \sqrt {-\left (b^2-4 a c\right )^2} d f g i^2 x \log \left (1+\frac {2 c e^{h+i x}}{b+\sqrt {b^2-4 a c}}\right )-6 b \sqrt {-b^2+4 a c} d f g i^2 x \log \left (1+\frac {2 c e^{h+i x}}{b+\sqrt {b^2-4 a c}}\right )+12 a \sqrt {-b^2+4 a c} e f g i^2 x \log \left (1+\frac {2 c e^{h+i x}}{b+\sqrt {b^2-4 a c}}\right )+3 \sqrt {-\left (b^2-4 a c\right )^2} d g^2 i^2 x^2 \log \left (1+\frac {2 c e^{h+i x}}{b+\sqrt {b^2-4 a c}}\right )-3 b \sqrt {-b^2+4 a c} d g^2 i^2 x^2 \log \left (1+\frac {2 c e^{h+i x}}{b+\sqrt {b^2-4 a c}}\right )+6 a \sqrt {-b^2+4 a c} e g^2 i^2 x^2 \log \left (1+\frac {2 c e^{h+i x}}{b+\sqrt {b^2-4 a c}}\right )+3 \sqrt {-\left (b^2-4 a c\right )^2} d f^2 i^2 \log \left (a+e^{h+i x} \left (b+c e^{h+i x}\right )\right )+6 \left (\sqrt {-\left (b^2-4 a c\right )^2} d+b \sqrt {-b^2+4 a c} d-2 a \sqrt {-b^2+4 a c} e\right ) g i (f+g x) \operatorname {PolyLog}\left (2,\frac {2 c e^{h+i x}}{-b+\sqrt {b^2-4 a c}}\right )+6 \left (\sqrt {-\left (b^2-4 a c\right )^2} d-b \sqrt {-b^2+4 a c} d+2 a \sqrt {-b^2+4 a c} e\right ) g i (f+g x) \operatorname {PolyLog}\left (2,-\frac {2 c e^{h+i x}}{b+\sqrt {b^2-4 a c}}\right )-6 \sqrt {-\left (b^2-4 a c\right )^2} d g^2 \operatorname {PolyLog}\left (3,\frac {2 c e^{h+i x}}{-b+\sqrt {b^2-4 a c}}\right )-6 b \sqrt {-b^2+4 a c} d g^2 \operatorname {PolyLog}\left (3,\frac {2 c e^{h+i x}}{-b+\sqrt {b^2-4 a c}}\right )+12 a \sqrt {-b^2+4 a c} e g^2 \operatorname {PolyLog}\left (3,\frac {2 c e^{h+i x}}{-b+\sqrt {b^2-4 a c}}\right )-6 \sqrt {-\left (b^2-4 a c\right )^2} d g^2 \operatorname {PolyLog}\left (3,-\frac {2 c e^{h+i x}}{b+\sqrt {b^2-4 a c}}\right )+6 b \sqrt {-b^2+4 a c} d g^2 \operatorname {PolyLog}\left (3,-\frac {2 c e^{h+i x}}{b+\sqrt {b^2-4 a c}}\right )-12 a \sqrt {-b^2+4 a c} e g^2 \operatorname {PolyLog}\left (3,-\frac {2 c e^{h+i x}}{b+\sqrt {b^2-4 a c}}\right )}{6 a \sqrt {-\left (b^2-4 a c\right )^2} i^3} \]
[In]
[Out]
\[\int \frac {\left (d +e \,{\mathrm e}^{i x +h}\right ) \left (g x +f \right )^{2}}{a +b \,{\mathrm e}^{i x +h}+c \,{\mathrm e}^{2 i x +2 h}}d x\]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 1193 vs. \(2 (543) = 1086\).
Time = 0.35 (sec) , antiderivative size = 1193, normalized size of antiderivative = 1.99 \[ \int \frac {\left (d+e e^{h+i x}\right ) (f+g x)^2}{a+b e^{h+i x}+c e^{2 h+2 i x}} \, dx=\text {Too large to display} \]
[In]
[Out]
\[ \int \frac {\left (d+e e^{h+i x}\right ) (f+g x)^2}{a+b e^{h+i x}+c e^{2 h+2 i x}} \, dx=\int \frac {\left (d + e e^{h} e^{i x}\right ) \left (f + g x\right )^{2}}{a + b e^{h} e^{i x} + c e^{2 h} e^{2 i x}}\, dx \]
[In]
[Out]
Exception generated. \[ \int \frac {\left (d+e e^{h+i x}\right ) (f+g x)^2}{a+b e^{h+i x}+c e^{2 h+2 i x}} \, dx=\text {Exception raised: ValueError} \]
[In]
[Out]
\[ \int \frac {\left (d+e e^{h+i x}\right ) (f+g x)^2}{a+b e^{h+i x}+c e^{2 h+2 i x}} \, dx=\int { \frac {{\left (g x + f\right )}^{2} {\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 } \]
[In]
[Out]
Timed out. \[ \int \frac {\left (d+e e^{h+i x}\right ) (f+g x)^2}{a+b e^{h+i x}+c e^{2 h+2 i x}} \, dx=\int \frac {{\left (f+g\,x\right )}^2\,\left (d+e\,{\mathrm {e}}^{h+i\,x}\right )}{a+b\,{\mathrm {e}}^{h+i\,x}+c\,{\mathrm {e}}^{2\,h+2\,i\,x}} \,d x \]
[In]
[Out]