\(\int \frac {(a+b \sin (c+d x^2))^2}{x^3} \, dx\) [16]

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

Optimal result

Integrand size = 18, antiderivative size = 115 \[ \int \frac {\left (a+b \sin \left (c+d x^2\right )\right )^2}{x^3} \, dx=-\frac {2 a^2+b^2}{4 x^2}+\frac {b^2 \cos \left (2 \left (c+d x^2\right )\right )}{4 x^2}+a b d \cos (c) \operatorname {CosIntegral}\left (d x^2\right )+\frac {1}{2} b^2 d \operatorname {CosIntegral}\left (2 d x^2\right ) \sin (2 c)-\frac {a b \sin \left (c+d x^2\right )}{x^2}-a b d \sin (c) \text {Si}\left (d x^2\right )+\frac {1}{2} b^2 d \cos (2 c) \text {Si}\left (2 d x^2\right ) \] Output:

-1/4*(2*a^2+b^2)/x^2+1/4*b^2*cos(2*d*x^2+2*c)/x^2+a*b*d*cos(c)*Ci(d*x^2)+1 
/2*b^2*d*Ci(2*d*x^2)*sin(2*c)-a*b*sin(d*x^2+c)/x^2-a*b*d*sin(c)*Si(d*x^2)+ 
1/2*b^2*d*cos(2*c)*Si(2*d*x^2)
 

Mathematica [A] (verified)

Time = 0.28 (sec) , antiderivative size = 116, normalized size of antiderivative = 1.01 \[ \int \frac {\left (a+b \sin \left (c+d x^2\right )\right )^2}{x^3} \, dx=\frac {-2 a^2-b^2+b^2 \cos \left (2 \left (c+d x^2\right )\right )+4 a b d x^2 \cos (c) \operatorname {CosIntegral}\left (d x^2\right )+2 b^2 d x^2 \operatorname {CosIntegral}\left (2 d x^2\right ) \sin (2 c)-4 a b \sin \left (c+d x^2\right )-4 a b d x^2 \sin (c) \text {Si}\left (d x^2\right )+2 b^2 d x^2 \cos (2 c) \text {Si}\left (2 d x^2\right )}{4 x^2} \] Input:

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

Output:

(-2*a^2 - b^2 + b^2*Cos[2*(c + d*x^2)] + 4*a*b*d*x^2*Cos[c]*CosIntegral[d* 
x^2] + 2*b^2*d*x^2*CosIntegral[2*d*x^2]*Sin[2*c] - 4*a*b*Sin[c + d*x^2] - 
4*a*b*d*x^2*Sin[c]*SinIntegral[d*x^2] + 2*b^2*d*x^2*Cos[2*c]*SinIntegral[2 
*d*x^2])/(4*x^2)
 

Rubi [A] (verified)

Time = 0.43 (sec) , antiderivative size = 115, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {3884, 6, 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 \frac {\left (a+b \sin \left (c+d x^2\right )\right )^2}{x^3} \, dx\)

\(\Big \downarrow \) 3884

\(\displaystyle \int \left (\frac {a^2}{x^3}+\frac {2 a b \sin \left (c+d x^2\right )}{x^3}-\frac {b^2 \cos \left (2 c+2 d x^2\right )}{2 x^3}+\frac {b^2}{2 x^3}\right )dx\)

\(\Big \downarrow \) 6

\(\displaystyle \int \left (\frac {a^2+\frac {b^2}{2}}{x^3}+\frac {2 a b \sin \left (c+d x^2\right )}{x^3}-\frac {b^2 \cos \left (2 c+2 d x^2\right )}{2 x^3}\right )dx\)

\(\Big \downarrow \) 2009

\(\displaystyle -\frac {2 a^2+b^2}{4 x^2}+a b d \cos (c) \operatorname {CosIntegral}\left (d x^2\right )-a b d \sin (c) \text {Si}\left (d x^2\right )-\frac {a b \sin \left (c+d x^2\right )}{x^2}+\frac {1}{2} b^2 d \sin (2 c) \operatorname {CosIntegral}\left (2 d x^2\right )+\frac {1}{2} b^2 d \cos (2 c) \text {Si}\left (2 d x^2\right )+\frac {b^2 \cos \left (2 \left (c+d x^2\right )\right )}{4 x^2}\)

Input:

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

Output:

