\(\int x \cosh ^2(a+b x+c x^2) \, dx\) [17]

Optimal result
Mathematica [A] (verified)
Rubi [A] (verified)
Maple [A] (verified)
Fricas [B] (verification not implemented)
Sympy [F]
Maxima [A] (verification not implemented)
Giac [A] (verification not implemented)
Mupad [F(-1)]
Reduce [F]

Optimal result

Integrand size = 15, antiderivative size = 136 \[ \int x \cosh ^2\left (a+b x+c x^2\right ) \, dx=\frac {x^2}{4}-\frac {b e^{-2 a+\frac {b^2}{2 c}} \sqrt {\frac {\pi }{2}} \text {erf}\left (\frac {b+2 c x}{\sqrt {2} \sqrt {c}}\right )}{16 c^{3/2}}-\frac {b e^{2 a-\frac {b^2}{2 c}} \sqrt {\frac {\pi }{2}} \text {erfi}\left (\frac {b+2 c x}{\sqrt {2} \sqrt {c}}\right )}{16 c^{3/2}}+\frac {\sinh \left (2 a+2 b x+2 c x^2\right )}{8 c} \] Output:

1/4*x^2-1/32*b*exp(-2*a+1/2*b^2/c)*2^(1/2)*Pi^(1/2)*erf(1/2*(2*c*x+b)*2^(1 
/2)/c^(1/2))/c^(3/2)-1/32*b*exp(2*a-1/2*b^2/c)*2^(1/2)*Pi^(1/2)*erfi(1/2*( 
2*c*x+b)*2^(1/2)/c^(1/2))/c^(3/2)+1/8*sinh(2*c*x^2+2*b*x+2*a)/c
 

Mathematica [A] (verified)

Time = 0.27 (sec) , antiderivative size = 155, normalized size of antiderivative = 1.14 \[ \int x \cosh ^2\left (a+b x+c x^2\right ) \, dx=\frac {b \sqrt {2 \pi } \text {erf}\left (\frac {b+2 c x}{\sqrt {2} \sqrt {c}}\right ) \left (-\cosh \left (2 a-\frac {b^2}{2 c}\right )+\sinh \left (2 a-\frac {b^2}{2 c}\right )\right )-b \sqrt {2 \pi } \text {erfi}\left (\frac {b+2 c x}{\sqrt {2} \sqrt {c}}\right ) \left (\cosh \left (2 a-\frac {b^2}{2 c}\right )+\sinh \left (2 a-\frac {b^2}{2 c}\right )\right )+4 \sqrt {c} \left (2 c x^2+\sinh (2 (a+x (b+c x)))\right )}{32 c^{3/2}} \] Input:

Integrate[x*Cosh[a + b*x + c*x^2]^2,x]
 

Output:

(b*Sqrt[2*Pi]*Erf[(b + 2*c*x)/(Sqrt[2]*Sqrt[c])]*(-Cosh[2*a - b^2/(2*c)] + 
 Sinh[2*a - b^2/(2*c)]) - b*Sqrt[2*Pi]*Erfi[(b + 2*c*x)/(Sqrt[2]*Sqrt[c])] 
*(Cosh[2*a - b^2/(2*c)] + Sinh[2*a - b^2/(2*c)]) + 4*Sqrt[c]*(2*c*x^2 + Si 
nh[2*(a + x*(b + c*x))]))/(32*c^(3/2))
 

Rubi [A] (verified)

Time = 0.35 (sec) , antiderivative size = 136, 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.133, 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 (a+b x+c x^2\right ) \, dx\)

\(\Big \downarrow \) 5918

\(\displaystyle \int \left (\frac {1}{2} x \cosh \left (2 a+2 b x+2 c x^2\right )+\frac {x}{2}\right )dx\)

\(\Big \downarrow \) 2009

\(\displaystyle -\frac {\sqrt {\frac {\pi }{2}} b e^{\frac {b^2}{2 c}-2 a} \text {erf}\left (\frac {b+2 c x}{\sqrt {2} \sqrt {c}}\right )}{16 c^{3/2}}-\frac {\sqrt {\frac {\pi }{2}} b e^{2 a-\frac {b^2}{2 c}} \text {erfi}\left (\frac {b+2 c x}{\sqrt {2} \sqrt {c}}\right )}{16 c^{3/2}}+\frac {\sinh \left (2 a+2 b x+2 c x^2\right )}{8 c}+\frac {x^2}{4}\)

Input:

Int[x*Cosh[a + b*x + c*x^2]^2,x]
 

