Optimal. Leaf size=161 \[ \frac {1}{8} e^{-2 d+\frac {(2 e-b \log (f))^2}{8 f}} f^{-\frac {1}{2}+a} \sqrt {\frac {\pi }{2}} \text {Erf}\left (\frac {2 e+4 f x-b \log (f)}{2 \sqrt {2} \sqrt {f}}\right )+\frac {1}{8} e^{2 d-\frac {(2 e+b \log (f))^2}{8 f}} f^{-\frac {1}{2}+a} \sqrt {\frac {\pi }{2}} \text {Erfi}\left (\frac {2 e+4 f x+b \log (f)}{2 \sqrt {2} \sqrt {f}}\right )+\frac {f^{a+b x}}{2 b \log (f)} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.21, antiderivative size = 161, normalized size of antiderivative = 1.00, number of steps
used = 9, number of rules used = 6, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.286, Rules used = {5624, 2225,
2325, 2266, 2236, 2235} \begin {gather*} \frac {1}{8} \sqrt {\frac {\pi }{2}} f^{a-\frac {1}{2}} e^{\frac {(2 e-b \log (f))^2}{8 f}-2 d} \text {Erf}\left (\frac {-b \log (f)+2 e+4 f x}{2 \sqrt {2} \sqrt {f}}\right )+\frac {1}{8} \sqrt {\frac {\pi }{2}} f^{a-\frac {1}{2}} e^{2 d-\frac {(b \log (f)+2 e)^2}{8 f}} \text {Erfi}\left (\frac {b \log (f)+2 e+4 f x}{2 \sqrt {2} \sqrt {f}}\right )+\frac {f^{a+b x}}{2 b \log (f)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2225
Rule 2235
Rule 2236
Rule 2266
Rule 2325
Rule 5624
Rubi steps
\begin {align*} \int f^{a+b x} \cosh ^2\left (d+e x+f x^2\right ) \, dx &=\int \left (\frac {1}{2} f^{a+b x}+\frac {1}{4} e^{-2 d-2 e x-2 f x^2} f^{a+b x}+\frac {1}{4} e^{2 d+2 e x+2 f x^2} f^{a+b x}\right ) \, dx\\ &=\frac {1}{4} \int e^{-2 d-2 e x-2 f x^2} f^{a+b x} \, dx+\frac {1}{4} \int e^{2 d+2 e x+2 f x^2} f^{a+b x} \, dx+\frac {1}{2} \int f^{a+b x} \, dx\\ &=\frac {f^{a+b x}}{2 b \log (f)}+\frac {1}{4} \int \exp \left (-2 d-2 f x^2+a \log (f)-x (2 e-b \log (f))\right ) \, dx+\frac {1}{4} \int \exp \left (2 d+2 f x^2+a \log (f)+x (2 e+b \log (f))\right ) \, dx\\ &=\frac {f^{a+b x}}{2 b \log (f)}+\frac {1}{4} \left (e^{-2 d+\frac {(2 e-b \log (f))^2}{8 f}} f^a\right ) \int e^{-\frac {(-2 e-4 f x+b \log (f))^2}{8 f}} \, dx+\frac {1}{4} \left (e^{2 d-\frac {(2 e+b \log (f))^2}{8 f}} f^a\right ) \int e^{\frac {(2 e+4 f x+b \log (f))^2}{8 f}} \, dx\\ &=\frac {1}{8} e^{-2 d+\frac {(2 e-b \log (f))^2}{8 f}} f^{-\frac {1}{2}+a} \sqrt {\frac {\pi }{2}} \text {erf}\left (\frac {2 e+4 f x-b \log (f)}{2 \sqrt {2} \sqrt {f}}\right )+\frac {1}{8} e^{2 d-\frac {(2 e+b \log (f))^2}{8 f}} f^{-\frac {1}{2}+a} \sqrt {\frac {\pi }{2}} \text {erfi}\left (\frac {2 e+4 f x+b \log (f)}{2 \sqrt {2} \sqrt {f}}\right )+\frac {f^{a+b x}}{2 b \log (f)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.45, size = 220, normalized size = 1.37 \begin {gather*} \frac {e^{-\frac {4 e^2+b^2 \log ^2(f)}{8 f}} f^{a-\frac {b e+f}{2 f}} \left (4 \sqrt {2} e^{\frac {4 e^2+b^2 \log ^2(f)}{8 f}} f^{\frac {1}{2}+b \left (\frac {e}{2 f}+x\right )}+b e^{\frac {4 e^2+b^2 \log ^2(f)}{4 f}} \sqrt {\pi } \text {Erf}\left (\frac {2 e+4 f x-b \log (f)}{2 \sqrt {2} \sqrt {f}}\right ) \log (f) (\cosh (2 d)-\sinh (2 d))+b \sqrt {\pi } \text {Erfi}\left (\frac {2 e+4 f x+b \log (f)}{2 \sqrt {2} \sqrt {f}}\right ) \log (f) (\cosh (2 d)+\sinh (2 d))\right )}{8 \sqrt {2} b \log (f)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 2.15, size = 158, normalized size = 0.98
method | result | size |
risch | \(-\frac {\sqrt {\pi }\, f^{a} {\mathrm e}^{\frac {b^{2} \ln \left (f \right )^{2}-4 \ln \left (f \right ) b e -16 d f +4 e^{2}}{8 f}} \sqrt {2}\, \erf \left (-\sqrt {2}\, \sqrt {f}\, x +\frac {\left (b \ln \left (f \right )-2 e \right ) \sqrt {2}}{4 \sqrt {f}}\right )}{16 \sqrt {f}}-\frac {\sqrt {\pi }\, f^{a} {\mathrm e}^{-\frac {b^{2} \ln \left (f \right )^{2}+4 \ln \left (f \right ) b e -16 d f +4 e^{2}}{8 f}} \erf \left (-\sqrt {-2 f}\, x +\frac {2 e +b \ln \left (f \right )}{2 \sqrt {-2 f}}\right )}{8 \sqrt {-2 f}}+\frac {f^{a} f^{b x}}{2 b \ln \left (f \right )}\) | \(158\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.50, size = 147, normalized size = 0.91 \begin {gather*} \frac {\sqrt {2} \sqrt {\pi } f^{a} \operatorname {erf}\left (\sqrt {2} \sqrt {-f} x - \frac {\sqrt {2} {\left (b \log \left (f\right ) + 2 \, e\right )}}{4 \, \sqrt {-f}}\right ) e^{\left (2 \, d - \frac {{\left (b \log \left (f\right ) + 2 \, e\right )}^{2}}{8 \, f}\right )}}{16 \, \sqrt {-f}} + \frac {\sqrt {2} \sqrt {\pi } f^{a} \operatorname {erf}\left (\sqrt {2} \sqrt {f} x - \frac {\sqrt {2} {\left (b \log \left (f\right ) - 2 \, e\right )}}{4 \, \sqrt {f}}\right ) e^{\left (-2 \, d + \frac {{\left (b \log \left (f\right ) - 2 \, e\right )}^{2}}{8 \, f}\right )}}{16 \, \sqrt {f}} + \frac {f^{b x + a}}{2 \, b \log \left (f\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 434 vs.
\(2 (130) = 260\).
time = 0.39, size = 434, normalized size = 2.70 \begin {gather*} -\frac {\sqrt {2} \sqrt {\pi } b \sqrt {-f} \cosh \left (\frac {b^{2} \log \left (f\right )^{2} - 16 \, d f + 4 \, \cosh \left (1\right )^{2} - 4 \, {\left (2 \, a f - b \cosh \left (1\right ) - b \sinh \left (1\right )\right )} \log \left (f\right ) + 8 \, \cosh \left (1\right ) \sinh \left (1\right ) + 4 \, \sinh \left (1\right )^{2}}{8 \, f}\right ) \operatorname {erf}\left (\frac {\sqrt {2} {\left (4 \, f x + b \log \left (f\right ) + 2 \, \cosh \left (1\right ) + 2 \, \sinh \left (1\right )\right )} \sqrt {-f}}{4 \, f}\right ) \log \left (f\right ) + \sqrt {2} \sqrt {\pi } b \sqrt {f} \cosh \left (\frac {b^{2} \log \left (f\right )^{2} - 16 \, d f + 4 \, \cosh \left (1\right )^{2} + 4 \, {\left (2 \, a f - b \cosh \left (1\right ) - b \sinh \left (1\right )\right )} \log \left (f\right ) + 8 \, \cosh \left (1\right ) \sinh \left (1\right ) + 4 \, \sinh \left (1\right )^{2}}{8 \, f}\right ) \operatorname {erf}\left (-\frac {\sqrt {2} {\left (4 \, f x - b \log \left (f\right ) + 2 \, \cosh \left (1\right ) + 2 \, \sinh \left (1\right )\right )}}{4 \, \sqrt {f}}\right ) \log \left (f\right ) + \sqrt {2} \sqrt {\pi } b \sqrt {f} \operatorname {erf}\left (-\frac {\sqrt {2} {\left (4 \, f x - b \log \left (f\right ) + 2 \, \cosh \left (1\right ) + 2 \, \sinh \left (1\right )\right )}}{4 \, \sqrt {f}}\right ) \log \left (f\right ) \sinh \left (\frac {b^{2} \log \left (f\right )^{2} - 16 \, d f + 4 \, \cosh \left (1\right )^{2} + 4 \, {\left (2 \, a f - b \cosh \left (1\right ) - b \sinh \left (1\right )\right )} \log \left (f\right ) + 8 \, \cosh \left (1\right ) \sinh \left (1\right ) + 4 \, \sinh \left (1\right )^{2}}{8 \, f}\right ) - \sqrt {2} \sqrt {\pi } b \sqrt {-f} \operatorname {erf}\left (\frac {\sqrt {2} {\left (4 \, f x + b \log \left (f\right ) + 2 \, \cosh \left (1\right ) + 2 \, \sinh \left (1\right )\right )} \sqrt {-f}}{4 \, f}\right ) \log \left (f\right ) \sinh \left (\frac {b^{2} \log \left (f\right )^{2} - 16 \, d f + 4 \, \cosh \left (1\right )^{2} - 4 \, {\left (2 \, a f - b \cosh \left (1\right ) - b \sinh \left (1\right )\right )} \log \left (f\right ) + 8 \, \cosh \left (1\right ) \sinh \left (1\right ) + 4 \, \sinh \left (1\right )^{2}}{8 \, f}\right ) - 8 \, f \cosh \left ({\left (b x + a\right )} \log \left (f\right )\right ) - 8 \, f \sinh \left ({\left (b x + a\right )} \log \left (f\right )\right )}{16 \, b f \log \left (f\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int f^{a + b x} \cosh ^{2}{\left (d + e x + f x^{2} \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [C] Result contains complex when optimal does not.
time = 0.42, size = 387, normalized size = 2.40 \begin {gather*} -\frac {\sqrt {2} \sqrt {\pi } \operatorname {erf}\left (-\frac {1}{4} \, \sqrt {2} \sqrt {-f} {\left (4 \, x + \frac {b \log \left (f\right ) + 2 \, e}{f}\right )}\right ) e^{\left (-\frac {b^{2} \log \left (f\right )^{2} + 4 \, b e \log \left (f\right ) - 8 \, a f \log \left (f\right ) + 4 \, e^{2} - 16 \, d f}{8 \, f}\right )}}{16 \, \sqrt {-f}} - \frac {\sqrt {2} \sqrt {\pi } \operatorname {erf}\left (-\frac {1}{4} \, \sqrt {2} \sqrt {f} {\left (4 \, x - \frac {b \log \left (f\right ) - 2 \, e}{f}\right )}\right ) e^{\left (\frac {b^{2} \log \left (f\right )^{2} - 4 \, b e \log \left (f\right ) + 8 \, a f \log \left (f\right ) + 4 \, e^{2} - 16 \, d f}{8 \, f}\right )}}{16 \, \sqrt {f}} + {\left (\frac {2 \, b \cos \left (-\frac {1}{2} \, \pi b x \mathrm {sgn}\left (f\right ) + \frac {1}{2} \, \pi b x - \frac {1}{2} \, \pi a \mathrm {sgn}\left (f\right ) + \frac {1}{2} \, \pi a\right ) \log \left ({\left | f \right |}\right )}{4 \, b^{2} \log \left ({\left | f \right |}\right )^{2} + {\left (\pi b \mathrm {sgn}\left (f\right ) - \pi b\right )}^{2}} - \frac {{\left (\pi b \mathrm {sgn}\left (f\right ) - \pi b\right )} \sin \left (-\frac {1}{2} \, \pi b x \mathrm {sgn}\left (f\right ) + \frac {1}{2} \, \pi b x - \frac {1}{2} \, \pi a \mathrm {sgn}\left (f\right ) + \frac {1}{2} \, \pi a\right )}{4 \, b^{2} \log \left ({\left | f \right |}\right )^{2} + {\left (\pi b \mathrm {sgn}\left (f\right ) - \pi b\right )}^{2}}\right )} e^{\left (b x \log \left ({\left | f \right |}\right ) + a \log \left ({\left | f \right |}\right )\right )} + i \, {\left (\frac {i \, e^{\left (\frac {1}{2} i \, \pi b x \mathrm {sgn}\left (f\right ) - \frac {1}{2} i \, \pi b x + \frac {1}{2} i \, \pi a \mathrm {sgn}\left (f\right ) - \frac {1}{2} i \, \pi a\right )}}{2 i \, \pi b \mathrm {sgn}\left (f\right ) - 2 i \, \pi b + 4 \, b \log \left ({\left | f \right |}\right )} - \frac {i \, e^{\left (-\frac {1}{2} i \, \pi b x \mathrm {sgn}\left (f\right ) + \frac {1}{2} i \, \pi b x - \frac {1}{2} i \, \pi a \mathrm {sgn}\left (f\right ) + \frac {1}{2} i \, \pi a\right )}}{-2 i \, \pi b \mathrm {sgn}\left (f\right ) + 2 i \, \pi b + 4 \, b \log \left ({\left | f \right |}\right )}\right )} e^{\left (b x \log \left ({\left | f \right |}\right ) + a \log \left ({\left | f \right |}\right )\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int f^{a+b\,x}\,{\mathrm {cosh}\left (f\,x^2+e\,x+d\right )}^2 \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________