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

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

Optimal result

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

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

Mathematica [A] (verified)

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

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

Output:

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

Rubi [A] (verified)

Time = 0.38 (sec) , antiderivative size = 118, normalized size of antiderivative = 1.06, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.385, Rules used = {5906, 5898, 2664, 2633, 2634}

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 \left (a+b x+c x^2\right ) \, dx\)

\(\Big \downarrow \) 5906

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

\(\Big \downarrow \) 5898

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

\(\Big \downarrow \) 2664

\(\displaystyle \frac {\sinh \left (a+b x+c x^2\right )}{2 c}-\frac {b \left (\frac {1}{2} e^{\frac {b^2}{4 c}-a} \int e^{-\frac {(b+2 c x)^2}{4 c}}dx+\frac {1}{2} e^{a-\frac {b^2}{4 c}} \int e^{\frac {(b+2 c x)^2}{4 c}}dx\right )}{2 c}\)

\(\Big \downarrow \) 2633

\(\displaystyle \frac {\sinh \left (a+b x+c x^2\right )}{2 c}-\frac {b \left (\frac {1}{2} e^{\frac {b^2}{4 c}-a} \int e^{-\frac {(b+2 c x)^2}{4 c}}dx+\frac {\sqrt {\pi } e^{a-\frac {b^2}{4 c}} \text {erfi}\left (\frac {b+2 c x}{2 \sqrt {c}}\right )}{4 \sqrt {c}}\right )}{2 c}\)

\(\Big \downarrow \) 2634

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

Input:

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

Output:

-1/2*(b*((E^(-a + b^2/(4*c))*Sqrt[Pi]*Erf[(b + 2*c*x)/(2*Sqrt[c])])/(4*Sqr 
t[c]) + (E^(a - b^2/(4*c))*Sqrt[Pi]*Erfi[(b + 2*c*x)/(2*Sqrt[c])])/(4*Sqrt 
[c])))/c + Sinh[a + b*x + c*x^2]/(2*c)
 

Defintions of rubi rules used

rule 2633
Int[(F_)^((a_.) + (b_.)*((c_.) + (d_.)*(x_))^2), x_Symbol] :> Simp[F^a*Sqrt 
[Pi]*(Erfi[(c + d*x)*Rt[b*Log[F], 2]]/(2*d*Rt[b*Log[F], 2])), x] /; FreeQ[{ 
F, a, b, c, d}, x] && PosQ[b]
 

rule 2634
Int[(F_)^((a_.) + (b_.)*((c_.) + (d_.)*(x_))^2), x_Symbol] :> Simp[F^a*Sqrt 
[Pi]*(Erf[(c + d*x)*Rt[(-b)*Log[F], 2]]/(2*d*Rt[(-b)*Log[F], 2])), x] /; Fr 
eeQ[{F, a, b, c, d}, x] && NegQ[b]
 

