3.640 \(\int (b \sec (c+d x)+a \sin (c+d x)) (a \cos (c+d x)+b \sec (c+d x) \tan (c+d x)) \, dx\)

Optimal. Leaf size=26 \[ \frac {(a \sin (c+d x)+b \sec (c+d x))^2}{2 d} \]

[Out]

1/2*(b*sec(d*x+c)+a*sin(d*x+c))^2/d

________________________________________________________________________________________

Rubi [A]  time = 0.03, antiderivative size = 26, normalized size of antiderivative = 1.00, number of steps used = 1, number of rules used = 1, integrand size = 41, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.024, Rules used = {4385} \[ \frac {(a \sin (c+d x)+b \sec (c+d x))^2}{2 d} \]

Antiderivative was successfully verified.

[In]

Int[(b*Sec[c + d*x] + a*Sin[c + d*x])*(a*Cos[c + d*x] + b*Sec[c + d*x]*Tan[c + d*x]),x]

[Out]

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

Rule 4385

Int[(u_)*(y_)^(m_.), x_Symbol] :> With[{q = DerivativeDivides[ActivateTrig[y], ActivateTrig[u], x]}, Simp[(q*A
ctivateTrig[y^(m + 1)])/(m + 1), x] /;  !FalseQ[q]] /; FreeQ[m, x] && NeQ[m, -1] &&  !InertTrigFreeQ[u]

Rubi steps

\begin {align*} \int (b \sec (c+d x)+a \sin (c+d x)) (a \cos (c+d x)+b \sec (c+d x) \tan (c+d x)) \, dx &=\frac {(b \sec (c+d x)+a \sin (c+d x))^2}{2 d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [B]  time = 0.04, size = 67, normalized size = 2.58 \[ -\frac {a^2 \cos ^2(c+d x)}{2 d}-\frac {a b \tan ^{-1}(\tan (c+d x))}{d}+\frac {a b \tan (c+d x)}{d}+a b x+\frac {b^2 \sec ^2(c+d x)}{2 d} \]

Antiderivative was successfully verified.

[In]

Integrate[(b*Sec[c + d*x] + a*Sin[c + d*x])*(a*Cos[c + d*x] + b*Sec[c + d*x]*Tan[c + d*x]),x]

[Out]

a*b*x - (a*b*ArcTan[Tan[c + d*x]])/d - (a^2*Cos[c + d*x]^2)/(2*d) + (b^2*Sec[c + d*x]^2)/(2*d) + (a*b*Tan[c +
d*x])/d

________________________________________________________________________________________

fricas [B]  time = 0.98, size = 61, normalized size = 2.35 \[ -\frac {2 \, a^{2} \cos \left (d x + c\right )^{4} - a^{2} \cos \left (d x + c\right )^{2} - 4 \, a b \cos \left (d x + c\right ) \sin \left (d x + c\right ) - 2 \, b^{2}}{4 \, d \cos \left (d x + c\right )^{2}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*sec(d*x+c)+a*sin(d*x+c))*(a*cos(d*x+c)+b*sec(d*x+c)*tan(d*x+c)),x, algorithm="fricas")

[Out]

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

________________________________________________________________________________________

giac [A]  time = 2.67, size = 45, normalized size = 1.73 \[ \frac {b^{2} \tan \left (d x + c\right )^{2} + 2 \, a b \tan \left (d x + c\right ) - \frac {a^{2}}{\tan \left (d x + c\right )^{2} + 1}}{2 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*sec(d*x+c)+a*sin(d*x+c))*(a*cos(d*x+c)+b*sec(d*x+c)*tan(d*x+c)),x, algorithm="giac")

[Out]

1/2*(b^2*tan(d*x + c)^2 + 2*a*b*tan(d*x + c) - a^2/(tan(d*x + c)^2 + 1))/d

________________________________________________________________________________________

maple [B]  time = 0.46, size = 57, normalized size = 2.19 \[ \frac {-\frac {\left (\cos ^{2}\left (d x +c \right )\right ) a^{2}}{2}+a b \left (\tan \left (d x +c \right )-d x -c \right )+\left (d x +c \right ) a b +\frac {b^{2}}{2 \cos \left (d x +c \right )^{2}}}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((b*sec(d*x+c)+a*sin(d*x+c))*(a*cos(d*x+c)+b*sec(d*x+c)*tan(d*x+c)),x)

[Out]

1/d*(-1/2*cos(d*x+c)^2*a^2+a*b*(tan(d*x+c)-d*x-c)+(d*x+c)*a*b+1/2*b^2/cos(d*x+c)^2)

________________________________________________________________________________________

maxima [A]  time = 0.55, size = 24, normalized size = 0.92 \[ \frac {{\left (b \sec \left (d x + c\right ) + a \sin \left (d x + c\right )\right )}^{2}}{2 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*sec(d*x+c)+a*sin(d*x+c))*(a*cos(d*x+c)+b*sec(d*x+c)*tan(d*x+c)),x, algorithm="maxima")

[Out]

1/2*(b*sec(d*x + c) + a*sin(d*x + c))^2/d

________________________________________________________________________________________

mupad [B]  time = 3.18, size = 61, normalized size = 2.35 \[ -\frac {\frac {a^2\,\left (2\,{\sin \left (2\,c+2\,d\,x\right )}^2-1\right )}{16}+\frac {a^2}{16}+\frac {b^2}{2}+\frac {a\,b\,\sin \left (2\,c+2\,d\,x\right )}{2}}{d\,\left ({\sin \left (c+d\,x\right )}^2-1\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a*sin(c + d*x) + b/cos(c + d*x))*(a*cos(c + d*x) + (b*tan(c + d*x))/cos(c + d*x)),x)

[Out]

-((a^2*(2*sin(2*c + 2*d*x)^2 - 1))/16 + a^2/16 + b^2/2 + (a*b*sin(2*c + 2*d*x))/2)/(d*(sin(c + d*x)^2 - 1))

________________________________________________________________________________________

sympy [A]  time = 3.46, size = 73, normalized size = 2.81 \[ \begin {cases} \frac {a^{2} \sin ^{2}{\left (c + d x \right )}}{2 d} + \frac {a b \sin {\left (c + d x \right )} \sec {\left (c + d x \right )}}{d} + \frac {b^{2} \sec ^{2}{\left (c + d x \right )}}{2 d} & \text {for}\: d \neq 0 \\x \left (a \sin {\relax (c )} + b \sec {\relax (c )}\right ) \left (a \cos {\relax (c )} + b \tan {\relax (c )} \sec {\relax (c )}\right ) & \text {otherwise} \end {cases} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*sec(d*x+c)+a*sin(d*x+c))*(a*cos(d*x+c)+b*sec(d*x+c)*tan(d*x+c)),x)

[Out]

Piecewise((a**2*sin(c + d*x)**2/(2*d) + a*b*sin(c + d*x)*sec(c + d*x)/d + b**2*sec(c + d*x)**2/(2*d), Ne(d, 0)
), (x*(a*sin(c) + b*sec(c))*(a*cos(c) + b*tan(c)*sec(c)), True))

________________________________________________________________________________________