Output:

x^2/4 - (b*E^(-2*a + b^2/(2*c))*Sqrt[Pi/2]*Erf[(b + 2*c*x)/(Sqrt[2]*Sqrt[c 
])])/(16*c^(3/2)) - (b*E^(2*a - b^2/(2*c))*Sqrt[Pi/2]*Erfi[(b + 2*c*x)/(Sq 
rt[2]*Sqrt[c])])/(16*c^(3/2)) + Sinh[2*a + 2*b*x + 2*c*x^2]/(8*c)
 

Defintions of rubi rules used

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 5918
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]
 
Maple [A] (verified)

Time = 1.09 (sec) , antiderivative size = 141, normalized size of antiderivative = 1.04

method result size
risch \(\frac {x^{2}}{4}-\frac {{\mathrm e}^{-2 c \,x^{2}-2 b x -2 a}}{16 c}-\frac {b \sqrt {\pi }\, {\mathrm e}^{-\frac {4 a c -b^{2}}{2 c}} \sqrt {2}\, \operatorname {erf}\left (\sqrt {2}\, \sqrt {c}\, x +\frac {b \sqrt {2}}{2 \sqrt {c}}\right )}{32 c^{\frac {3}{2}}}+\frac {{\mathrm e}^{2 c \,x^{2}+2 b x +2 a}}{16 c}+\frac {b \sqrt {\pi }\, {\mathrm e}^{\frac {4 a c -b^{2}}{2 c}} \operatorname {erf}\left (-\sqrt {-2 c}\, x +\frac {b}{\sqrt {-2 c}}\right )}{16 c \sqrt {-2 c}}\) \(141\)

Input:

int(x*cosh(c*x^2+b*x+a)^2,x,method=_RETURNVERBOSE)
 

Output:

1/4*x^2-1/16/c*exp(-2*c*x^2-2*b*x-2*a)-1/32*b/c^(3/2)*Pi^(1/2)*exp(-1/2*(4 
*a*c-b^2)/c)*2^(1/2)*erf(2^(1/2)*c^(1/2)*x+1/2*b*2^(1/2)/c^(1/2))+1/16/c*e 
xp(2*c*x^2+2*b*x+2*a)+1/16*b/c*Pi^(1/2)*exp(1/2*(4*a*c-b^2)/c)/(-2*c)^(1/2 
)*erf(-(-2*c)^(1/2)*x+b/(-2*c)^(1/2))
 

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 647 vs. \(2 (106) = 212\).

Time = 0.09 (sec) , antiderivative size = 647, normalized size of antiderivative = 4.76 \[ \int x \cosh ^2\left (a+b x+c x^2\right ) \, dx =\text {Too large to display} \] Input:

integrate(x*cosh(c*x^2+b*x+a)^2,x, algorithm="fricas")
 

Output:

1/32*(8*c^2*x^2*cosh(c*x^2 + b*x + a)^2 + 2*c*cosh(c*x^2 + b*x + a)^4 + 8* 
c*cosh(c*x^2 + b*x + a)*sinh(c*x^2 + b*x + a)^3 + 2*c*sinh(c*x^2 + b*x + a 
)^4 + sqrt(2)*sqrt(pi)*(b*cosh(c*x^2 + b*x + a)^2*cosh(-1/2*(b^2 - 4*a*c)/ 
c) + b*cosh(c*x^2 + b*x + a)^2*sinh(-1/2*(b^2 - 4*a*c)/c) + (b*cosh(-1/2*( 
b^2 - 4*a*c)/c) + b*sinh(-1/2*(b^2 - 4*a*c)/c))*sinh(c*x^2 + b*x + a)^2 + 
2*(b*cosh(c*x^2 + b*x + a)*cosh(-1/2*(b^2 - 4*a*c)/c) + b*cosh(c*x^2 + b*x 
 + a)*sinh(-1/2*(b^2 - 4*a*c)/c))*sinh(c*x^2 + b*x + a))*sqrt(-c)*erf(1/2* 
sqrt(2)*(2*c*x + b)*sqrt(-c)/c) - sqrt(2)*sqrt(pi)*(b*cosh(c*x^2 + b*x + a 
)^2*cosh(-1/2*(b^2 - 4*a*c)/c) - b*cosh(c*x^2 + b*x + a)^2*sinh(-1/2*(b^2 
- 4*a*c)/c) + (b*cosh(-1/2*(b^2 - 4*a*c)/c) - b*sinh(-1/2*(b^2 - 4*a*c)/c) 
)*sinh(c*x^2 + b*x + a)^2 + 2*(b*cosh(c*x^2 + b*x + a)*cosh(-1/2*(b^2 - 4* 
a*c)/c) - b*cosh(c*x^2 + b*x + a)*sinh(-1/2*(b^2 - 4*a*c)/c))*sinh(c*x^2 + 
 b*x + a))*sqrt(c)*erf(1/2*sqrt(2)*(2*c*x + b)/sqrt(c)) + 4*(2*c^2*x^2 + 3 
*c*cosh(c*x^2 + b*x + a)^2)*sinh(c*x^2 + b*x + a)^2 + 8*(2*c^2*x^2*cosh(c* 
x^2 + b*x + a) + c*cosh(c*x^2 + b*x + a)^3)*sinh(c*x^2 + b*x + a) - 2*c)/( 
c^2*cosh(c*x^2 + b*x + a)^2 + 2*c^2*cosh(c*x^2 + b*x + a)*sinh(c*x^2 + b*x 
 + a) + c^2*sinh(c*x^2 + b*x + a)^2)
 

