\(\int f^{a+b x+c x^2} \cos ^3(d+f x^2) \, dx\) [142]

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

Optimal result

Integrand size = 23, antiderivative size = 378 \[ \int f^{a+b x+c x^2} \cos ^3\left (d+f x^2\right ) \, dx=-\frac {3 e^{-i d+\frac {b^2 \log ^2(f)}{4 i f-4 c \log (f)}} f^a \sqrt {\pi } \text {erf}\left (\frac {b \log (f)-2 x (i f-c \log (f))}{2 \sqrt {i f-c \log (f)}}\right )}{16 \sqrt {i f-c \log (f)}}-\frac {e^{-3 i d+\frac {b^2 \log ^2(f)}{12 i f-4 c \log (f)}} f^a \sqrt {\pi } \text {erf}\left (\frac {b \log (f)-2 x (3 i f-c \log (f))}{2 \sqrt {3 i f-c \log (f)}}\right )}{16 \sqrt {3 i f-c \log (f)}}+\frac {3 e^{i d-\frac {b^2 \log ^2(f)}{4 i f+4 c \log (f)}} f^a \sqrt {\pi } \text {erfi}\left (\frac {b \log (f)+2 x (i f+c \log (f))}{2 \sqrt {i f+c \log (f)}}\right )}{16 \sqrt {i f+c \log (f)}}+\frac {e^{3 i d-\frac {b^2 \log ^2(f)}{4 (3 i f+c \log (f))}} f^a \sqrt {\pi } \text {erfi}\left (\frac {b \log (f)+2 x (3 i f+c \log (f))}{2 \sqrt {3 i f+c \log (f)}}\right )}{16 \sqrt {3 i f+c \log (f)}} \] Output:

-3/16*exp(-I*d+b^2*ln(f)^2/(4*I*f-4*c*ln(f)))*f^a*Pi^(1/2)*erf(1/2*(b*ln(f 
)-2*x*(I*f-c*ln(f)))/(I*f-c*ln(f))^(1/2))/(I*f-c*ln(f))^(1/2)-1/16*exp(-3* 
I*d+b^2*ln(f)^2/(12*I*f-4*c*ln(f)))*f^a*Pi^(1/2)*erf(1/2*(b*ln(f)-2*x*(3*I 
*f-c*ln(f)))/(3*I*f-c*ln(f))^(1/2))/(3*I*f-c*ln(f))^(1/2)+3/16*exp(I*d-b^2 
*ln(f)^2/(4*I*f+4*c*ln(f)))*f^a*Pi^(1/2)*erfi(1/2*(b*ln(f)+2*x*(I*f+c*ln(f 
)))/(I*f+c*ln(f))^(1/2))/(I*f+c*ln(f))^(1/2)+1/16*exp(3*I*d-b^2*ln(f)^2/(1 
2*I*f+4*c*ln(f)))*f^a*Pi^(1/2)*erfi(1/2*(b*ln(f)+2*x*(3*I*f+c*ln(f)))/(3*I 
*f+c*ln(f))^(1/2))/(3*I*f+c*ln(f))^(1/2)
 

Mathematica [B] (warning: unable to verify)

Both result and optimal contain complex but leaf count is larger than twice the leaf count of optimal. \(3285\) vs. \(2(378)=756\).

Time = 6.65 (sec) , antiderivative size = 3285, normalized size of antiderivative = 8.69 \[ \int f^{a+b x+c x^2} \cos ^3\left (d+f x^2\right ) \, dx=\text {Result too large to show} \] Input:

Integrate[f^(a + b*x + c*x^2)*Cos[d + f*x^2]^3,x]
 

Output:

(f^a*Sqrt[Pi]*(-27*(-1)^(3/4)*E^(((I/4)*b^2*Log[f]^2)/(f - I*c*Log[f]))*f^ 
3*Cos[d]*Erfi[((-1)^(1/4)*(2*f*x - I*b*Log[f] - (2*I)*c*x*Log[f]))/(2*Sqrt 
[f - I*c*Log[f]])]*Sqrt[f - I*c*Log[f]] + 27*(-1)^(1/4)*c*E^(((I/4)*b^2*Lo 
g[f]^2)/(f - I*c*Log[f]))*f^2*Cos[d]*Erfi[((-1)^(1/4)*(2*f*x - I*b*Log[f] 
- (2*I)*c*x*Log[f]))/(2*Sqrt[f - I*c*Log[f]])]*Log[f]*Sqrt[f - I*c*Log[f]] 
 - 3*(-1)^(3/4)*c^2*E^(((I/4)*b^2*Log[f]^2)/(f - I*c*Log[f]))*f*Cos[d]*Erf 
i[((-1)^(1/4)*(2*f*x - I*b*Log[f] - (2*I)*c*x*Log[f]))/(2*Sqrt[f - I*c*Log 
[f]])]*Log[f]^2*Sqrt[f - I*c*Log[f]] + 3*(-1)^(1/4)*c^3*E^(((I/4)*b^2*Log[ 
f]^2)/(f - I*c*Log[f]))*Cos[d]*Erfi[((-1)^(1/4)*(2*f*x - I*b*Log[f] - (2*I 
)*c*x*Log[f]))/(2*Sqrt[f - I*c*Log[f]])]*Log[f]^3*Sqrt[f - I*c*Log[f]] - 3 
*(-1)^(3/4)*E^(((I/4)*b^2*Log[f]^2)/(3*f - I*c*Log[f]))*f^3*Cos[3*d]*Erfi[ 
((-1)^(1/4)*(6*f*x - I*b*Log[f] - (2*I)*c*x*Log[f]))/(2*Sqrt[3*f - I*c*Log 
[f]])]*Sqrt[3*f - I*c*Log[f]] + (-1)^(1/4)*c*E^(((I/4)*b^2*Log[f]^2)/(3*f 
- I*c*Log[f]))*f^2*Cos[3*d]*Erfi[((-1)^(1/4)*(6*f*x - I*b*Log[f] - (2*I)*c 
*x*Log[f]))/(2*Sqrt[3*f - I*c*Log[f]])]*Log[f]*Sqrt[3*f - I*c*Log[f]] - 3* 
(-1)^(3/4)*c^2*E^(((I/4)*b^2*Log[f]^2)/(3*f - I*c*Log[f]))*f*Cos[3*d]*Erfi 
[((-1)^(1/4)*(6*f*x - I*b*Log[f] - (2*I)*c*x*Log[f]))/(2*Sqrt[3*f - I*c*Lo 
g[f]])]*Log[f]^2*Sqrt[3*f - I*c*Log[f]] + (-1)^(1/4)*c^3*E^(((I/4)*b^2*Log 
[f]^2)/(3*f - I*c*Log[f]))*Cos[3*d]*Erfi[((-1)^(1/4)*(6*f*x - I*b*Log[f] - 
 (2*I)*c*x*Log[f]))/(2*Sqrt[3*f - I*c*Log[f]])]*Log[f]^3*Sqrt[3*f - I*c...
 

Rubi [A] (verified)

Time = 0.82 (sec) , antiderivative size = 378, 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.087, Rules used = {4976, 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 \cos ^3\left (d+f x^2\right ) f^{a+b x+c x^2} \, dx\)

\(\Big \downarrow \) 4976

\(\displaystyle \int \left (\frac {3}{8} e^{-i d-i f x^2} f^{a+b x+c x^2}+\frac {3}{8} e^{i d+i f x^2} f^{a+b x+c x^2}+\frac {1}{8} e^{-3 i d-3 i f x^2} f^{a+b x+c x^2}+\frac {1}{8} e^{3 i d+3 i f x^2} f^{a+b x+c x^2}\right )dx\)

\(\Big \downarrow \) 2009

\(\displaystyle -\frac {3 \sqrt {\pi } f^a e^{\frac {b^2 \log ^2(f)}{-4 c \log (f)+4 i f}-i d} \text {erf}\left (\frac {b \log (f)-2 x (-c \log (f)+i f)}{2 \sqrt {-c \log (f)+i f}}\right )}{16 \sqrt {-c \log (f)+i f}}-\frac {\sqrt {\pi } f^a e^{\frac {b^2 \log ^2(f)}{-4 c \log (f)+12 i f}-3 i d} \text {erf}\left (\frac {b \log (f)-2 x (-c \log (f)+3 i f)}{2 \sqrt {-c \log (f)+3 i f}}\right )}{16 \sqrt {-c \log (f)+3 i f}}+\frac {\sqrt {\pi } f^a \exp \left (3 i d-\frac {b^2 \log ^2(f)}{4 (c \log (f)+3 i f)}\right ) \text {erfi}\left (\frac {b \log (f)+2 x (c \log (f)+3 i f)}{2 \sqrt {c \log (f)+3 i f}}\right )}{16 \sqrt {c \log (f)+3 i f}}+\frac {3 \sqrt {\pi } f^a e^{i d-\frac {b^2 \log ^2(f)}{4 c \log (f)+4 i f}} \text {erfi}\left (\frac {b \log (f)+2 x (c \log (f)+i f)}{2 \sqrt {c \log (f)+i f}}\right )}{16 \sqrt {c \log (f)+i f}}\)

Input:

Int[f^(a + b*x + c*x^2)*Cos[d + f*x^2]^3,x]
 

Output:

(-3*E^((-I)*d + (b^2*Log[f]^2)/((4*I)*f - 4*c*Log[f]))*f^a*Sqrt[Pi]*Erf[(b 
*Log[f] - 2*x*(I*f - c*Log[f]))/(2*Sqrt[I*f - c*Log[f]])])/(16*Sqrt[I*f - 
c*Log[f]]) - (E^((-3*I)*d + (b^2*Log[f]^2)/((12*I)*f - 4*c*Log[f]))*f^a*Sq 
rt[Pi]*Erf[(b*Log[f] - 2*x*((3*I)*f - c*Log[f]))/(2*Sqrt[(3*I)*f - c*Log[f 
]])])/(16*Sqrt[(3*I)*f - c*Log[f]]) + (3*E^(I*d - (b^2*Log[f]^2)/((4*I)*f 
+ 4*c*Log[f]))*f^a*Sqrt[Pi]*Erfi[(b*Log[f] + 2*x*(I*f + c*Log[f]))/(2*Sqrt 
[I*f + c*Log[f]])])/(16*Sqrt[I*f + c*Log[f]]) + (E^((3*I)*d - (b^2*Log[f]^ 
2)/(4*((3*I)*f + c*Log[f])))*f^a*Sqrt[Pi]*Erfi[(b*Log[f] + 2*x*((3*I)*f + 
c*Log[f]))/(2*Sqrt[(3*I)*f + c*Log[f]])])/(16*Sqrt[(3*I)*f + c*Log[f]])
 

Defintions of rubi rules used

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

rule 4976
Int[Cos[v_]^(n_.)*(F_)^(u_), x_Symbol] :> Int[ExpandTrigToExp[F^u, Cos[v]^n 
, x], x] /; FreeQ[F, x] && (LinearQ[u, x] || PolyQ[u, x, 2]) && (LinearQ[v, 
 x] || PolyQ[v, x, 2]) && IGtQ[n, 0]
 
Maple [A] (verified)

Time = 2.81 (sec) , antiderivative size = 354, normalized size of antiderivative = 0.94

method result size
risch \(-\frac {\sqrt {\pi }\, f^{a} {\mathrm e}^{-\frac {\ln \left (f \right )^{2} b^{2}+12 i d \ln \left (f \right ) c +36 d f}{4 \left (c \ln \left (f \right )-3 i f \right )}} \operatorname {erf}\left (-x \sqrt {3 i f -c \ln \left (f \right )}+\frac {\ln \left (f \right ) b}{2 \sqrt {3 i f -c \ln \left (f \right )}}\right )}{16 \sqrt {3 i f -c \ln \left (f \right )}}-\frac {3 \sqrt {\pi }\, f^{a} {\mathrm e}^{-\frac {\ln \left (f \right )^{2} b^{2}+4 i d \ln \left (f \right ) c +4 d f}{4 \left (-i f +c \ln \left (f \right )\right )}} \operatorname {erf}\left (-x \sqrt {i f -c \ln \left (f \right )}+\frac {\ln \left (f \right ) b}{2 \sqrt {i f -c \ln \left (f \right )}}\right )}{16 \sqrt {i f -c \ln \left (f \right )}}-\frac {3 \sqrt {\pi }\, f^{a} {\mathrm e}^{-\frac {\ln \left (f \right )^{2} b^{2}-4 i d \ln \left (f \right ) c +4 d f}{4 \left (i f +c \ln \left (f \right )\right )}} \operatorname {erf}\left (-\sqrt {-c \ln \left (f \right )-i f}\, x +\frac {\ln \left (f \right ) b}{2 \sqrt {-c \ln \left (f \right )-i f}}\right )}{16 \sqrt {-c \ln \left (f \right )-i f}}-\frac {\sqrt {\pi }\, f^{a} {\mathrm e}^{-\frac {\ln \left (f \right )^{2} b^{2}-12 i d \ln \left (f \right ) c +36 d f}{4 \left (3 i f +c \ln \left (f \right )\right )}} \operatorname {erf}\left (-\sqrt {-c \ln \left (f \right )-3 i f}\, x +\frac {\ln \left (f \right ) b}{2 \sqrt {-c \ln \left (f \right )-3 i f}}\right )}{16 \sqrt {-c \ln \left (f \right )-3 i f}}\) \(354\)

Input:

int(f^(c*x^2+b*x+a)*cos(f*x^2+d)^3,x,method=_RETURNVERBOSE)
 

Output:

-1/16*Pi^(1/2)*f^a*exp(-1/4*(ln(f)^2*b^2+12*I*d*ln(f)*c+36*d*f)/(c*ln(f)-3 
*I*f))/(3*I*f-c*ln(f))^(1/2)*erf(-x*(3*I*f-c*ln(f))^(1/2)+1/2*ln(f)*b/(3*I 
*f-c*ln(f))^(1/2))-3/16*Pi^(1/2)*f^a*exp(-1/4*(ln(f)^2*b^2+4*I*d*ln(f)*c+4 
*d*f)/(-I*f+c*ln(f)))/(I*f-c*ln(f))^(1/2)*erf(-x*(I*f-c*ln(f))^(1/2)+1/2*l 
n(f)*b/(I*f-c*ln(f))^(1/2))-3/16*Pi^(1/2)*f^a*exp(-1/4*(ln(f)^2*b^2-4*I*d* 
ln(f)*c+4*d*f)/(I*f+c*ln(f)))/(-c*ln(f)-I*f)^(1/2)*erf(-(-c*ln(f)-I*f)^(1/ 
2)*x+1/2*ln(f)*b/(-c*ln(f)-I*f)^(1/2))-1/16*Pi^(1/2)*f^a*exp(-1/4*(ln(f)^2 
*b^2-12*I*d*ln(f)*c+36*d*f)/(3*I*f+c*ln(f)))/(-c*ln(f)-3*I*f)^(1/2)*erf(-( 
-c*ln(f)-3*I*f)^(1/2)*x+1/2*ln(f)*b/(-c*ln(f)-3*I*f)^(1/2))
 

Fricas [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 725 vs. \(2 (289) = 578\).

Time = 0.11 (sec) , antiderivative size = 725, normalized size of antiderivative = 1.92 \[ \int f^{a+b x+c x^2} \cos ^3\left (d+f x^2\right ) \, dx =\text {Too large to display} \] Input:

integrate(f^(c*x^2+b*x+a)*cos(f*x^2+d)^3,x, algorithm="fricas")
 

Output:

-1/16*(sqrt(pi)*(c^3*log(f)^3 - 3*I*c^2*f*log(f)^2 + c*f^2*log(f) - 3*I*f^ 
3)*sqrt(-c*log(f) - 3*I*f)*erf(1/2*(18*f^2*x - 3*I*b*f*log(f) + (2*c^2*x + 
 b*c)*log(f)^2)*sqrt(-c*log(f) - 3*I*f)/(c^2*log(f)^2 + 9*f^2))*e^(1/4*(36 
*a*f^2*log(f) - (b^2*c - 4*a*c^2)*log(f)^3 + 108*I*d*f^2 - 3*(-4*I*c^2*d - 
 I*b^2*f)*log(f)^2)/(c^2*log(f)^2 + 9*f^2)) + sqrt(pi)*(c^3*log(f)^3 + 3*I 
*c^2*f*log(f)^2 + c*f^2*log(f) + 3*I*f^3)*sqrt(-c*log(f) + 3*I*f)*erf(1/2* 
(18*f^2*x + 3*I*b*f*log(f) + (2*c^2*x + b*c)*log(f)^2)*sqrt(-c*log(f) + 3* 
I*f)/(c^2*log(f)^2 + 9*f^2))*e^(1/4*(36*a*f^2*log(f) - (b^2*c - 4*a*c^2)*l 
og(f)^3 - 108*I*d*f^2 - 3*(4*I*c^2*d + I*b^2*f)*log(f)^2)/(c^2*log(f)^2 + 
9*f^2)) + 3*sqrt(pi)*(c^3*log(f)^3 - I*c^2*f*log(f)^2 + 9*c*f^2*log(f) - 9 
*I*f^3)*sqrt(-c*log(f) - I*f)*erf(1/2*(2*f^2*x - I*b*f*log(f) + (2*c^2*x + 
 b*c)*log(f)^2)*sqrt(-c*log(f) - I*f)/(c^2*log(f)^2 + f^2))*e^(1/4*(4*a*f^ 
2*log(f) - (b^2*c - 4*a*c^2)*log(f)^3 + 4*I*d*f^2 + (4*I*c^2*d + I*b^2*f)* 
log(f)^2)/(c^2*log(f)^2 + f^2)) + 3*sqrt(pi)*(c^3*log(f)^3 + I*c^2*f*log(f 
)^2 + 9*c*f^2*log(f) + 9*I*f^3)*sqrt(-c*log(f) + I*f)*erf(1/2*(2*f^2*x + I 
*b*f*log(f) + (2*c^2*x + b*c)*log(f)^2)*sqrt(-c*log(f) + I*f)/(c^2*log(f)^ 
2 + f^2))*e^(1/4*(4*a*f^2*log(f) - (b^2*c - 4*a*c^2)*log(f)^3 - 4*I*d*f^2 
+ (-4*I*c^2*d - I*b^2*f)*log(f)^2)/(c^2*log(f)^2 + f^2)))/(c^4*log(f)^4 + 
10*c^2*f^2*log(f)^2 + 9*f^4)
 

Sympy [F]

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

integrate(f**(c*x**2+b*x+a)*cos(f*x**2+d)**3,x)
                                                                                    
                                                                                    
 

Output:

Integral(f**(a + b*x + c*x**2)*cos(d + f*x**2)**3, x)
 

Maxima [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 2456 vs. \(2 (289) = 578\).

Time = 0.08 (sec) , antiderivative size = 2456, normalized size of antiderivative = 6.50 \[ \int f^{a+b x+c x^2} \cos ^3\left (d+f x^2\right ) \, dx=\text {Too large to display} \] Input:

integrate(f^(c*x^2+b*x+a)*cos(f*x^2+d)^3,x, algorithm="maxima")
 

Output:

1/32*(sqrt(pi)*sqrt(2*c^2*log(f)^2 + 18*f^2)*(((I*c^2*f^a*e^(1/4*b^2*c*log 
(f)^3/(c^2*log(f)^2 + f^2))*log(f)^2 + I*f^(a + 2)*e^(1/4*b^2*c*log(f)^3/( 
c^2*log(f)^2 + f^2)))*cos(3/4*(36*d*f^2 + (4*c^2*d + b^2*f)*log(f)^2)/(c^2 
*log(f)^2 + 9*f^2)) + (c^2*f^a*e^(1/4*b^2*c*log(f)^3/(c^2*log(f)^2 + f^2)) 
*log(f)^2 + f^(a + 2)*e^(1/4*b^2*c*log(f)^3/(c^2*log(f)^2 + f^2)))*sin(3/4 
*(36*d*f^2 + (4*c^2*d + b^2*f)*log(f)^2)/(c^2*log(f)^2 + 9*f^2)))*erf(1/2* 
(2*(c*log(f) - 3*I*f)*x + b*log(f))/sqrt(-c*log(f) + 3*I*f)) + ((-I*c^2*f^ 
a*e^(1/4*b^2*c*log(f)^3/(c^2*log(f)^2 + f^2))*log(f)^2 - I*f^(a + 2)*e^(1/ 
4*b^2*c*log(f)^3/(c^2*log(f)^2 + f^2)))*cos(3/4*(36*d*f^2 + (4*c^2*d + b^2 
*f)*log(f)^2)/(c^2*log(f)^2 + 9*f^2)) + (c^2*f^a*e^(1/4*b^2*c*log(f)^3/(c^ 
2*log(f)^2 + f^2))*log(f)^2 + f^(a + 2)*e^(1/4*b^2*c*log(f)^3/(c^2*log(f)^ 
2 + f^2)))*sin(3/4*(36*d*f^2 + (4*c^2*d + b^2*f)*log(f)^2)/(c^2*log(f)^2 + 
 9*f^2)))*erf(1/2*(2*(c*log(f) + 3*I*f)*x + b*log(f))/sqrt(-c*log(f) - 3*I 
*f)))*sqrt(c*log(f) + sqrt(c^2*log(f)^2 + 9*f^2)) - 3*sqrt(pi)*sqrt(2*c^2* 
log(f)^2 + 2*f^2)*(((-I*c^2*f^a*e^(1/4*b^2*c*log(f)^3/(c^2*log(f)^2 + 9*f^ 
2))*log(f)^2 - 9*I*f^(a + 2)*e^(1/4*b^2*c*log(f)^3/(c^2*log(f)^2 + 9*f^2)) 
)*cos(1/4*(4*d*f^2 + (4*c^2*d + b^2*f)*log(f)^2)/(c^2*log(f)^2 + f^2)) - ( 
c^2*f^a*e^(1/4*b^2*c*log(f)^3/(c^2*log(f)^2 + 9*f^2))*log(f)^2 + 9*f^(a + 
2)*e^(1/4*b^2*c*log(f)^3/(c^2*log(f)^2 + 9*f^2)))*sin(1/4*(4*d*f^2 + (4*c^ 
2*d + b^2*f)*log(f)^2)/(c^2*log(f)^2 + f^2)))*erf(1/2*(2*(c*log(f) - I*...
 

Giac [F]

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

integrate(f^(c*x^2+b*x+a)*cos(f*x^2+d)^3,x, algorithm="giac")
 

Output:

integrate(f^(c*x^2 + b*x + a)*cos(f*x^2 + d)^3, x)
 

Mupad [F(-1)]

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

int(f^(a + b*x + c*x^2)*cos(d + f*x^2)^3,x)
 

Output:

int(f^(a + b*x + c*x^2)*cos(d + f*x^2)^3, x)
 

Reduce [F]

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

int(f^(c*x^2+b*x+a)*cos(f*x^2+d)^3,x)
 

Output:

f**a*int(f**(b*x + c*x**2)*cos(d + f*x**2)**3,x)