3.232 \(\int (a \sin (c+d x)+b \tan (c+d x)) \, dx\)

Optimal. Leaf size=26 \[ -\frac {a \cos (c+d x)}{d}-\frac {b \log (\cos (c+d x))}{d} \]

[Out]

-a*cos(d*x+c)/d-b*ln(cos(d*x+c))/d

________________________________________________________________________________________

Rubi [A]  time = 0.01, antiderivative size = 26, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 17, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.118, Rules used = {2638, 3475} \[ -\frac {a \cos (c+d x)}{d}-\frac {b \log (\cos (c+d x))}{d} \]

Antiderivative was successfully verified.

[In]

Int[a*Sin[c + d*x] + b*Tan[c + d*x],x]

[Out]

-((a*Cos[c + d*x])/d) - (b*Log[Cos[c + d*x]])/d

Rule 2638

Int[sin[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Cos[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rule 3475

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]  time = 0.02, size = 37, normalized size = 1.42 \[ \frac {a \sin (c) \sin (d x)}{d}-\frac {a \cos (c) \cos (d x)}{d}-\frac {b \log (\cos (c+d x))}{d} \]

Antiderivative was successfully verified.

[In]

Integrate[a*Sin[c + d*x] + b*Tan[c + d*x],x]

[Out]

-((a*Cos[c]*Cos[d*x])/d) - (b*Log[Cos[c + d*x]])/d + (a*Sin[c]*Sin[d*x])/d

________________________________________________________________________________________

fricas [A]  time = 0.42, size = 25, normalized size = 0.96 \[ -\frac {a \cos \left (d x + c\right ) + b \log \left (-\cos \left (d x + c\right )\right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-(a*cos(d*x + c) + b*log(-cos(d*x + c)))/d

________________________________________________________________________________________

giac [A]  time = 0.16, size = 27, normalized size = 1.04 \[ -\frac {a \cos \left (d x + c\right )}{d} - \frac {b \log \left ({\left | \cos \left (d x + c\right ) \right |}\right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-a*cos(d*x + c)/d - b*log(abs(cos(d*x + c)))/d

________________________________________________________________________________________

maple [A]  time = 0.01, size = 31, normalized size = 1.19 \[ \frac {b \ln \left (\tan ^{2}\left (d x +c \right )+1\right )}{2 d}-\frac {a \cos \left (d x +c \right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maxima [A]  time = 0.35, size = 25, normalized size = 0.96 \[ -\frac {a \cos \left (d x + c\right )}{d} + \frac {b \log \left (\sec \left (d x + c\right )\right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-a*cos(d*x + c)/d + b*log(sec(d*x + c))/d

________________________________________________________________________________________

mupad [B]  time = 0.65, size = 40, normalized size = 1.54 \[ \frac {2\,b\,\mathrm {atanh}\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\right )}{d}-\frac {2\,a}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

sympy [A]  time = 0.16, size = 37, normalized size = 1.42 \[ a \left (\begin {cases} - \frac {\cos {\left (c + d x \right )}}{d} & \text {for}\: d \neq 0 \\x \sin {\relax (c )} & \text {otherwise} \end {cases}\right ) + b \left (\begin {cases} \frac {\log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} & \text {for}\: d \neq 0 \\x \tan {\relax (c )} & \text {otherwise} \end {cases}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________