rule 2664
Int[(F_)^((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Simp[F^(a - b^2/ 
(4*c))   Int[F^((b + 2*c*x)^2/(4*c)), x], x] /; FreeQ[{F, a, b, c}, x]
 

rule 5898
Int[Cosh[(a_.) + (b_.)*(x_) + (c_.)*(x_)^2], x_Symbol] :> Simp[1/2   Int[E^ 
(a + b*x + c*x^2), x], x] + Simp[1/2   Int[E^(-a - b*x - c*x^2), x], x] /; 
FreeQ[{a, b, c}, x]
 

rule 5906
Int[Cosh[(a_.) + (b_.)*(x_) + (c_.)*(x_)^2]*((d_.) + (e_.)*(x_)), x_Symbol] 
 :> Simp[e*(Sinh[a + b*x + c*x^2]/(2*c)), x] - Simp[(b*e - 2*c*d)/(2*c)   I 
nt[Cosh[a + b*x + c*x^2], x], x] /; FreeQ[{a, b, c, d, e}, x] && NeQ[b*e - 
2*c*d, 0]
 
Maple [A] (verified)

Time = 0.38 (sec) , antiderivative size = 124, normalized size of antiderivative = 1.12

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

Input:

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

Output:

-1/4/c*exp(-c*x^2-b*x-a)-1/8*b/c^(3/2)*Pi^(1/2)*exp(-1/4*(4*a*c-b^2)/c)*er 
f(c^(1/2)*x+1/2*b/c^(1/2))+1/4/c*exp(c*x^2+b*x+a)+1/8*b/c*Pi^(1/2)*exp(1/4 
*(4*a*c-b^2)/c)/(-c)^(1/2)*erf(-(-c)^(1/2)*x+1/2*b/(-c)^(1/2))
 

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 344 vs. \(2 (83) = 166\).

Time = 0.09 (sec) , antiderivative size = 344, normalized size of antiderivative = 3.10 \[ \int x \cosh \left (a+b x+c x^2\right ) \, dx=\frac {2 \, c \cosh \left (c x^{2} + b x + a\right )^{2} + \sqrt {\pi } {\left (b \cosh \left (c x^{2} + b x + a\right ) \cosh \left (-\frac {b^{2} - 4 \, a c}{4 \, c}\right ) + b \cosh \left (c x^{2} + b x + a\right ) \sinh \left (-\frac {b^{2} - 4 \, a c}{4 \, c}\right ) + {\left (b \cosh \left (-\frac {b^{2} - 4 \, a c}{4 \, c}\right ) + b \sinh \left (-\frac {b^{2} - 4 \, a c}{4 \, c}\right )\right )} \sinh \left (c x^{2} + b x + a\right )\right )} \sqrt {-c} \operatorname {erf}\left (\frac {{\left (2 \, c x + b\right )} \sqrt {-c}}{2 \, c}\right ) - \sqrt {\pi } {\left (b \cosh \left (c x^{2} + b x + a\right ) \cosh \left (-\frac {b^{2} - 4 \, a c}{4 \, c}\right ) - b \cosh \left (c x^{2} + b x + a\right ) \sinh \left (-\frac {b^{2} - 4 \, a c}{4 \, c}\right ) + {\left (b \cosh \left (-\frac {b^{2} - 4 \, a c}{4 \, c}\right ) - b \sinh \left (-\frac {b^{2} - 4 \, a c}{4 \, c}\right )\right )} \sinh \left (c x^{2} + b x + a\right )\right )} \sqrt {c} \operatorname {erf}\left (\frac {2 \, c x + b}{2 \, \sqrt {c}}\right ) + 4 \, c \cosh \left (c x^{2} + b x + a\right ) \sinh \left (c x^{2} + b x + a\right ) + 2 \, c \sinh \left (c x^{2} + b x + a\right )^{2} - 2 \, c}{8 \, {\left (c^{2} \cosh \left (c x^{2} + b x + a\right ) + c^{2} \sinh \left (c x^{2} + b x + a\right )\right )}} \] Input:

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

Output:

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

Sympy [F]

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

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

Output:

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

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 611 vs. \(2 (83) = 166\).

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

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

Output:

1/2*x^2*cosh(c*x^2 + b*x + a) - 1/32*(sqrt(pi)*(2*c*x + b)*b^2*(erf(1/2*sq 
rt(-(2*c*x + b)^2/c)) - 1)/(sqrt(-(2*c*x + b)^2/c)*c^(5/2)) - 4*b*e^(1/4*( 
2*c*x + b)^2/c)/c^(3/2) - 4*(2*c*x + b)^3*gamma(3/2, -1/4*(2*c*x + b)^2/c) 
/((-(2*c*x + b)^2/c)^(3/2)*c^(5/2)))*b*e^(a - 1/4*b^2/c)/sqrt(c) + 1/32*(s 
qrt(pi)*(2*c*x + b)*b^3*(erf(1/2*sqrt(-(2*c*x + b)^2/c)) - 1)/(sqrt(-(2*c* 
x + b)^2/c)*c^(7/2)) - 6*b^2*e^(1/4*(2*c*x + b)^2/c)/c^(5/2) - 12*(2*c*x + 
 b)^3*b*gamma(3/2, -1/4*(2*c*x + b)^2/c)/((-(2*c*x + b)^2/c)^(3/2)*c^(7/2) 
) + 8*gamma(2, -1/4*(2*c*x + b)^2/c)/c^(3/2))*sqrt(c)*e^(a - 1/4*b^2/c) - 
1/32*(sqrt(pi)*(2*c*x + b)*b^2*(erf(1/2*sqrt((2*c*x + b)^2/c)) - 1)/(sqrt( 
(2*c*x + b)^2/c)*(-c)^(5/2)) + 4*b*c*e^(-1/4*(2*c*x + b)^2/c)/(-c)^(5/2) - 
 4*(2*c*x + b)^3*gamma(3/2, 1/4*(2*c*x + b)^2/c)/(((2*c*x + b)^2/c)^(3/2)* 
(-c)^(5/2)))*b*e^(-a + 1/4*b^2/c)/sqrt(-c) - 1/32*(sqrt(pi)*(2*c*x + b)*b^ 
3*(erf(1/2*sqrt((2*c*x + b)^2/c)) - 1)/(sqrt((2*c*x + b)^2/c)*(-c)^(7/2)) 
+ 6*b^2*c*e^(-1/4*(2*c*x + b)^2/c)/(-c)^(7/2) - 12*(2*c*x + b)^3*b*gamma(3 
/2, 1/4*(2*c*x + b)^2/c)/(((2*c*x + b)^2/c)^(3/2)*(-c)^(7/2)) + 8*c^2*gamm 
a(2, 1/4*(2*c*x + b)^2/c)/(-c)^(7/2))*c*e^(-a + 1/4*b^2/c)/sqrt(-c)
 

Giac [A] (verification not implemented)

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

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

Output:

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

Mupad [F(-1)]

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

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

Output:

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

Reduce [F]

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

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

Output:

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