Sympy [F]

\[ \int x \cosh ^2\left (a+b x+c x^2\right ) \, dx=\int x \cosh ^{2}{\left (a + b x + c x^{2} \right )}\, dx \] Input:

integrate(x*cosh(c*x**2+b*x+a)**2,x)
 

Output:

Integral(x*cosh(a + b*x + c*x**2)**2, x)
 

Maxima [A] (verification not implemented)

Time = 0.16 (sec) , antiderivative size = 200, normalized size of antiderivative = 1.47 \[ \int x \cosh ^2\left (a+b x+c x^2\right ) \, dx=\frac {1}{4} \, x^{2} - \frac {\sqrt {2} {\left (\frac {\sqrt {\pi } {\left (2 \, c x + b\right )} b {\left (\operatorname {erf}\left (\sqrt {\frac {1}{2}} \sqrt {-\frac {{\left (2 \, c x + b\right )}^{2}}{c}}\right ) - 1\right )}}{\sqrt {-\frac {{\left (2 \, c x + b\right )}^{2}}{c}} c^{\frac {3}{2}}} - \frac {\sqrt {2} e^{\left (\frac {{\left (2 \, c x + b\right )}^{2}}{2 \, c}\right )}}{\sqrt {c}}\right )} e^{\left (2 \, a - \frac {b^{2}}{2 \, c}\right )}}{32 \, \sqrt {c}} - \frac {\sqrt {2} {\left (\frac {\sqrt {\pi } {\left (2 \, c x + b\right )} b {\left (\operatorname {erf}\left (\sqrt {\frac {1}{2}} \sqrt {\frac {{\left (2 \, c x + b\right )}^{2}}{c}}\right ) - 1\right )}}{\sqrt {\frac {{\left (2 \, c x + b\right )}^{2}}{c}} \left (-c\right )^{\frac {3}{2}}} + \frac {\sqrt {2} c e^{\left (-\frac {{\left (2 \, c x + b\right )}^{2}}{2 \, c}\right )}}{\left (-c\right )^{\frac {3}{2}}}\right )} e^{\left (-2 \, a + \frac {b^{2}}{2 \, c}\right )}}{32 \, \sqrt {-c}} \] Input:

integrate(x*cosh(c*x^2+b*x+a)^2,x, algorithm="maxima")
 

Output:

1/4*x^2 - 1/32*sqrt(2)*(sqrt(pi)*(2*c*x + b)*b*(erf(sqrt(1/2)*sqrt(-(2*c*x 
 + b)^2/c)) - 1)/(sqrt(-(2*c*x + b)^2/c)*c^(3/2)) - sqrt(2)*e^(1/2*(2*c*x 
+ b)^2/c)/sqrt(c))*e^(2*a - 1/2*b^2/c)/sqrt(c) - 1/32*sqrt(2)*(sqrt(pi)*(2 
*c*x + b)*b*(erf(sqrt(1/2)*sqrt((2*c*x + b)^2/c)) - 1)/(sqrt((2*c*x + b)^2 
/c)*(-c)^(3/2)) + sqrt(2)*c*e^(-1/2*(2*c*x + b)^2/c)/(-c)^(3/2))*e^(-2*a + 
 1/2*b^2/c)/sqrt(-c)
 

Giac [A] (verification not implemented)

