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

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 [A] (verification not implemented)
Mupad [F(-1)]
Reduce [F]

Optimal result

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

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

Mathematica [A] (verified)

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

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

Output:

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

Rubi [A] (verified)

Time = 0.29 (sec) , antiderivative size = 74, 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} \, dx\)

\(\Big \downarrow \) 3884

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

\(\Big \downarrow \) 6

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

\(\Big \downarrow \) 2009

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

Input:

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

Output:

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

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 = 2.94 (sec) , antiderivative size = 157, normalized size of antiderivative = 2.12

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

Input:

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

Output:

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

Fricas [A] (verification not implemented)

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

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

Output:

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

Sympy [F]

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

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

Output:

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

Maxima [C] (verification not implemented)

Result contains complex when optimal does not.

Time = 0.15 (sec) , antiderivative size = 108, normalized size of antiderivative = 1.46 \[ \int \frac {\left (a+b \sin \left (c+d x^2\right )\right )^2}{x} \, dx=-\frac {1}{2} \, {\left ({\left (i \, {\rm Ei}\left (i \, d x^{2}\right ) - i \, {\rm Ei}\left (-i \, d x^{2}\right )\right )} \cos \left (c\right ) - {\left ({\rm Ei}\left (i \, d x^{2}\right ) + {\rm Ei}\left (-i \, d x^{2}\right )\right )} \sin \left (c\right )\right )} a b - \frac {1}{8} \, {\left ({\left ({\rm Ei}\left (2 i \, d x^{2}\right ) + {\rm Ei}\left (-2 i \, d x^{2}\right )\right )} \cos \left (2 \, c\right ) - {\left (-i \, {\rm Ei}\left (2 i \, d x^{2}\right ) + i \, {\rm Ei}\left (-2 i \, d x^{2}\right )\right )} \sin \left (2 \, c\right ) - 4 \, \log \left (x\right )\right )} b^{2} + a^{2} \log \left (x\right ) \] Input:

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

Output:

-1/2*((I*Ei(I*d*x^2) - I*Ei(-I*d*x^2))*cos(c) - (Ei(I*d*x^2) + Ei(-I*d*x^2 
))*sin(c))*a*b - 1/8*((Ei(2*I*d*x^2) + Ei(-2*I*d*x^2))*cos(2*c) - (-I*Ei(2 
*I*d*x^2) + I*Ei(-2*I*d*x^2))*sin(2*c) - 4*log(x))*b^2 + a^2*log(x)
 

Giac [A] (verification not implemented)

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

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

Output:

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

Mupad [F(-1)]

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

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

Output:

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

Reduce [F]

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

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

Output:

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