Integrand size = 13, antiderivative size = 75 \[ \int x \cosh ^2\left (\frac {1}{4}+x+x^2\right ) \, dx=\frac {x^2}{4}-\frac {1}{16} \sqrt {\frac {\pi }{2}} \text {erf}\left (\frac {1+2 x}{\sqrt {2}}\right )-\frac {1}{16} \sqrt {\frac {\pi }{2}} \text {erfi}\left (\frac {1+2 x}{\sqrt {2}}\right )+\frac {1}{8} \sinh \left (\frac {1}{2}+2 x+2 x^2\right ) \] Output:
1/4*x^2-1/32*2^(1/2)*Pi^(1/2)*erf(1/2*2^(1/2)*(1+2*x))-1/32*2^(1/2)*Pi^(1/ 2)*erfi(1/2*2^(1/2)*(1+2*x))+1/8*sinh(1/2+2*x+2*x^2)
Time = 0.15 (sec) , antiderivative size = 88, normalized size of antiderivative = 1.17 \[ \int x \cosh ^2\left (\frac {1}{4}+x+x^2\right ) \, dx=\frac {8 \sqrt {e} x^2+2 (-1+e) \cosh (2 x (1+x))-\sqrt {2 e \pi } \text {erf}\left (\frac {1+2 x}{\sqrt {2}}\right )-\sqrt {2 e \pi } \text {erfi}\left (\frac {1+2 x}{\sqrt {2}}\right )+2 (1+e) \sinh (2 x (1+x))}{32 \sqrt {e}} \] Input:
Integrate[x*Cosh[1/4 + x + x^2]^2,x]
Output:
(8*Sqrt[E]*x^2 + 2*(-1 + E)*Cosh[2*x*(1 + x)] - Sqrt[2*E*Pi]*Erf[(1 + 2*x) /Sqrt[2]] - Sqrt[2*E*Pi]*Erfi[(1 + 2*x)/Sqrt[2]] + 2*(1 + E)*Sinh[2*x*(1 + x)])/(32*Sqrt[E])
Time = 0.24 (sec) , antiderivative size = 75, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.154, Rules used = {5918, 2009}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int x \cosh ^2\left (x^2+x+\frac {1}{4}\right ) \, dx\) |
\(\Big \downarrow \) 5918 |
\(\displaystyle \int \left (\frac {1}{2} x \cosh \left (2 x^2+2 x+\frac {1}{2}\right )+\frac {x}{2}\right )dx\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle -\frac {1}{16} \sqrt {\frac {\pi }{2}} \text {erf}\left (\frac {2 x+1}{\sqrt {2}}\right )-\frac {1}{16} \sqrt {\frac {\pi }{2}} \text {erfi}\left (\frac {2 x+1}{\sqrt {2}}\right )+\frac {x^2}{4}+\frac {1}{8} \sinh \left (2 x^2+2 x+\frac {1}{2}\right )\) |
Input:
Int[x*Cosh[1/4 + x + x^2]^2,x]
Output:
x^2/4 - (Sqrt[Pi/2]*Erf[(1 + 2*x)/Sqrt[2]])/16 - (Sqrt[Pi/2]*Erfi[(1 + 2*x )/Sqrt[2]])/16 + Sinh[1/2 + 2*x + 2*x^2]/8
Int[Cosh[(a_.) + (b_.)*(x_) + (c_.)*(x_)^2]^(n_)*((d_.) + (e_.)*(x_))^(m_.) , x_Symbol] :> Int[ExpandTrigReduce[(d + e*x)^m, Cosh[a + b*x + c*x^2]^n, x ], x] /; FreeQ[{a, b, c, d, e, m}, x] && IGtQ[n, 1]
Result contains complex when optimal does not.
Time = 1.23 (sec) , antiderivative size = 75, normalized size of antiderivative = 1.00
method | result | size |
risch | \(\frac {x^{2}}{4}-\frac {{\mathrm e}^{-\frac {\left (1+2 x \right )^{2}}{2}}}{16}-\frac {\sqrt {\pi }\, \sqrt {2}\, \operatorname {erf}\left (\sqrt {2}\, x +\frac {\sqrt {2}}{2}\right )}{32}+\frac {{\mathrm e}^{\frac {\left (1+2 x \right )^{2}}{2}}}{16}+\frac {i \sqrt {\pi }\, \sqrt {2}\, \operatorname {erf}\left (i \sqrt {2}\, x +\frac {i \sqrt {2}}{2}\right )}{32}\) | \(75\) |
Input:
int(x*cosh(1/4+x+x^2)^2,x,method=_RETURNVERBOSE)
Output:
1/4*x^2-1/16*exp(-1/2*(1+2*x)^2)-1/32*Pi^(1/2)*2^(1/2)*erf(2^(1/2)*x+1/2*2 ^(1/2))+1/16*exp(1/2*(1+2*x)^2)+1/32*I*Pi^(1/2)*2^(1/2)*erf(I*2^(1/2)*x+1/ 2*I*2^(1/2))
Leaf count of result is larger than twice the leaf count of optimal. 306 vs. \(2 (57) = 114\).
Time = 0.11 (sec) , antiderivative size = 306, normalized size of antiderivative = 4.08 \[ \int x \cosh ^2\left (\frac {1}{4}+x+x^2\right ) \, dx=\frac {8 \, x^{2} \cosh \left (x^{2} + x + \frac {1}{4}\right )^{2} + 2 \, \cosh \left (x^{2} + x + \frac {1}{4}\right )^{4} + 8 \, \cosh \left (x^{2} + x + \frac {1}{4}\right ) \sinh \left (x^{2} + x + \frac {1}{4}\right )^{3} + 2 \, \sinh \left (x^{2} + x + \frac {1}{4}\right )^{4} + 4 \, {\left (2 \, x^{2} + 3 \, \cosh \left (x^{2} + x + \frac {1}{4}\right )^{2}\right )} \sinh \left (x^{2} + x + \frac {1}{4}\right )^{2} + 8 \, {\left (2 \, x^{2} \cosh \left (x^{2} + x + \frac {1}{4}\right ) + \cosh \left (x^{2} + x + \frac {1}{4}\right )^{3}\right )} \sinh \left (x^{2} + x + \frac {1}{4}\right ) - \sqrt {\pi } {\left (\sqrt {2} \cosh \left (x^{2} + x + \frac {1}{4}\right )^{2} \operatorname {erf}\left (\frac {1}{2} \, \sqrt {2} {\left (2 \, x + 1\right )}\right ) - \sqrt {-2} \cosh \left (x^{2} + x + \frac {1}{4}\right )^{2} \operatorname {erf}\left (\frac {1}{2} \, \sqrt {-2} {\left (2 \, x + 1\right )}\right ) + {\left (\sqrt {2} \operatorname {erf}\left (\frac {1}{2} \, \sqrt {2} {\left (2 \, x + 1\right )}\right ) - \sqrt {-2} \operatorname {erf}\left (\frac {1}{2} \, \sqrt {-2} {\left (2 \, x + 1\right )}\right )\right )} \sinh \left (x^{2} + x + \frac {1}{4}\right )^{2} + 2 \, {\left (\sqrt {2} \cosh \left (x^{2} + x + \frac {1}{4}\right ) \operatorname {erf}\left (\frac {1}{2} \, \sqrt {2} {\left (2 \, x + 1\right )}\right ) - \sqrt {-2} \cosh \left (x^{2} + x + \frac {1}{4}\right ) \operatorname {erf}\left (\frac {1}{2} \, \sqrt {-2} {\left (2 \, x + 1\right )}\right )\right )} \sinh \left (x^{2} + x + \frac {1}{4}\right )\right )} - 2}{32 \, {\left (\cosh \left (x^{2} + x + \frac {1}{4}\right )^{2} + 2 \, \cosh \left (x^{2} + x + \frac {1}{4}\right ) \sinh \left (x^{2} + x + \frac {1}{4}\right ) + \sinh \left (x^{2} + x + \frac {1}{4}\right )^{2}\right )}} \] Input:
integrate(x*cosh(1/4+x+x^2)^2,x, algorithm="fricas")
Output:
1/32*(8*x^2*cosh(x^2 + x + 1/4)^2 + 2*cosh(x^2 + x + 1/4)^4 + 8*cosh(x^2 + x + 1/4)*sinh(x^2 + x + 1/4)^3 + 2*sinh(x^2 + x + 1/4)^4 + 4*(2*x^2 + 3*c osh(x^2 + x + 1/4)^2)*sinh(x^2 + x + 1/4)^2 + 8*(2*x^2*cosh(x^2 + x + 1/4) + cosh(x^2 + x + 1/4)^3)*sinh(x^2 + x + 1/4) - sqrt(pi)*(sqrt(2)*cosh(x^2 + x + 1/4)^2*erf(1/2*sqrt(2)*(2*x + 1)) - sqrt(-2)*cosh(x^2 + x + 1/4)^2* erf(1/2*sqrt(-2)*(2*x + 1)) + (sqrt(2)*erf(1/2*sqrt(2)*(2*x + 1)) - sqrt(- 2)*erf(1/2*sqrt(-2)*(2*x + 1)))*sinh(x^2 + x + 1/4)^2 + 2*(sqrt(2)*cosh(x^ 2 + x + 1/4)*erf(1/2*sqrt(2)*(2*x + 1)) - sqrt(-2)*cosh(x^2 + x + 1/4)*erf (1/2*sqrt(-2)*(2*x + 1)))*sinh(x^2 + x + 1/4)) - 2)/(cosh(x^2 + x + 1/4)^2 + 2*cosh(x^2 + x + 1/4)*sinh(x^2 + x + 1/4) + sinh(x^2 + x + 1/4)^2)
\[ \int x \cosh ^2\left (\frac {1}{4}+x+x^2\right ) \, dx=\int x \cosh ^{2}{\left (x^{2} + x + \frac {1}{4} \right )}\, dx \] Input:
integrate(x*cosh(1/4+x+x**2)**2,x)
Output:
Integral(x*cosh(x**2 + x + 1/4)**2, x)
Result contains complex when optimal does not.
Time = 0.23 (sec) , antiderivative size = 121, normalized size of antiderivative = 1.61 \[ \int x \cosh ^2\left (\frac {1}{4}+x+x^2\right ) \, dx=\frac {1}{4} \, x^{2} - \frac {1}{32} \, \sqrt {2} {\left (\frac {\sqrt {\pi } {\left (2 \, x + 1\right )} {\left (\operatorname {erf}\left (\sqrt {\frac {1}{2}} \sqrt {-{\left (2 \, x + 1\right )}^{2}}\right ) - 1\right )}}{\sqrt {-{\left (2 \, x + 1\right )}^{2}}} - \sqrt {2} e^{\left (\frac {1}{2} \, {\left (2 \, x + 1\right )}^{2}\right )}\right )} - \frac {1}{32} i \, \sqrt {2} {\left (-\frac {i \, \sqrt {\pi } {\left (2 \, x + 1\right )} {\left (\operatorname {erf}\left (\sqrt {\frac {1}{2}} \sqrt {{\left (2 \, x + 1\right )}^{2}}\right ) - 1\right )}}{\sqrt {{\left (2 \, x + 1\right )}^{2}}} - i \, \sqrt {2} e^{\left (-\frac {1}{2} \, {\left (2 \, x + 1\right )}^{2}\right )}\right )} \] Input:
integrate(x*cosh(1/4+x+x^2)^2,x, algorithm="maxima")
Output:
1/4*x^2 - 1/32*sqrt(2)*(sqrt(pi)*(2*x + 1)*(erf(sqrt(1/2)*sqrt(-(2*x + 1)^ 2)) - 1)/sqrt(-(2*x + 1)^2) - sqrt(2)*e^(1/2*(2*x + 1)^2)) - 1/32*I*sqrt(2 )*(-I*sqrt(pi)*(2*x + 1)*(erf(sqrt(1/2)*sqrt((2*x + 1)^2)) - 1)/sqrt((2*x + 1)^2) - I*sqrt(2)*e^(-1/2*(2*x + 1)^2))
Result contains complex when optimal does not.
Time = 0.11 (sec) , antiderivative size = 70, normalized size of antiderivative = 0.93 \[ \int x \cosh ^2\left (\frac {1}{4}+x+x^2\right ) \, dx=\frac {1}{4} \, x^{2} - \frac {1}{32} \, \sqrt {2} \sqrt {\pi } \operatorname {erf}\left (\frac {1}{2} \, \sqrt {2} {\left (2 \, x + 1\right )}\right ) - \frac {1}{32} i \, \sqrt {2} \sqrt {\pi } \operatorname {erf}\left (-\frac {1}{2} i \, \sqrt {2} {\left (2 \, x + 1\right )}\right ) + \frac {1}{16} \, e^{\left (2 \, x^{2} + 2 \, x + \frac {1}{2}\right )} - \frac {1}{16} \, e^{\left (-2 \, x^{2} - 2 \, x - \frac {1}{2}\right )} \] Input:
integrate(x*cosh(1/4+x+x^2)^2,x, algorithm="giac")
Output:
1/4*x^2 - 1/32*sqrt(2)*sqrt(pi)*erf(1/2*sqrt(2)*(2*x + 1)) - 1/32*I*sqrt(2 )*sqrt(pi)*erf(-1/2*I*sqrt(2)*(2*x + 1)) + 1/16*e^(2*x^2 + 2*x + 1/2) - 1/ 16*e^(-2*x^2 - 2*x - 1/2)
Timed out. \[ \int x \cosh ^2\left (\frac {1}{4}+x+x^2\right ) \, dx=\int x\,{\mathrm {cosh}\left (x^2+x+\frac {1}{4}\right )}^2 \,d x \] Input:
int(x*cosh(x + x^2 + 1/4)^2,x)
Output:
int(x*cosh(x + x^2 + 1/4)^2, x)
\[ \int x \cosh ^2\left (\frac {1}{4}+x+x^2\right ) \, dx=\frac {\sqrt {\pi }\, e^{2 x^{2}+2 x} \mathrm {erf}\left (\frac {2 i x +i}{\sqrt {2}}\right ) e i +e^{4 x^{2}+4 x +\frac {1}{2}} \sqrt {2}\, e -2 e^{2 x^{2}+2 x +\frac {1}{2}} \sqrt {2}\, \left (\int \frac {1}{e^{2 x^{2}+2 x}}d x \right )+4 e^{2 x^{2}+2 x} \sqrt {2}\, e \,x^{2}-\sqrt {e}\, \sqrt {2}}{16 e^{2 x^{2}+2 x} \sqrt {2}\, e} \] Input:
int(x*cosh(1/4+x+x^2)^2,x)
Output:
(sqrt(pi)*e**(2*x**2 + 2*x)*erf((2*i*x + i)/sqrt(2))*e*i + e**((8*x**2 + 8 *x + 1)/2)*sqrt(2)*e - 2*e**((4*x**2 + 4*x + 1)/2)*sqrt(2)*int(1/e**(2*x** 2 + 2*x),x) + 4*e**(2*x**2 + 2*x)*sqrt(2)*e*x**2 - sqrt(e)*sqrt(2))/(16*e* *(2*x**2 + 2*x)*sqrt(2)*e)