\(\int f^{a+b x} \sin ^2(d+e x+f x^2) \, dx\) [95]

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

Optimal result

Integrand size = 21, antiderivative size = 179 \[ \int f^{a+b x} \sin ^2\left (d+e x+f x^2\right ) \, dx=\left (\frac {1}{16}+\frac {i}{16}\right ) e^{2 i d+\frac {i (2 i e+b \log (f))^2}{8 f}} f^{-\frac {1}{2}+a} \sqrt {\pi } \text {erf}\left (\frac {\left (\frac {1}{4}+\frac {i}{4}\right ) (2 i e+4 i f x+b \log (f))}{\sqrt {f}}\right )+\left (\frac {1}{16}+\frac {i}{16}\right ) e^{-2 i d+\frac {i (2 e+i b \log (f))^2}{8 f}} f^{-\frac {1}{2}+a} \sqrt {\pi } \text {erfi}\left (\frac {\left (\frac {1}{4}+\frac {i}{4}\right ) (2 i e+4 i f x-b \log (f))}{\sqrt {f}}\right )+\frac {f^{a+b x}}{2 b \log (f)} \] Output:

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

Mathematica [A] (verified)

Time = 0.78 (sec) , antiderivative size = 244, normalized size of antiderivative = 1.36 \[ \int f^{a+b x} \sin ^2\left (d+e x+f x^2\right ) \, dx=\frac {e^{-\frac {i \left (4 e^2+b^2 \log ^2(f)\right )}{8 f}} f^{a-\frac {b e+f}{2 f}} \left (8 e^{\frac {i \left (4 e^2+b^2 \log ^2(f)\right )}{8 f}} f^{\frac {1}{2}+b \left (\frac {e}{2 f}+x\right )}+\sqrt [4]{-1} b e^{\frac {i b^2 \log ^2(f)}{4 f}} \sqrt {2 \pi } \text {erf}\left (\frac {\left (\frac {1}{4}+\frac {i}{4}\right ) (2 i (e+2 f x)+b \log (f))}{\sqrt {f}}\right ) \log (f) (\cos (2 d)+i \sin (2 d))+\sqrt [4]{-1} b e^{\frac {i e^2}{f}} \sqrt {2 \pi } \text {erf}\left (\frac {\left (\frac {1}{4}+\frac {i}{4}\right ) (2 e+4 f x+i b \log (f))}{\sqrt {f}}\right ) \log (f) (i \cos (2 d)+\sin (2 d))\right )}{16 b \log (f)} \] Input:

Integrate[f^(a + b*x)*Sin[d + e*x + f*x^2]^2,x]
 

Output:

(f^(a - (b*e + f)/(2*f))*(8*E^(((I/8)*(4*e^2 + b^2*Log[f]^2))/f)*f^(1/2 + 
b*(e/(2*f) + x)) + (-1)^(1/4)*b*E^(((I/4)*b^2*Log[f]^2)/f)*Sqrt[2*Pi]*Erf[ 
((1/4 + I/4)*((2*I)*(e + 2*f*x) + b*Log[f]))/Sqrt[f]]*Log[f]*(Cos[2*d] + I 
*Sin[2*d]) + (-1)^(1/4)*b*E^((I*e^2)/f)*Sqrt[2*Pi]*Erf[((1/4 + I/4)*(2*e + 
 4*f*x + I*b*Log[f]))/Sqrt[f]]*Log[f]*(I*Cos[2*d] + Sin[2*d])))/(16*b*E^(( 
(I/8)*(4*e^2 + b^2*Log[f]^2))/f)*Log[f])
 

Rubi [A] (verified)

Time = 0.50 (sec) , antiderivative size = 179, 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.095, Rules used = {4975, 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 f^{a+b x} \sin ^2\left (d+e x+f x^2\right ) \, dx\)

\(\Big \downarrow \) 4975

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

\(\Big \downarrow \) 2009

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

Input:

Int[f^(a + b*x)*Sin[d + e*x + f*x^2]^2,x]
 

Output:

(1/16 + I/16)*E^((2*I)*d + ((I/8)*((2*I)*e + b*Log[f])^2)/f)*f^(-1/2 + a)* 
Sqrt[Pi]*Erf[((1/4 + I/4)*((2*I)*e + (4*I)*f*x + b*Log[f]))/Sqrt[f]] + (1/ 
16 + I/16)*E^((-2*I)*d + ((I/8)*(2*e + I*b*Log[f])^2)/f)*f^(-1/2 + a)*Sqrt 
[Pi]*Erfi[((1/4 + I/4)*((2*I)*e + (4*I)*f*x - b*Log[f]))/Sqrt[f]] + f^(a + 
 b*x)/(2*b*Log[f])
 