-1/4*(2*a^2 + b^2)/x^2 + (b^2*Cos[2*(c + d*x^2)])/(4*x^2) + a*b*d*Cos[c]*C 
osIntegral[d*x^2] + (b^2*d*CosIntegral[2*d*x^2]*Sin[2*c])/2 - (a*b*Sin[c + 
 d*x^2])/x^2 - a*b*d*Sin[c]*SinIntegral[d*x^2] + (b^2*d*Cos[2*c]*SinIntegr 
al[2*d*x^2])/2
 

Defintions of rubi rules used

rule 6
Int[(u_.)*((v_.) + (a_.)*(Fx_) + (b_.)*(Fx_))^(p_.), x_Symbol] :> Int[u*(v 
+ (a + b)*Fx)^p, x] /; FreeQ[{a, b}, x] &&  !FreeQ[Fx, x]
 

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

rule 3884
Int[((e_.)*(x_))^(m_.)*((a_.) + (b_.)*Sin[(c_.) + (d_.)*(x_)^(n_)])^(p_), x 
_Symbol] :> Int[ExpandTrigReduce[(e*x)^m, (a + b*Sin[c + d*x^n])^p, x], x] 
/; FreeQ[{a, b, c, d, e, m}, x] && IGtQ[p, 1] && IGtQ[n, 0]
 
Maple [C] (warning: unable to verify)

Result contains higher order function than in optimal. Order 9 vs. order 4.

Time = 3.01 (sec) , antiderivative size = 217, normalized size of antiderivative = 1.89

method result size
risch \(-\frac {-2 i {\mathrm e}^{-i c} \pi \,\operatorname {csgn}\left (d \,x^{2}\right ) a b d \,x^{2}+{\mathrm e}^{-2 i c} \pi \,\operatorname {csgn}\left (d \,x^{2}\right ) b^{2} d \,x^{2}+4 i {\mathrm e}^{-i c} \operatorname {Si}\left (d \,x^{2}\right ) a b d \,x^{2}+i \operatorname {expIntegral}_{1}\left (-2 i d \,x^{2}\right ) {\mathrm e}^{-2 i c} b^{2} d \,x^{2}-i b^{2} d \,\operatorname {expIntegral}_{1}\left (-2 i d \,x^{2}\right ) {\mathrm e}^{2 i c} x^{2}-2 \,{\mathrm e}^{-2 i c} \operatorname {Si}\left (2 d \,x^{2}\right ) b^{2} d \,x^{2}+2 a b d \,\operatorname {expIntegral}_{1}\left (-i d \,x^{2}\right ) {\mathrm e}^{i c} x^{2}+2 \,\operatorname {expIntegral}_{1}\left (-i d \,x^{2}\right ) {\mathrm e}^{-i c} a b d \,x^{2}+4 \sin \left (d \,x^{2}+c \right ) a b -b^{2} \cos \left (2 d \,x^{2}+2 c \right )+2 a^{2}+b^{2}}{4 x^{2}}\) \(217\)

Input:

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

Output:

-1/4*(-2*I*exp(-I*c)*Pi*csgn(d*x^2)*a*b*d*x^2+exp(-2*I*c)*Pi*csgn(d*x^2)*b 
^2*d*x^2+4*I*exp(-I*c)*Si(d*x^2)*a*b*d*x^2+I*Ei(1,-2*I*d*x^2)*exp(-2*I*c)* 
b^2*d*x^2-I*b^2*d*Ei(1,-2*I*d*x^2)*exp(2*I*c)*x^2-2*exp(-2*I*c)*Si(2*d*x^2 
)*b^2*d*x^2+2*a*b*d*Ei(1,-I*d*x^2)*exp(I*c)*x^2+2*Ei(1,-I*d*x^2)*exp(-I*c) 
*a*b*d*x^2+4*sin(d*x^2+c)*a*b-b^2*cos(2*d*x^2+2*c)+2*a^2+b^2)/x^2
 

Fricas [A] (verification not implemented)

Time = 0.08 (sec) , antiderivative size = 112, normalized size of antiderivative = 0.97 \[ \int \frac {\left (a+b \sin \left (c+d x^2\right )\right )^2}{x^3} \, dx=\frac {2 \, a b d x^{2} \cos \left (c\right ) \operatorname {Ci}\left (d x^{2}\right ) + b^{2} d x^{2} \operatorname {Ci}\left (2 \, d x^{2}\right ) \sin \left (2 \, c\right ) + b^{2} d x^{2} \cos \left (2 \, c\right ) \operatorname {Si}\left (2 \, d x^{2}\right ) - 2 \, a b d x^{2} \sin \left (c\right ) \operatorname {Si}\left (d x^{2}\right ) + b^{2} \cos \left (d x^{2} + c\right )^{2} - 2 \, a b \sin \left (d x^{2} + c\right ) - a^{2} - b^{2}}{2 \, x^{2}} \] Input:

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

