3.126 \(\int \frac {(a+a \cos (e+f x))^2}{c+d x} \, dx\)

Optimal. Leaf size=145 \[ \frac {2 a^2 \text {Ci}\left (x f+\frac {c f}{d}\right ) \cos \left (e-\frac {c f}{d}\right )}{d}+\frac {a^2 \text {Ci}\left (2 x f+\frac {2 c f}{d}\right ) \cos \left (2 e-\frac {2 c f}{d}\right )}{2 d}-\frac {2 a^2 \sin \left (e-\frac {c f}{d}\right ) \text {Si}\left (x f+\frac {c f}{d}\right )}{d}-\frac {a^2 \sin \left (2 e-\frac {2 c f}{d}\right ) \text {Si}\left (2 x f+\frac {2 c f}{d}\right )}{2 d}+\frac {3 a^2 \log (c+d x)}{2 d} \]

[Out]

1/2*a^2*Ci(2*c*f/d+2*f*x)*cos(-2*e+2*c*f/d)/d+2*a^2*Ci(c*f/d+f*x)*cos(-e+c*f/d)/d+3/2*a^2*ln(d*x+c)/d+1/2*a^2*
Si(2*c*f/d+2*f*x)*sin(-2*e+2*c*f/d)/d+2*a^2*Si(c*f/d+f*x)*sin(-e+c*f/d)/d

________________________________________________________________________________________

Rubi [A]  time = 0.34, antiderivative size = 145, normalized size of antiderivative = 1.00, number of steps used = 9, number of rules used = 5, integrand size = 20, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.250, Rules used = {3318, 3312, 3303, 3299, 3302} \[ \frac {2 a^2 \text {CosIntegral}\left (\frac {c f}{d}+f x\right ) \cos \left (e-\frac {c f}{d}\right )}{d}+\frac {a^2 \text {CosIntegral}\left (\frac {2 c f}{d}+2 f x\right ) \cos \left (2 e-\frac {2 c f}{d}\right )}{2 d}-\frac {2 a^2 \sin \left (e-\frac {c f}{d}\right ) \text {Si}\left (x f+\frac {c f}{d}\right )}{d}-\frac {a^2 \sin \left (2 e-\frac {2 c f}{d}\right ) \text {Si}\left (2 x f+\frac {2 c f}{d}\right )}{2 d}+\frac {3 a^2 \log (c+d x)}{2 d} \]

Antiderivative was successfully verified.

[In]

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

[Out]

(2*a^2*Cos[e - (c*f)/d]*CosIntegral[(c*f)/d + f*x])/d + (a^2*Cos[2*e - (2*c*f)/d]*CosIntegral[(2*c*f)/d + 2*f*
x])/(2*d) + (3*a^2*Log[c + d*x])/(2*d) - (2*a^2*Sin[e - (c*f)/d]*SinIntegral[(c*f)/d + f*x])/d - (a^2*Sin[2*e
- (2*c*f)/d]*SinIntegral[(2*c*f)/d + 2*f*x])/(2*d)

Rule 3299

Int[sin[(e_.) + (f_.)*(x_)]/((c_.) + (d_.)*(x_)), x_Symbol] :> Simp[SinIntegral[e + f*x]/d, x] /; FreeQ[{c, d,
 e, f}, x] && EqQ[d*e - c*f, 0]

Rule 3302

Int[sin[(e_.) + (f_.)*(x_)]/((c_.) + (d_.)*(x_)), x_Symbol] :> Simp[CosIntegral[e - Pi/2 + f*x]/d, x] /; FreeQ
[{c, d, e, f}, x] && EqQ[d*(e - Pi/2) - c*f, 0]

Rule 3303

Int[sin[(e_.) + (f_.)*(x_)]/((c_.) + (d_.)*(x_)), x_Symbol] :> Dist[Cos[(d*e - c*f)/d], Int[Sin[(c*f)/d + f*x]
/(c + d*x), x], x] + Dist[Sin[(d*e - c*f)/d], Int[Cos[(c*f)/d + f*x]/(c + d*x), x], x] /; FreeQ[{c, d, e, f},
x] && NeQ[d*e - c*f, 0]

Rule 3312

Int[((c_.) + (d_.)*(x_))^(m_)*sin[(e_.) + (f_.)*(x_)]^(n_), x_Symbol] :> Int[ExpandTrigReduce[(c + d*x)^m, Sin
[e + f*x]^n, x], x] /; FreeQ[{c, d, e, f, m}, x] && IGtQ[n, 1] && ( !RationalQ[m] || (GeQ[m, -1] && LtQ[m, 1])
)

Rule 3318