Defintions of rubi rules used

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

rule 4975
Int[(F_)^(u_)*Sin[v_]^(n_.), x_Symbol] :> Int[ExpandTrigToExp[F^u, Sin[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 = 1.64 (sec) , antiderivative size = 179, normalized size of antiderivative = 1.00

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

Input:

int(f^(b*x+a)*sin(f*x^2+e*x+d)^2,x,method=_RETURNVERBOSE)
 

Output:

1/16*Pi^(1/2)*f^a*f^(-1/2/f*b*e)*exp(-1/8*I*(ln(f)^2*b^2+16*d*f-4*e^2)/f)* 
2^(1/2)/(I*f)^(1/2)*erf(-2^(1/2)*(I*f)^(1/2)*x+1/4*(b*ln(f)-2*I*e)*2^(1/2) 
/(I*f)^(1/2))+1/8*Pi^(1/2)*f^a*f^(-1/2/f*b*e)*exp(1/8*I*(ln(f)^2*b^2+16*d* 
f-4*e^2)/f)/(-2*I*f)^(1/2)*erf(-(-2*I*f)^(1/2)*x+1/2*(2*I*e+b*ln(f))/(-2*I 
*f)^(1/2))+1/2*f^(b*x+a)/b/ln(f)
 

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. 326 vs. \(2 (116) = 232\).

Time = 0.08 (sec) , antiderivative size = 326, normalized size of antiderivative = 1.82 \[ \int f^{a+b x} \sin ^2\left (d+e x+f x^2\right ) \, dx=-\frac {\pi b \sqrt {\frac {f}{\pi }} e^{\left (\frac {-i \, b^{2} \log \left (f\right )^{2} + 4 i \, e^{2} - 16 i \, d f - 4 \, {\left (b e - 2 \, a f\right )} \log \left (f\right )}{8 \, f}\right )} \operatorname {C}\left (\frac {{\left (4 \, f x + i \, b \log \left (f\right ) + 2 \, e\right )} \sqrt {\frac {f}{\pi }}}{2 \, f}\right ) \log \left (f\right ) - \pi b \sqrt {\frac {f}{\pi }} e^{\left (\frac {i \, b^{2} \log \left (f\right )^{2} - 4 i \, e^{2} + 16 i \, d f - 4 \, {\left (b e - 2 \, a f\right )} \log \left (f\right )}{8 \, f}\right )} \operatorname {C}\left (-\frac {{\left (4 \, f x - i \, b \log \left (f\right ) + 2 \, e\right )} \sqrt {\frac {f}{\pi }}}{2 \, f}\right ) \log \left (f\right ) - i \, \pi b \sqrt {\frac {f}{\pi }} e^{\left (\frac {-i \, b^{2} \log \left (f\right )^{2} + 4 i \, e^{2} - 16 i \, d f - 4 \, {\left (b e - 2 \, a f\right )} \log \left (f\right )}{8 \, f}\right )} \operatorname {S}\left (\frac {{\left (4 \, f x + i \, b \log \left (f\right ) + 2 \, e\right )} \sqrt {\frac {f}{\pi }}}{2 \, f}\right ) \log \left (f\right ) - i \, \pi b \sqrt {\frac {f}{\pi }} e^{\left (\frac {i \, b^{2} \log \left (f\right )^{2} - 4 i \, e^{2} + 16 i \, d f - 4 \, {\left (b e - 2 \, a f\right )} \log \left (f\right )}{8 \, f}\right )} \operatorname {S}\left (-\frac {{\left (4 \, f x - i \, b \log \left (f\right ) + 2 \, e\right )} \sqrt {\frac {f}{\pi }}}{2 \, f}\right ) \log \left (f\right ) - 4 \, f f^{b x + a}}{8 \, b f \log \left (f\right )} \] Input:

integrate(f^(b*x+a)*sin(f*x^2+e*x+d)^2,x, algorithm="fricas")
 

Output:

-1/8*(pi*b*sqrt(f/pi)*e^(1/8*(-I*b^2*log(f)^2 + 4*I*e^2 - 16*I*d*f - 4*(b* 
e - 2*a*f)*log(f))/f)*fresnel_cos(1/2*(4*f*x + I*b*log(f) + 2*e)*sqrt(f/pi 
)/f)*log(f) - pi*b*sqrt(f/pi)*e^(1/8*(I*b^2*log(f)^2 - 4*I*e^2 + 16*I*d*f 
- 4*(b*e - 2*a*f)*log(f))/f)*fresnel_cos(-1/2*(4*f*x - I*b*log(f) + 2*e)*s 
qrt(f/pi)/f)*log(f) - I*pi*b*sqrt(f/pi)*e^(1/8*(-I*b^2*log(f)^2 + 4*I*e^2 
- 16*I*d*f - 4*(b*e - 2*a*f)*log(f))/f)*fresnel_sin(1/2*(4*f*x + I*b*log(f 
) + 2*e)*sqrt(f/pi)/f)*log(f) - I*pi*b*sqrt(f/pi)*e^(1/8*(I*b^2*log(f)^2 - 
 4*I*e^2 + 16*I*d*f - 4*(b*e - 2*a*f)*log(f))/f)*fresnel_sin(-1/2*(4*f*x - 
 I*b*log(f) + 2*e)*sqrt(f/pi)/f)*log(f) - 4*f*f^(b*x + a))/(b*f*log(f))
 

Sympy [F]

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

integrate(f**(b*x+a)*sin(f*x**2+e*x+d)**2,x)
                                                                                    
                                                                                    
 

Output:

Integral(f**(a + b*x)*sin(d + e*x + f*x**2)**2, 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. 240 vs. \(2 (116) = 232\).

Time = 0.14 (sec) , antiderivative size = 240, normalized size of antiderivative = 1.34 \[ \int f^{a+b x} \sin ^2\left (d+e x+f x^2\right ) \, dx=\frac {4^{\frac {1}{4}} \sqrt {2} \sqrt {\pi } {\left ({\left (-\left (i - 1\right ) \, b f^{a} \cos \left (\frac {b^{2} \log \left (f\right )^{2} - 4 \, e^{2} + 16 \, d f}{8 \, f}\right ) \log \left (f\right ) - \left (i + 1\right ) \, b f^{a} \log \left (f\right ) \sin \left (\frac {b^{2} \log \left (f\right )^{2} - 4 \, e^{2} + 16 \, d f}{8 \, f}\right )\right )} \operatorname {erf}\left (\frac {i \, {\left (4 i \, f x - b \log \left (f\right ) + 2 i \, e\right )} \sqrt {2 i \, f}}{4 \, f}\right ) + {\left (\left (i + 1\right ) \, b f^{a} \cos \left (\frac {b^{2} \log \left (f\right )^{2} - 4 \, e^{2} + 16 \, d f}{8 \, f}\right ) \log \left (f\right ) + \left (i - 1\right ) \, b f^{a} \log \left (f\right ) \sin \left (\frac {b^{2} \log \left (f\right )^{2} - 4 \, e^{2} + 16 \, d f}{8 \, f}\right )\right )} \operatorname {erf}\left (\frac {i \, {\left (4 i \, f x + b \log \left (f\right ) + 2 i \, e\right )} \sqrt {-2 i \, f}}{4 \, f}\right )\right )} f^{\frac {3}{2}} + 16 \, f^{a + 2} e^{\left (b x \log \left (f\right ) + \frac {b e \log \left (f\right )}{2 \, f}\right )}}{32 \, b f^{2} f^{\frac {b e}{2 \, f}} \log \left (f\right )} \] Input:

integrate(f^(b*x+a)*sin(f*x^2+e*x+d)^2,x, algorithm="maxima")
 

Output:

1/32*(4^(1/4)*sqrt(2)*sqrt(pi)*((-(I - 1)*b*f^a*cos(1/8*(b^2*log(f)^2 - 4* 
e^2 + 16*d*f)/f)*log(f) - (I + 1)*b*f^a*log(f)*sin(1/8*(b^2*log(f)^2 - 4*e 
^2 + 16*d*f)/f))*erf(1/4*I*(4*I*f*x - b*log(f) + 2*I*e)*sqrt(2*I*f)/f) + ( 
(I + 1)*b*f^a*cos(1/8*(b^2*log(f)^2 - 4*e^2 + 16*d*f)/f)*log(f) + (I - 1)* 
b*f^a*log(f)*sin(1/8*(b^2*log(f)^2 - 4*e^2 + 16*d*f)/f))*erf(1/4*I*(4*I*f* 
x + b*log(f) + 2*I*e)*sqrt(-2*I*f)/f))*f^(3/2) + 16*f^(a + 2)*e^(b*x*log(f 
) + 1/2*b*e*log(f)/f))/(b*f^2*f^(1/2*b*e/f)*log(f))
 

Giac [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 599 vs. \(2 (116) = 232\).

Time = 0.22 (sec) , antiderivative size = 599, normalized size of antiderivative = 3.35 \[ \int f^{a+b x} \sin ^2\left (d+e x+f x^2\right ) \, dx=\text {Too large to display} \] Input:

integrate(f^(b*x+a)*sin(f*x^2+e*x+d)^2,x, algorithm="giac")
 

Output:

(2*b*cos(-1/2*pi*b*x*sgn(f) + 1/2*pi*b*x - 1/2*pi*a*sgn(f) + 1/2*pi*a)*log 
(abs(f))/(4*b^2*log(abs(f))^2 + (pi*b*sgn(f) - pi*b)^2) - (pi*b*sgn(f) - p 
i*b)*sin(-1/2*pi*b*x*sgn(f) + 1/2*pi*b*x - 1/2*pi*a*sgn(f) + 1/2*pi*a)/(4* 
b^2*log(abs(f))^2 + (pi*b*sgn(f) - pi*b)^2))*e^(b*x*log(abs(f)) + a*log(ab 
s(f))) + I*(I*e^(1/2*I*pi*b*x*sgn(f) - 1/2*I*pi*b*x + 1/2*I*pi*a*sgn(f) - 
1/2*I*pi*a)/(2*I*pi*b*sgn(f) - 2*I*pi*b + 4*b*log(abs(f))) - I*e^(-1/2*I*p 
i*b*x*sgn(f) + 1/2*I*pi*b*x - 1/2*I*pi*a*sgn(f) + 1/2*I*pi*a)/(-2*I*pi*b*s 
gn(f) + 2*I*pi*b + 4*b*log(abs(f))))*e^(b*x*log(abs(f)) + a*log(abs(f))) + 
 1/8*sqrt(pi)*erf(-1/8*sqrt(f)*(8*x - (pi*b*sgn(f) - pi*b + 2*I*b*log(abs( 
f)) - 4*e)/f)*(-I*f/abs(f) + 1))*e^(1/16*I*pi^2*b^2*sgn(f)/f + 1/8*pi*b^2* 
log(abs(f))*sgn(f)/f - 1/16*I*pi^2*b^2/f - 1/8*pi*b^2*log(abs(f))/f + 1/8* 
I*b^2*log(abs(f))^2/f - 1/2*I*pi*a*sgn(f) + 1/4*I*pi*b*e*sgn(f)/f + 1/2*I* 
pi*a - 1/4*I*pi*b*e/f + a*log(abs(f)) - 1/2*b*e*log(abs(f))/f + 2*I*d - 1/ 
2*I*e^2/f)/(sqrt(f)*(-I*f/abs(f) + 1)) + 1/8*sqrt(pi)*erf(-1/8*sqrt(f)*(8* 
x + (pi*b*sgn(f) - pi*b + 2*I*b*log(abs(f)) + 4*e)/f)*(I*f/abs(f) + 1))*e^ 
(-1/16*I*pi^2*b^2*sgn(f)/f - 1/8*pi*b^2*log(abs(f))*sgn(f)/f + 1/16*I*pi^2 
*b^2/f + 1/8*pi*b^2*log(abs(f))/f - 1/8*I*b^2*log(abs(f))^2/f - 1/2*I*pi*a 
*sgn(f) + 1/4*I*pi*b*e*sgn(f)/f + 1/2*I*pi*a - 1/4*I*pi*b*e/f + a*log(abs( 
f)) - 1/2*b*e*log(abs(f))/f - 2*I*d + 1/2*I*e^2/f)/(sqrt(f)*(I*f/abs(f) + 
1))
 

Mupad [F(-1)]

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

int(f^(a + b*x)*sin(d + e*x + f*x^2)^2,x)
 

Output:

int(f^(a + b*x)*sin(d + e*x + f*x^2)^2, x)
 

Reduce [F]

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

int(f^(b*x+a)*sin(f*x^2+e*x+d)^2,x)
 

Output:

f**a*int(f**(b*x)*sin(d + e*x + f*x**2)**2,x)