Output:

1/2*(2*a*b*d*x^2*cos(c)*cos_integral(d*x^2) + b^2*d*x^2*cos_integral(2*d*x 
^2)*sin(2*c) + b^2*d*x^2*cos(2*c)*sin_integral(2*d*x^2) - 2*a*b*d*x^2*sin( 
c)*sin_integral(d*x^2) + b^2*cos(d*x^2 + c)^2 - 2*a*b*sin(d*x^2 + c) - a^2 
 - b^2)/x^2
 

Sympy [F]

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

integrate((a+b*sin(d*x**2+c))**2/x**3,x)
 

Output:

Integral((a + b*sin(c + d*x**2))**2/x**3, x)
 

Maxima [C] (verification not implemented)

Result contains complex when optimal does not.

Time = 0.15 (sec) , antiderivative size = 124, normalized size of antiderivative = 1.08 \[ \int \frac {\left (a+b \sin \left (c+d x^2\right )\right )^2}{x^3} \, dx=\frac {1}{2} \, {\left ({\left (\Gamma \left (-1, i \, d x^{2}\right ) + \Gamma \left (-1, -i \, d x^{2}\right )\right )} \cos \left (c\right ) - {\left (i \, \Gamma \left (-1, i \, d x^{2}\right ) - i \, \Gamma \left (-1, -i \, d x^{2}\right )\right )} \sin \left (c\right )\right )} a b d + \frac {{\left ({\left ({\left (i \, \Gamma \left (-1, 2 i \, d x^{2}\right ) - i \, \Gamma \left (-1, -2 i \, d x^{2}\right )\right )} \cos \left (2 \, c\right ) + {\left (\Gamma \left (-1, 2 i \, d x^{2}\right ) + \Gamma \left (-1, -2 i \, d x^{2}\right )\right )} \sin \left (2 \, c\right )\right )} d x^{2} - 1\right )} b^{2}}{4 \, x^{2}} - \frac {a^{2}}{2 \, x^{2}} \] Input:

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

Output:

1/2*((gamma(-1, I*d*x^2) + gamma(-1, -I*d*x^2))*cos(c) - (I*gamma(-1, I*d* 
x^2) - I*gamma(-1, -I*d*x^2))*sin(c))*a*b*d + 1/4*(((I*gamma(-1, 2*I*d*x^2 
) - I*gamma(-1, -2*I*d*x^2))*cos(2*c) + (gamma(-1, 2*I*d*x^2) + gamma(-1, 
-2*I*d*x^2))*sin(2*c))*d*x^2 - 1)*b^2/x^2 - 1/2*a^2/x^2
 

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 226 vs. \(2 (108) = 216\).

Time = 0.12 (sec) , antiderivative size = 226, normalized size of antiderivative = 1.97 \[ \int \frac {\left (a+b \sin \left (c+d x^2\right )\right )^2}{x^3} \, dx=\frac {4 \, {\left (d x^{2} + c\right )} a b d^{2} \cos \left (c\right ) \operatorname {Ci}\left (d x^{2}\right ) - 4 \, a b c d^{2} \cos \left (c\right ) \operatorname {Ci}\left (d x^{2}\right ) + 2 \, {\left (d x^{2} + c\right )} b^{2} d^{2} \operatorname {Ci}\left (2 \, d x^{2}\right ) \sin \left (2 \, c\right ) - 2 \, b^{2} c d^{2} \operatorname {Ci}\left (2 \, d x^{2}\right ) \sin \left (2 \, c\right ) - 4 \, {\left (d x^{2} + c\right )} a b d^{2} \sin \left (c\right ) \operatorname {Si}\left (d x^{2}\right ) + 4 \, a b c d^{2} \sin \left (c\right ) \operatorname {Si}\left (d x^{2}\right ) - 2 \, {\left (d x^{2} + c\right )} b^{2} d^{2} \cos \left (2 \, c\right ) \operatorname {Si}\left (-2 \, d x^{2}\right ) + 2 \, b^{2} c d^{2} \cos \left (2 \, c\right ) \operatorname {Si}\left (-2 \, d x^{2}\right ) + b^{2} d^{2} \cos \left (2 \, d x^{2} + 2 \, c\right ) - 4 \, a b d^{2} \sin \left (d x^{2} + c\right ) - 2 \, a^{2} d^{2} - b^{2} d^{2}}{4 \, d^{2} x^{2}} \] Input:

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