Int[((c_.) + (d_.)*(x_))^(m_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[(2*a)^n, Int[(c
 + d*x)^m*Sin[(1*(e + (Pi*a)/(2*b)))/2 + (f*x)/2]^(2*n), x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && EqQ[a^2
- b^2, 0] && IntegerQ[n] && (GtQ[n, 0] || IGtQ[m, 0])

Rubi steps

\begin {align*} \int \frac {(a+a \cos (e+f x))^2}{c+d x} \, dx &=\left (4 a^2\right ) \int \frac {\sin ^4\left (\frac {e+\pi }{2}+\frac {f x}{2}\right )}{c+d x} \, dx\\ &=\left (4 a^2\right ) \int \left (\frac {3}{8 (c+d x)}+\frac {\cos (e+f x)}{2 (c+d x)}+\frac {\cos (2 e+2 f x)}{8 (c+d x)}\right ) \, dx\\ &=\frac {3 a^2 \log (c+d x)}{2 d}+\frac {1}{2} a^2 \int \frac {\cos (2 e+2 f x)}{c+d x} \, dx+\left (2 a^2\right ) \int \frac {\cos (e+f x)}{c+d x} \, dx\\ &=\frac {3 a^2 \log (c+d x)}{2 d}+\frac {1}{2} \left (a^2 \cos \left (2 e-\frac {2 c f}{d}\right )\right ) \int \frac {\cos \left (\frac {2 c f}{d}+2 f x\right )}{c+d x} \, dx+\left (2 a^2 \cos \left (e-\frac {c f}{d}\right )\right ) \int \frac {\cos \left (\frac {c f}{d}+f x\right )}{c+d x} \, dx-\frac {1}{2} \left (a^2 \sin \left (2 e-\frac {2 c f}{d}\right )\right ) \int \frac {\sin \left (\frac {2 c f}{d}+2 f x\right )}{c+d x} \, dx-\left (2 a^2 \sin \left (e-\frac {c f}{d}\right )\right ) \int \frac {\sin \left (\frac {c f}{d}+f x\right )}{c+d x} \, dx\\ &=\frac {2 a^2 \cos \left (e-\frac {c f}{d}\right ) \text {Ci}\left (\frac {c f}{d}+f x\right )}{d}+\frac {a^2 \cos \left (2 e-\frac {2 c f}{d}\right ) \text {Ci}\left (\frac {2 c f}{d}+2 f x\right )}{2 d}+\frac {3 a^2 \log (c+d x)}{2 d}-\frac {2 a^2 \sin \left (e-\frac {c f}{d}\right ) \text {Si}\left (\frac {c f}{d}+f x\right )}{d}-\frac {a^2 \sin \left (2 e-\frac {2 c f}{d}\right ) \text {Si}\left (\frac {2 c f}{d}+2 f x\right )}{2 d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.23, size = 114, normalized size = 0.79 \[ \frac {a^2 \left (4 \text {Ci}\left (f \left (\frac {c}{d}+x\right )\right ) \cos \left (e-\frac {c f}{d}\right )+\text {Ci}\left (\frac {2 f (c+d x)}{d}\right ) \cos \left (2 e-\frac {2 c f}{d}\right )-4 \sin \left (e-\frac {c f}{d}\right ) \text {Si}\left (f \left (\frac {c}{d}+x\right )\right )-\sin \left (2 e-\frac {2 c f}{d}\right ) \text {Si}\left (\frac {2 f (c+d x)}{d}\right )+3 \log (c+d x)\right )}{2 d} \]

Antiderivative was successfully verified.

[In]

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

[Out]

(a^2*(4*Cos[e - (c*f)/d]*CosIntegral[f*(c/d + x)] + Cos[2*e - (2*c*f)/d]*CosIntegral[(2*f*(c + d*x))/d] + 3*Lo
g[c + d*x] - 4*Sin[e - (c*f)/d]*SinIntegral[f*(c/d + x)] - Sin[2*e - (2*c*f)/d]*SinIntegral[(2*f*(c + d*x))/d]
))/(2*d)

________________________________________________________________________________________

fricas [A]  time = 0.58, size = 186, normalized size = 1.28 \[ \frac {2 \, a^{2} \sin \left (-\frac {2 \, {\left (d e - c f\right )}}{d}\right ) \operatorname {Si}\left (\frac {2 \, {\left (d f x + c f\right )}}{d}\right ) + 8 \, a^{2} \sin \left (-\frac {d e - c f}{d}\right ) \operatorname {Si}\left (\frac {d f x + c f}{d}\right ) + 6 \, a^{2} \log \left (d x + c\right ) + 4 \, {\left (a^{2} \operatorname {Ci}\left (\frac {d f x + c f}{d}\right ) + a^{2} \operatorname {Ci}\left (-\frac {d f x + c f}{d}\right )\right )} \cos \left (-\frac {d e - c f}{d}\right ) + {\left (a^{2} \operatorname {Ci}\left (\frac {2 \, {\left (d f x + c f\right )}}{d}\right ) + a^{2} \operatorname {Ci}\left (-\frac {2 \, {\left (d f x + c f\right )}}{d}\right )\right )} \cos \left (-\frac {2 \, {\left (d e - c f\right )}}{d}\right )}{4 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/4*(2*a^2*sin(-2*(d*e - c*f)/d)*sin_integral(2*(d*f*x + c*f)/d) + 8*a^2*sin(-(d*e - c*f)/d)*sin_integral((d*f
*x + c*f)/d) + 6*a^2*log(d*x + c) + 4*(a^2*cos_integral((d*f*x + c*f)/d) + a^2*cos_integral(-(d*f*x + c*f)/d))
*cos(-(d*e - c*f)/d) + (a^2*cos_integral(2*(d*f*x + c*f)/d) + a^2*cos_integral(-2*(d*f*x + c*f)/d))*cos(-2*(d*
e - c*f)/d))/d

________________________________________________________________________________________

giac [C]  time = 2.03, size = 6933, normalized size = 47.81 \[ \text {result too large to display} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/4*(6*a^2*log(abs(d*x + c))*tan(c*f/d)^2*tan(1/2*c*f/d)^2*tan(1/2*e)^2*tan(e)^2 + a^2*real_part(cos_integral(
2*f*x + 2*c*f/d))*tan(c*f/d)^2*tan(1/2*c*f/d)^2*tan(1/2*e)^2*tan(e)^2 + 4*a^2*real_part(cos_integral(f*x + c*f
/d))*tan(c*f/d)^2*tan(1/2*c*f/d)^2*tan(1/2*e)^2*tan(e)^2 + 4*a^2*real_part(cos_integral(-f*x - c*f/d))*tan(c*f
/d)^2*tan(1/2*c*f/d)^2*tan(1/2*e)^2*tan(e)^2 + a^2*real_part(cos_integral(-2*f*x - 2*c*f/d))*tan(c*f/d)^2*tan(
1/2*c*f/d)^2*tan(1/2*e)^2*tan(e)^2 + 2*a^2*imag_part(cos_integral(2*f*x + 2*c*f/d))*tan(c*f/d)^2*tan(1/2*c*f/d
)^2*tan(1/2*e)^2*tan(e) - 2*a^2*imag_part(cos_integral(-2*f*x - 2*c*f/d))*tan(c*f/d)^2*tan(1/2*c*f/d)^2*tan(1/
2*e)^2*tan(e) + 4*a^2*sin_integral(2*(d*f*x + c*f)/d)*tan(c*f/d)^2*tan(1/2*c*f/d)^2*tan(1/2*e)^2*tan(e) + 8*a^
2*imag_part(cos_integral(f*x + c*f/d))*tan(c*f/d)^2*tan(1/2*c*f/d)^2*tan(1/2*e)*tan(e)^2 - 8*a^2*imag_part(cos
_integral(-f*x - c*f/d))*tan(c*f/d)^2*tan(1/2*c*f/d)^2*tan(1/2*e)*tan(e)^2 + 16*a^2*sin_integral((d*f*x + c*f)
/d)*tan(c*f/d)^2*tan(1/2*c*f/d)^2*tan(1/2*e)*tan(e)^2 - 8*a^2*imag_part(cos_integral(f*x + c*f/d))*tan(c*f/d)^
2*tan(1/2*c*f/d)*tan(1/2*e)^2*tan(e)^2 + 8*a^2*imag_part(cos_integral(-f*x - c*f/d))*tan(c*f/d)^2*tan(1/2*c*f/
d)*tan(1/2*e)^2*tan(e)^2 - 16*a^2*sin_integral((d*f*x + c*f)/d)*tan(c*f/d)^2*tan(1/2*c*f/d)*tan(1/2*e)^2*tan(e
)^2 - 2*a^2*imag_part(cos_integral(2*f*x + 2*c*f/d))*tan(c*f/d)*tan(1/2*c*f/d)^2*tan(1/2*e)^2*tan(e)^2 + 2*a^2
*imag_part(cos_integral(-2*f*x - 2*c*f/d))*tan(c*f/d)*tan(1/2*c*f/d)^2*tan(1/2*e)^2*tan(e)^2 - 4*a^2*sin_integ
ral(2*(d*f*x + c*f)/d)*tan(c*f/d)*tan(1/2*c*f/d)^2*tan(1/2*e)^2*tan(e)^2 + 6*a^2*log(abs(d*x + c))*tan(c*f/d)^
2*tan(1/2*c*f/d)^2*tan(1/2*e)^2 - a^2*real_part(cos_integral(2*f*x + 2*c*f/d))*tan(c*f/d)^2*tan(1/2*c*f/d)^2*t
an(1/2*e)^2 + 4*a^2*real_part(cos_integral(f*x + c*f/d))*tan(c*f/d)^2*tan(1/2*c*f/d)^2*tan(1/2*e)^2 + 4*a^2*re
al_part(cos_integral(-f*x - c*f/d))*tan(c*f/d)^2*tan(1/2*c*f/d)^2*tan(1/2*e)^2 - a^2*real_part(cos_integral(-2
*f*x - 2*c*f/d))*tan(c*f/d)^2*tan(1/2*c*f/d)^2*tan(1/2*e)^2 + 4*a^2*real_part(cos_integral(2*f*x + 2*c*f/d))*t
an(c*f/d)*tan(1/2*c*f/d)^2*tan(1/2*e)^2*tan(e) + 4*a^2*real_part(cos_integral(-2*f*x - 2*c*f/d))*tan(c*f/d)*ta
n(1/2*c*f/d)^2*tan(1/2*e)^2*tan(e) + 6*a^2*log(abs(d*x + c))*tan(c*f/d)^2*tan(1/2*c*f/d)^2*tan(e)^2 + a^2*real
_part(cos_integral(2*f*x + 2*c*f/d))*tan(c*f/d)^2*tan(1/2*c*f/d)^2*tan(e)^2 - 4*a^2*real_part(cos_integral(f*x
 + c*f/d))*tan(c*f/d)^2*tan(1/2*c*f/d)^2*tan(e)^2 - 4*a^2*real_part(cos_integral(-f*x - c*f/d))*tan(c*f/d)^2*t
an(1/2*c*f/d)^2*tan(e)^2 + a^2*real_part(cos_integral(-2*f*x - 2*c*f/d))*tan(c*f/d)^2*tan(1/2*c*f/d)^2*tan(e)^
2 + 16*a^2*real_part(cos_integral(f*x + c*f/d))*tan(c*f/d)^2*tan(1/2*c*f/d)*tan(1/2*e)*tan(e)^2 + 16*a^2*real_
part(cos_integral(-f*x - c*f/d))*tan(c*f/d)^2*tan(1/2*c*f/d)*tan(1/2*e)*tan(e)^2 + 6*a^2*log(abs(d*x + c))*tan
(c*f/d)^2*tan(1/2*e)^2*tan(e)^2 + a^2*real_part(cos_integral(2*f*x + 2*c*f/d))*tan(c*f/d)^2*tan(1/2*e)^2*tan(e
)^2 - 4*a^2*real_part(cos_integral(f*x + c*f/d))*tan(c*f/d)^2*tan(1/2*e)^2*tan(e)^2 - 4*a^2*real_part(cos_inte
gral(-f*x - c*f/d))*tan(c*f/d)^2*tan(1/2*e)^2*tan(e)^2 + a^2*real_part(cos_integral(-2*f*x - 2*c*f/d))*tan(c*f
/d)^2*tan(1/2*e)^2*tan(e)^2 + 6*a^2*log(abs(d*x + c))*tan(1/2*c*f/d)^2*tan(1/2*e)^2*tan(e)^2 - a^2*real_part(c
os_integral(2*f*x + 2*c*f/d))*tan(1/2*c*f/d)^2*tan(1/2*e)^2*tan(e)^2 + 4*a^2*real_part(cos_integral(f*x + c*f/
d))*tan(1/2*c*f/d)^2*tan(1/2*e)^2*tan(e)^2 + 4*a^2*real_part(cos_integral(-f*x - c*f/d))*tan(1/2*c*f/d)^2*tan(
1/2*e)^2*tan(e)^2 - a^2*real_part(cos_integral(-2*f*x - 2*c*f/d))*tan(1/2*c*f/d)^2*tan(1/2*e)^2*tan(e)^2 + 8*a
^2*imag_part(cos_integral(f*x + c*f/d))*tan(c*f/d)^2*tan(1/2*c*f/d)^2*tan(1/2*e) - 8*a^2*imag_part(cos_integra
l(-f*x - c*f/d))*tan(c*f/d)^2*tan(1/2*c*f/d)^2*tan(1/2*e) + 16*a^2*sin_integral((d*f*x + c*f)/d)*tan(c*f/d)^2*
tan(1/2*c*f/d)^2*tan(1/2*e) - 8*a^2*imag_part(cos_integral(f*x + c*f/d))*tan(c*f/d)^2*tan(1/2*c*f/d)*tan(1/2*e
)^2 + 8*a^2*imag_part(cos_integral(-f*x - c*f/d))*tan(c*f/d)^2*tan(1/2*c*f/d)*tan(1/2*e)^2 - 16*a^2*sin_integr
al((d*f*x + c*f)/d)*tan(c*f/d)^2*tan(1/2*c*f/d)*tan(1/2*e)^2 + 2*a^2*imag_part(cos_integral(2*f*x + 2*c*f/d))*
tan(c*f/d)*tan(1/2*c*f/d)^2*tan(1/2*e)^2 - 2*a^2*imag_part(cos_integral(-2*f*x - 2*c*f/d))*tan(c*f/d)*tan(1/2*
c*f/d)^2*tan(1/2*e)^2 + 4*a^2*sin_integral(2*(d*f*x + c*f)/d)*tan(c*f/d)*tan(1/2*c*f/d)^2*tan(1/2*e)^2 + 2*a^2
*imag_part(cos_integral(2*f*x + 2*c*f/d))*tan(c*f/d)^2*tan(1/2*c*f/d)^2*tan(e) - 2*a^2*imag_part(cos_integral(
-2*f*x - 2*c*f/d))*tan(c*f/d)^2*tan(1/2*c*f/d)^2*tan(e) + 4*a^2*sin_integral(2*(d*f*x + c*f)/d)*tan(c*f/d)^2*t
an(1/2*c*f/d)^2*tan(e) + 2*a^2*imag_part(cos_integral(2*f*x + 2*c*f/d))*tan(c*f/d)^2*tan(1/2*e)^2*tan(e) - 2*a
^2*imag_part(cos_integral(-2*f*x - 2*c*f/d))*tan(c*f/d)^2*tan(1/2*e)^2*tan(e) + 4*a^2*sin_integral(2*(d*f*x +
c*f)/d)*tan(c*f/d)^2*tan(1/2*e)^2*tan(e) - 2*a^2*imag_part(cos_integral(2*f*x + 2*c*f/d))*tan(1/2*c*f/d)^2*tan
(1/2*e)^2*tan(e) + 2*a^2*imag_part(cos_integral(-2*f*x - 2*c*f/d))*tan(1/2*c*f/d)^2*tan(1/2*e)^2*tan(e) - 4*a^
2*sin_integral(2*(d*f*x + c*f)/d)*tan(1/2*c*f/d)^2*tan(1/2*e)^2*tan(e) + 8*a^2*imag_part(cos_integral(f*x + c*
f/d))*tan(c*f/d)^2*tan(1/2*c*f/d)*tan(e)^2 - 8*a^2*imag_part(cos_integral(-f*x - c*f/d))*tan(c*f/d)^2*tan(1/2*
c*f/d)*tan(e)^2 + 16*a^2*sin_integral((d*f*x + c*f)/d)*tan(c*f/d)^2*tan(1/2*c*f/d)*tan(e)^2 - 2*a^2*imag_part(
cos_integral(2*f*x + 2*c*f/d))*tan(c*f/d)*tan(1/2*c*f/d)^2*tan(e)^2 + 2*a^2*imag_part(cos_integral(-2*f*x - 2*
c*f/d))*tan(c*f/d)*tan(1/2*c*f/d)^2*tan(e)^2 - 4*a^2*sin_integral(2*(d*f*x + c*f)/d)*tan(c*f/d)*tan(1/2*c*f/d)
^2*tan(e)^2 - 8*a^2*imag_part(cos_integral(f*x + c*f/d))*tan(c*f/d)^2*tan(1/2*e)*tan(e)^2 + 8*a^2*imag_part(co
s_integral(-f*x - c*f/d))*tan(c*f/d)^2*tan(1/2*e)*tan(e)^2 - 16*a^2*sin_integral((d*f*x + c*f)/d)*tan(c*f/d)^2
*tan(1/2*e)*tan(e)^2 + 8*a^2*imag_part(cos_integral(f*x + c*f/d))*tan(1/2*c*f/d)^2*tan(1/2*e)*tan(e)^2 - 8*a^2
*imag_part(cos_integral(-f*x - c*f/d))*tan(1/2*c*f/d)^2*tan(1/2*e)*tan(e)^2 + 16*a^2*sin_integral((d*f*x + c*f
)/d)*tan(1/2*c*f/d)^2*tan(1/2*e)*tan(e)^2 - 2*a^2*imag_part(cos_integral(2*f*x + 2*c*f/d))*tan(c*f/d)*tan(1/2*
e)^2*tan(e)^2 + 2*a^2*imag_part(cos_integral(-2*f*x - 2*c*f/d))*tan(c*f/d)*tan(1/2*e)^2*tan(e)^2 - 4*a^2*sin_i
ntegral(2*(d*f*x + c*f)/d)*tan(c*f/d)*tan(1/2*e)^2*tan(e)^2 - 8*a^2*imag_part(cos_integral(f*x + c*f/d))*tan(1
/2*c*f/d)*tan(1/2*e)^2*tan(e)^2 + 8*a^2*imag_part(cos_integral(-f*x - c*f/d))*tan(1/2*c*f/d)*tan(1/2*e)^2*tan(
e)^2 - 16*a^2*sin_integral((d*f*x + c*f)/d)*tan(1/2*c*f/d)*tan(1/2*e)^2*tan(e)^2 + 6*a^2*log(abs(d*x + c))*tan
(c*f/d)^2*tan(1/2*c*f/d)^2 - a^2*real_part(cos_integral(2*f*x + 2*c*f/d))*tan(c*f/d)^2*tan(1/2*c*f/d)^2 - 4*a^
2*real_part(cos_integral(f*x + c*f/d))*tan(c*f/d)^2*tan(1/2*c*f/d)^2 - 4*a^2*real_part(cos_integral(-f*x - c*f
/d))*tan(c*f/d)^2*tan(1/2*c*f/d)^2 - a^2*real_part(cos_integral(-2*f*x - 2*c*f/d))*tan(c*f/d)^2*tan(1/2*c*f/d)
^2 + 16*a^2*real_part(cos_integral(f*x + c*f/d))*tan(c*f/d)^2*tan(1/2*c*f/d)*tan(1/2*e) + 16*a^2*real_part(cos
_integral(-f*x - c*f/d))*tan(c*f/d)^2*tan(1/2*c*f/d)*tan(1/2*e) + 6*a^2*log(abs(d*x + c))*tan(c*f/d)^2*tan(1/2
*e)^2 - a^2*real_part(cos_integral(2*f*x + 2*c*f/d))*tan(c*f/d)^2*tan(1/2*e)^2 - 4*a^2*real_part(cos_integral(
f*x + c*f/d))*tan(c*f/d)^2*tan(1/2*e)^2 - 4*a^2*real_part(cos_integral(-f*x - c*f/d))*tan(c*f/d)^2*tan(1/2*e)^
2 - a^2*real_part(cos_integral(-2*f*x - 2*c*f/d))*tan(c*f/d)^2*tan(1/2*e)^2 + 6*a^2*log(abs(d*x + c))*tan(1/2*
c*f/d)^2*tan(1/2*e)^2 + a^2*real_part(cos_integral(2*f*x + 2*c*f/d))*tan(1/2*c*f/d)^2*tan(1/2*e)^2 + 4*a^2*rea
l_part(cos_integral(f*x + c*f/d))*tan(1/2*c*f/d)^2*tan(1/2*e)^2 + 4*a^2*real_part(cos_integral(-f*x - c*f/d))*
tan(1/2*c*f/d)^2*tan(1/2*e)^2 + a^2*real_part(cos_integral(-2*f*x - 2*c*f/d))*tan(1/2*c*f/d)^2*tan(1/2*e)^2 +
4*a^2*real_part(cos_integral(2*f*x + 2*c*f/d))*tan(c*f/d)*tan(1/2*c*f/d)^2*tan(e) + 4*a^2*real_part(cos_integr
al(-2*f*x - 2*c*f/d))*tan(c*f/d)*tan(1/2*c*f/d)^2*tan(e) + 4*a^2*real_part(cos_integral(2*f*x + 2*c*f/d))*tan(
c*f/d)*tan(1/2*e)^2*tan(e) + 4*a^2*real_part(cos_integral(-2*f*x - 2*c*f/d))*tan(c*f/d)*tan(1/2*e)^2*tan(e) +
6*a^2*log(abs(d*x + c))*tan(c*f/d)^2*tan(e)^2 + a^2*real_part(cos_integral(2*f*x + 2*c*f/d))*tan(c*f/d)^2*tan(
e)^2 + 4*a^2*real_part(cos_integral(f*x + c*f/d))*tan(c*f/d)^2*tan(e)^2 + 4*a^2*real_part(cos_integral(-f*x -
c*f/d))*tan(c*f/d)^2*tan(e)^2 + a^2*real_part(cos_integral(-2*f*x - 2*c*f/d))*tan(c*f/d)^2*tan(e)^2 + 6*a^2*lo
g(abs(d*x + c))*tan(1/2*c*f/d)^2*tan(e)^2 - a^2*real_part(cos_integral(2*f*x + 2*c*f/d))*tan(1/2*c*f/d)^2*tan(
e)^2 - 4*a^2*real_part(cos_integral(f*x + c*f/d))*tan(1/2*c*f/d)^2*tan(e)^2 - 4*a^2*real_part(cos_integral(-f*
x - c*f/d))*tan(1/2*c*f/d)^2*tan(e)^2 - a^2*real_part(cos_integral(-2*f*x - 2*c*f/d))*tan(1/2*c*f/d)^2*tan(e)^
2 + 16*a^2*real_part(cos_integral(f*x + c*f/d))*tan(1/2*c*f/d)*tan(1/2*e)*tan(e)^2 + 16*a^2*real_part(cos_inte
gral(-f*x - c*f/d))*tan(1/2*c*f/d)*tan(1/2*e)*tan(e)^2 + 6*a^2*log(abs(d*x + c))*tan(1/2*e)^2*tan(e)^2 - a^2*r
eal_part(cos_integral(2*f*x + 2*c*f/d))*tan(1/2*e)^2*tan(e)^2 - 4*a^2*real_part(cos_integral(f*x + c*f/d))*tan
(1/2*e)^2*tan(e)^2 - 4*a^2*real_part(cos_integral(-f*x - c*f/d))*tan(1/2*e)^2*tan(e)^2 - a^2*real_part(cos_int
egral(-2*f*x - 2*c*f/d))*tan(1/2*e)^2*tan(e)^2 + 8*a^2*imag_part(cos_integral(f*x + c*f/d))*tan(c*f/d)^2*tan(1
/2*c*f/d) - 8*a^2*imag_part(cos_integral(-f*x - c*f/d))*tan(c*f/d)^2*tan(1/2*c*f/d) + 16*a^2*sin_integral((d*f
*x + c*f)/d)*tan(c*f/d)^2*tan(1/2*c*f/d) + 2*a^2*imag_part(cos_integral(2*f*x + 2*c*f/d))*tan(c*f/d)*tan(1/2*c
*f/d)^2 - 2*a^2*imag_part(cos_integral(-2*f*x - 2*c*f/d))*tan(c*f/d)*tan(1/2*c*f/d)^2 + 4*a^2*sin_integral(2*(
d*f*x + c*f)/d)*tan(c*f/d)*tan(1/2*c*f/d)^2 - 8*a^2*imag_part(cos_integral(f*x + c*f/d))*tan(c*f/d)^2*tan(1/2*
e) + 8*a^2*imag_part(cos_integral(-f*x - c*f/d))*tan(c*f/d)^2*tan(1/2*e) - 16*a^2*sin_integral((d*f*x + c*f)/d
)*tan(c*f/d)^2*tan(1/2*e) + 8*a^2*imag_part(cos_integral(f*x + c*f/d))*tan(1/2*c*f/d)^2*tan(1/2*e) - 8*a^2*ima
g_part(cos_integral(-f*x - c*f/d))*tan(1/2*c*f/d)^2*tan(1/2*e) + 16*a^2*sin_integral((d*f*x + c*f)/d)*tan(1/2*
c*f/d)^2*tan(1/2*e) + 2*a^2*imag_part(cos_integral(2*f*x + 2*c*f/d))*tan(c*f/d)*tan(1/2*e)^2 - 2*a^2*imag_part
(cos_integral(-2*f*x - 2*c*f/d))*tan(c*f/d)*tan(1/2*e)^2 + 4*a^2*sin_integral(2*(d*f*x + c*f)/d)*tan(c*f/d)*ta
n(1/2*e)^2 - 8*a^2*imag_part(cos_integral(f*x + c*f/d))*tan(1/2*c*f/d)*tan(1/2*e)^2 + 8*a^2*imag_part(cos_inte
gral(-f*x - c*f/d))*tan(1/2*c*f/d)*tan(1/2*e)^2 - 16*a^2*sin_integral((d*f*x + c*f)/d)*tan(1/2*c*f/d)*tan(1/2*
e)^2 + 2*a^2*imag_part(cos_integral(2*f*x + 2*c*f/d))*tan(c*f/d)^2*tan(e) - 2*a^2*imag_part(cos_integral(-2*f*
x - 2*c*f/d))*tan(c*f/d)^2*tan(e) + 4*a^2*sin_integral(2*(d*f*x + c*f)/d)*tan(c*f/d)^2*tan(e) - 2*a^2*imag_par
t(cos_integral(2*f*x + 2*c*f/d))*tan(1/2*c*f/d)^2*tan(e) + 2*a^2*imag_part(cos_integral(-2*f*x - 2*c*f/d))*tan
(1/2*c*f/d)^2*tan(e) - 4*a^2*sin_integral(2*(d*f*x + c*f)/d)*tan(1/2*c*f/d)^2*tan(e) - 2*a^2*imag_part(cos_int
egral(2*f*x + 2*c*f/d))*tan(1/2*e)^2*tan(e) + 2*a^2*imag_part(cos_integral(-2*f*x - 2*c*f/d))*tan(1/2*e)^2*tan
(e) - 4*a^2*sin_integral(2*(d*f*x + c*f)/d)*tan(1/2*e)^2*tan(e) - 2*a^2*imag_part(cos_integral(2*f*x + 2*c*f/d
))*tan(c*f/d)*tan(e)^2 + 2*a^2*imag_part(cos_integral(-2*f*x - 2*c*f/d))*tan(c*f/d)*tan(e)^2 - 4*a^2*sin_integ
ral(2*(d*f*x + c*f)/d)*tan(c*f/d)*tan(e)^2 + 8*a^2*imag_part(cos_integral(f*x + c*f/d))*tan(1/2*c*f/d)*tan(e)^
2 - 8*a^2*imag_part(cos_integral(-f*x - c*f/d))*tan(1/2*c*f/d)*tan(e)^2 + 16*a^2*sin_integral((d*f*x + c*f)/d)
*tan(1/2*c*f/d)*tan(e)^2 - 8*a^2*imag_part(cos_integral(f*x + c*f/d))*tan(1/2*e)*tan(e)^2 + 8*a^2*imag_part(co
s_integral(-f*x - c*f/d))*tan(1/2*e)*tan(e)^2 - 16*a^2*sin_integral((d*f*x + c*f)/d)*tan(1/2*e)*tan(e)^2 + 6*a
^2*log(abs(d*x + c))*tan(c*f/d)^2 - a^2*real_part(cos_integral(2*f*x + 2*c*f/d))*tan(c*f/d)^2 + 4*a^2*real_par
t(cos_integral(f*x + c*f/d))*tan(c*f/d)^2 + 4*a^2*real_part(cos_integral(-f*x - c*f/d))*tan(c*f/d)^2 - a^2*rea
l_part(cos_integral(-2*f*x - 2*c*f/d))*tan(c*f/d)^2 + 6*a^2*log(abs(d*x + c))*tan(1/2*c*f/d)^2 + a^2*real_part
(cos_integral(2*f*x + 2*c*f/d))*tan(1/2*c*f/d)^2 - 4*a^2*real_part(cos_integral(f*x + c*f/d))*tan(1/2*c*f/d)^2
 - 4*a^2*real_part(cos_integral(-f*x - c*f/d))*tan(1/2*c*f/d)^2 + a^2*real_part(cos_integral(-2*f*x - 2*c*f/d)
)*tan(1/2*c*f/d)^2 + 16*a^2*real_part(cos_integral(f*x + c*f/d))*tan(1/2*c*f/d)*tan(1/2*e) + 16*a^2*real_part(
cos_integral(-f*x - c*f/d))*tan(1/2*c*f/d)*tan(1/2*e) + 6*a^2*log(abs(d*x + c))*tan(1/2*e)^2 + a^2*real_part(c
os_integral(2*f*x + 2*c*f/d))*tan(1/2*e)^2 - 4*a^2*real_part(cos_integral(f*x + c*f/d))*tan(1/2*e)^2 - 4*a^2*r
eal_part(cos_integral(-f*x - c*f/d))*tan(1/2*e)^2 + a^2*real_part(cos_integral(-2*f*x - 2*c*f/d))*tan(1/2*e)^2
 + 4*a^2*real_part(cos_integral(2*f*x + 2*c*f/d))*tan(c*f/d)*tan(e) + 4*a^2*real_part(cos_integral(-2*f*x - 2*
c*f/d))*tan(c*f/d)*tan(e) + 6*a^2*log(abs(d*x + c))*tan(e)^2 - a^2*real_part(cos_integral(2*f*x + 2*c*f/d))*ta
n(e)^2 + 4*a^2*real_part(cos_integral(f*x + c*f/d))*tan(e)^2 + 4*a^2*real_part(cos_integral(-f*x - c*f/d))*tan
(e)^2 - a^2*real_part(cos_integral(-2*f*x - 2*c*f/d))*tan(e)^2 + 2*a^2*imag_part(cos_integral(2*f*x + 2*c*f/d)
)*tan(c*f/d) - 2*a^2*imag_part(cos_integral(-2*f*x - 2*c*f/d))*tan(c*f/d) + 4*a^2*sin_integral(2*(d*f*x + c*f)
/d)*tan(c*f/d) + 8*a^2*imag_part(cos_integral(f*x + c*f/d))*tan(1/2*c*f/d) - 8*a^2*imag_part(cos_integral(-f*x
 - c*f/d))*tan(1/2*c*f/d) + 16*a^2*sin_integral((d*f*x + c*f)/d)*tan(1/2*c*f/d) - 8*a^2*imag_part(cos_integral
(f*x + c*f/d))*tan(1/2*e) + 8*a^2*imag_part(cos_integral(-f*x - c*f/d))*tan(1/2*e) - 16*a^2*sin_integral((d*f*
x + c*f)/d)*tan(1/2*e) - 2*a^2*imag_part(cos_integral(2*f*x + 2*c*f/d))*tan(e) + 2*a^2*imag_part(cos_integral(
-2*f*x - 2*c*f/d))*tan(e) - 4*a^2*sin_integral(2*(d*f*x + c*f)/d)*tan(e) + 6*a^2*log(abs(d*x + c)) + a^2*real_
part(cos_integral(2*f*x + 2*c*f/d)) + 4*a^2*real_part(cos_integral(f*x + c*f/d)) + 4*a^2*real_part(cos_integra
l(-f*x - c*f/d)) + a^2*real_part(cos_integral(-2*f*x - 2*c*f/d)))/(d*tan(c*f/d)^2*tan(1/2*c*f/d)^2*tan(1/2*e)^
2*tan(e)^2 + d*tan(c*f/d)^2*tan(1/2*c*f/d)^2*tan(1/2*e)^2 + d*tan(c*f/d)^2*tan(1/2*c*f/d)^2*tan(e)^2 + d*tan(c
*f/d)^2*tan(1/2*e)^2*tan(e)^2 + d*tan(1/2*c*f/d)^2*tan(1/2*e)^2*tan(e)^2 + d*tan(c*f/d)^2*tan(1/2*c*f/d)^2 + d
*tan(c*f/d)^2*tan(1/2*e)^2 + d*tan(1/2*c*f/d)^2*tan(1/2*e)^2 + d*tan(c*f/d)^2*tan(e)^2 + d*tan(1/2*c*f/d)^2*ta
n(e)^2 + d*tan(1/2*e)^2*tan(e)^2 + d*tan(c*f/d)^2 + d*tan(1/2*c*f/d)^2 + d*tan(1/2*e)^2 + d*tan(e)^2 + d)

________________________________________________________________________________________

maple [A]  time = 0.05, size = 192, normalized size = 1.32 \[ \frac {a^{2} \Si \left (2 f x +2 e +\frac {2 c f -2 d e}{d}\right ) \sin \left (\frac {2 c f -2 d e}{d}\right )}{2 d}+\frac {a^{2} \Ci \left (2 f x +2 e +\frac {2 c f -2 d e}{d}\right ) \cos \left (\frac {2 c f -2 d e}{d}\right )}{2 d}+\frac {3 a^{2} \ln \left (\left (f x +e \right ) d +c f -d e \right )}{2 d}+\frac {2 a^{2} \Si \left (f x +e +\frac {c f -d e}{d}\right ) \sin \left (\frac {c f -d e}{d}\right )}{d}+\frac {2 a^{2} \Ci \left (f x +e +\frac {c f -d e}{d}\right ) \cos \left (\frac {c f -d e}{d}\right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+a*cos(f*x+e))^2/(d*x+c),x)

[Out]

1/2*a^2*Si(2*f*x+2*e+2*(c*f-d*e)/d)*sin(2*(c*f-d*e)/d)/d+1/2*a^2*Ci(2*f*x+2*e+2*(c*f-d*e)/d)*cos(2*(c*f-d*e)/d
)/d+3/2*a^2*ln((f*x+e)*d+c*f-d*e)/d+2*a^2*Si(f*x+e+(c*f-d*e)/d)*sin((c*f-d*e)/d)/d+2*a^2*Ci(f*x+e+(c*f-d*e)/d)
*cos((c*f-d*e)/d)/d

________________________________________________________________________________________

maxima [C]  time = 1.14, size = 337, normalized size = 2.32 \[ \frac {\frac {4 \, a^{2} f \log \left (c + \frac {{\left (f x + e\right )} d}{f} - \frac {d e}{f}\right )}{d} - \frac {4 \, {\left (f {\left (E_{1}\left (\frac {i \, {\left (f x + e\right )} d - i \, d e + i \, c f}{d}\right ) + E_{1}\left (-\frac {i \, {\left (f x + e\right )} d - i \, d e + i \, c f}{d}\right )\right )} \cos \left (-\frac {d e - c f}{d}\right ) + f {\left (i \, E_{1}\left (\frac {i \, {\left (f x + e\right )} d - i \, d e + i \, c f}{d}\right ) - i \, E_{1}\left (-\frac {i \, {\left (f x + e\right )} d - i \, d e + i \, c f}{d}\right )\right )} \sin \left (-\frac {d e - c f}{d}\right )\right )} a^{2}}{d} - \frac {{\left (f {\left (E_{1}\left (\frac {2 i \, {\left (f x + e\right )} d - 2 i \, d e + 2 i \, c f}{d}\right ) + E_{1}\left (-\frac {2 i \, {\left (f x + e\right )} d - 2 i \, d e + 2 i \, c f}{d}\right )\right )} \cos \left (-\frac {2 \, {\left (d e - c f\right )}}{d}\right ) - f {\left (-i \, E_{1}\left (\frac {2 i \, {\left (f x + e\right )} d - 2 i \, d e + 2 i \, c f}{d}\right ) + i \, E_{1}\left (-\frac {2 i \, {\left (f x + e\right )} d - 2 i \, d e + 2 i \, c f}{d}\right )\right )} \sin \left (-\frac {2 \, {\left (d e - c f\right )}}{d}\right ) - 2 \, f \log \left ({\left (f x + e\right )} d - d e + c f\right )\right )} a^{2}}{d}}{4 \, f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/4*(4*a^2*f*log(c + (f*x + e)*d/f - d*e/f)/d - 4*(f*(exp_integral_e(1, (I*(f*x + e)*d - I*d*e + I*c*f)/d) + e
xp_integral_e(1, -(I*(f*x + e)*d - I*d*e + I*c*f)/d))*cos(-(d*e - c*f)/d) + f*(I*exp_integral_e(1, (I*(f*x + e
)*d - I*d*e + I*c*f)/d) - I*exp_integral_e(1, -(I*(f*x + e)*d - I*d*e + I*c*f)/d))*sin(-(d*e - c*f)/d))*a^2/d
- (f*(exp_integral_e(1, (2*I*(f*x + e)*d - 2*I*d*e + 2*I*c*f)/d) + exp_integral_e(1, -(2*I*(f*x + e)*d - 2*I*d
*e + 2*I*c*f)/d))*cos(-2*(d*e - c*f)/d) - f*(-I*exp_integral_e(1, (2*I*(f*x + e)*d - 2*I*d*e + 2*I*c*f)/d) + I
*exp_integral_e(1, -(2*I*(f*x + e)*d - 2*I*d*e + 2*I*c*f)/d))*sin(-2*(d*e - c*f)/d) - 2*f*log((f*x + e)*d - d*
e + c*f))*a^2/d)/f

________________________________________________________________________________________

mupad [F]  time = 0.00, size = -1, normalized size = -0.01 \[ \int \frac {{\left (a+a\,\cos \left (e+f\,x\right )\right )}^2}{c+d\,x} \,d x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + a*cos(e + f*x))^2/(c + d*x),x)

[Out]

int((a + a*cos(e + f*x))^2/(c + d*x), x)

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ a^{2} \left (\int \frac {2 \cos {\left (e + f x \right )}}{c + d x}\, dx + \int \frac {\cos ^{2}{\left (e + f x \right )}}{c + d x}\, dx + \int \frac {1}{c + d x}\, dx\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*cos(f*x+e))**2/(d*x+c),x)

[Out]

a**2*(Integral(2*cos(e + f*x)/(c + d*x), x) + Integral(cos(e + f*x)**2/(c + d*x), x) + Integral(1/(c + d*x), x
))

________________________________________________________________________________________