Time = 0.12 (sec) , antiderivative size = 142, normalized size of antiderivative = 1.04 \[ \int x \cosh ^2\left (a+b x+c x^2\right ) \, dx=\frac {1}{4} \, x^{2} + \frac {\frac {\sqrt {2} \sqrt {\pi } b \operatorname {erf}\left (-\frac {1}{2} \, \sqrt {2} \sqrt {c} {\left (2 \, x + \frac {b}{c}\right )}\right ) e^{\left (\frac {b^{2} - 4 \, a c}{2 \, c}\right )}}{\sqrt {c}} - 2 \, e^{\left (-2 \, c x^{2} - 2 \, b x - 2 \, a\right )}}{32 \, c} + \frac {\frac {\sqrt {2} \sqrt {\pi } b \operatorname {erf}\left (-\frac {1}{2} \, \sqrt {2} \sqrt {-c} {\left (2 \, x + \frac {b}{c}\right )}\right ) e^{\left (-\frac {b^{2} - 4 \, a c}{2 \, c}\right )}}{\sqrt {-c}} + 2 \, e^{\left (2 \, c x^{2} + 2 \, b x + 2 \, a\right )}}{32 \, c} \] Input:

integrate(x*cosh(c*x^2+b*x+a)^2,x, algorithm="giac")
 

Output:

1/4*x^2 + 1/32*(sqrt(2)*sqrt(pi)*b*erf(-1/2*sqrt(2)*sqrt(c)*(2*x + b/c))*e 
^(1/2*(b^2 - 4*a*c)/c)/sqrt(c) - 2*e^(-2*c*x^2 - 2*b*x - 2*a))/c + 1/32*(s 
qrt(2)*sqrt(pi)*b*erf(-1/2*sqrt(2)*sqrt(-c)*(2*x + b/c))*e^(-1/2*(b^2 - 4* 
a*c)/c)/sqrt(-c) + 2*e^(2*c*x^2 + 2*b*x + 2*a))/c
 

Mupad [F(-1)]

Timed out. \[ \int x \cosh ^2\left (a+b x+c x^2\right ) \, dx=\int x\,{\mathrm {cosh}\left (c\,x^2+b\,x+a\right )}^2 \,d x \] Input:

int(x*cosh(a + b*x + c*x^2)^2,x)
 

Output:

int(x*cosh(a + b*x + c*x^2)^2, x)
 

Reduce [F]

\[ \int x \cosh ^2\left (a+b x+c x^2\right ) \, dx=\frac {\sqrt {\pi }\, e^{2 c \,x^{2}+2 b x +4 a} \mathrm {erf}\left (\frac {2 c i x +b i}{\sqrt {c}\, \sqrt {2}}\right ) b i +e^{\frac {8 c^{2} x^{2}+8 b c x +8 a c +b^{2}}{2 c}} \sqrt {c}\, \sqrt {2}+4 e^{\frac {4 c^{2} x^{2}+4 b c x +4 a c +b^{2}}{2 c}} \sqrt {c}\, \sqrt {2}\, c \,x^{2}-2 e^{\frac {4 c^{2} x^{2}+4 b c x +b^{2}}{2 c}} \sqrt {c}\, \sqrt {2}\, \left (\int \frac {1}{e^{2 c \,x^{2}+2 b x}}d x \right ) b -e^{\frac {b^{2}}{2 c}} \sqrt {c}\, \sqrt {2}}{16 e^{\frac {4 c^{2} x^{2}+4 b c x +4 a c +b^{2}}{2 c}} \sqrt {c}\, \sqrt {2}\, c} \] Input:

int(x*cosh(c*x^2+b*x+a)^2,x)
 

Output:

(sqrt(pi)*e**(4*a + 2*b*x + 2*c*x**2)*erf((b*i + 2*c*i*x)/(sqrt(c)*sqrt(2) 
))*b*i + e**((8*a*c + b**2 + 8*b*c*x + 8*c**2*x**2)/(2*c))*sqrt(c)*sqrt(2) 
 + 4*e**((4*a*c + b**2 + 4*b*c*x + 4*c**2*x**2)/(2*c))*sqrt(c)*sqrt(2)*c*x 
**2 - 2*e**((b**2 + 4*b*c*x + 4*c**2*x**2)/(2*c))*sqrt(c)*sqrt(2)*int(1/e* 
*(2*b*x + 2*c*x**2),x)*b - e**(b**2/(2*c))*sqrt(c)*sqrt(2))/(16*e**((4*a*c 
 + b**2 + 4*b*c*x + 4*c**2*x**2)/(2*c))*sqrt(c)*sqrt(2)*c)