Output:

1/4*(4*(d*x^2 + c)*a*b*d^2*cos(c)*cos_integral(d*x^2) - 4*a*b*c*d^2*cos(c) 
*cos_integral(d*x^2) + 2*(d*x^2 + c)*b^2*d^2*cos_integral(2*d*x^2)*sin(2*c 
) - 2*b^2*c*d^2*cos_integral(2*d*x^2)*sin(2*c) - 4*(d*x^2 + c)*a*b*d^2*sin 
(c)*sin_integral(d*x^2) + 4*a*b*c*d^2*sin(c)*sin_integral(d*x^2) - 2*(d*x^ 
2 + c)*b^2*d^2*cos(2*c)*sin_integral(-2*d*x^2) + 2*b^2*c*d^2*cos(2*c)*sin_ 
integral(-2*d*x^2) + b^2*d^2*cos(2*d*x^2 + 2*c) - 4*a*b*d^2*sin(d*x^2 + c) 
 - 2*a^2*d^2 - b^2*d^2)/(d^2*x^2)
 

Mupad [F(-1)]

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

int((a + b*sin(c + d*x^2))^2/x^3,x)
 

Output:

int((a + b*sin(c + d*x^2))^2/x^3, x)
 

Reduce [F]

\[ \int \frac {\left (a+b \sin \left (c+d x^2\right )\right )^2}{x^3} \, dx =\text {Too large to display} \] Input:

int((a+b*sin(d*x^2+c))^2/x^3,x)
 

Output:

( - 2*cos(c + d*x**2)*sin(c + d*x**2)*tan((c + d*x**2)/2)**4*a*b - 4*cos(c 
 + d*x**2)*sin(c + d*x**2)*tan((c + d*x**2)/2)**2*a*b - 2*cos(c + d*x**2)* 
sin(c + d*x**2)*a*b + 24*int(tan((c + d*x**2)/2)**2/(tan((c + d*x**2)/2)** 
4*x**3 + 2*tan((c + d*x**2)/2)**2*x**3 + x**3),x)*tan((c + d*x**2)/2)**4*b 
**2*x**2 + 48*int(tan((c + d*x**2)/2)**2/(tan((c + d*x**2)/2)**4*x**3 + 2* 
tan((c + d*x**2)/2)**2*x**3 + x**3),x)*tan((c + d*x**2)/2)**2*b**2*x**2 + 
24*int(tan((c + d*x**2)/2)**2/(tan((c + d*x**2)/2)**4*x**3 + 2*tan((c + d* 
x**2)/2)**2*x**3 + x**3),x)*b**2*x**2 + 24*int(tan((c + d*x**2)/2)**2/(tan 
((c + d*x**2)/2)**4*x + 2*tan((c + d*x**2)/2)**2*x + x),x)*tan((c + d*x**2 
)/2)**4*a*b*d*x**2 + 48*int(tan((c + d*x**2)/2)**2/(tan((c + d*x**2)/2)**4 
*x + 2*tan((c + d*x**2)/2)**2*x + x),x)*tan((c + d*x**2)/2)**2*a*b*d*x**2 
+ 24*int(tan((c + d*x**2)/2)**2/(tan((c + d*x**2)/2)**4*x + 2*tan((c + d*x 
**2)/2)**2*x + x),x)*a*b*d*x**2 + 24*int(1/(tan((c + d*x**2)/2)**4*x + 2*t 
an((c + d*x**2)/2)**2*x + x),x)*tan((c + d*x**2)/2)**4*a*b*d*x**2 + 48*int 
(1/(tan((c + d*x**2)/2)**4*x + 2*tan((c + d*x**2)/2)**2*x + x),x)*tan((c + 
 d*x**2)/2)**2*a*b*d*x**2 + 24*int(1/(tan((c + d*x**2)/2)**4*x + 2*tan((c 
+ d*x**2)/2)**2*x + x),x)*a*b*d*x**2 - 12*log(x)*tan((c + d*x**2)/2)**4*a* 
b*d*x**2 - 24*log(x)*tan((c + d*x**2)/2)**2*a*b*d*x**2 - 12*log(x)*a*b*d*x 
**2 - 8*sin(c + d*x**2)*tan((c + d*x**2)/2)**4*a*b - 16*sin(c + d*x**2)*ta 
n((c + d*x**2)/2)**2*a*b - 8*sin(c + d*x**2)*a*b - 3*tan((c + d*x**2)/2...