3.3.21 \(\int \frac {1}{-4 \cos (x)+3 \sin (x)} \, dx\) [221]

Optimal. Leaf size=18 \[ -\frac {1}{5} \tanh ^{-1}\left (\frac {1}{5} (3 \cos (x)+4 \sin (x))\right ) \]

[Out]

-1/5*arctanh(3/5*cos(x)+4/5*sin(x))

________________________________________________________________________________________

Rubi [A]
time = 0.01, antiderivative size = 18, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.182, Rules used = {3153, 212} \begin {gather*} -\frac {1}{5} \tanh ^{-1}\left (\frac {1}{5} (4 \sin (x)+3 \cos (x))\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(-4*Cos[x] + 3*Sin[x])^(-1),x]

[Out]

-1/5*ArcTanh[(3*Cos[x] + 4*Sin[x])/5]

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 3153

Int[(cos[(c_.) + (d_.)*(x_)]*(a_.) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> Dist[-d^(-1), Subst[Int
[1/(a^2 + b^2 - x^2), x], x, b*Cos[c + d*x] - a*Sin[c + d*x]], x] /; FreeQ[{a, b, c, d}, x] && NeQ[a^2 + b^2,
0]

Rubi steps

\begin {align*} \int \frac {1}{-4 \cos (x)+3 \sin (x)} \, dx &=-\text {Subst}\left (\int \frac {1}{25-x^2} \, dx,x,3 \cos (x)+4 \sin (x)\right )\\ &=-\frac {1}{5} \tanh ^{-1}\left (\frac {1}{5} (3 \cos (x)+4 \sin (x))\right )\\ \end {align*}

________________________________________________________________________________________

Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(41\) vs. \(2(18)=36\).
time = 0.01, size = 41, normalized size = 2.28 \begin {gather*} \frac {1}{5} \log \left (\cos \left (\frac {x}{2}\right )-2 \sin \left (\frac {x}{2}\right )\right )-\frac {1}{5} \log \left (2 \cos \left (\frac {x}{2}\right )+\sin \left (\frac {x}{2}\right )\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(-4*Cos[x] + 3*Sin[x])^(-1),x]

[Out]

Log[Cos[x/2] - 2*Sin[x/2]]/5 - Log[2*Cos[x/2] + Sin[x/2]]/5

________________________________________________________________________________________

Mathics [A]
time = 1.99, size = 21, normalized size = 1.17 \begin {gather*} -\frac {\text {Log}\left [2+\text {Tan}\left [\frac {x}{2}\right ]\right ]}{5}+\frac {\text {Log}\left [-1+2 \text {Tan}\left [\frac {x}{2}\right ]\right ]}{5} \end {gather*}

Antiderivative was successfully verified.

[In]

mathics('Integrate[1/(-4*Cos[x] + 3*Sin[x]),x]')

[Out]

-Log[2 + Tan[x / 2]] / 5 + Log[-1 + 2 Tan[x / 2]] / 5

________________________________________________________________________________________

Maple [A]
time = 0.06, size = 22, normalized size = 1.22

method result size
default \(\frac {\ln \left (2 \tan \left (\frac {x}{2}\right )-1\right )}{5}-\frac {\ln \left (\tan \left (\frac {x}{2}\right )+2\right )}{5}\) \(22\)
norman \(\frac {\ln \left (2 \tan \left (\frac {x}{2}\right )-1\right )}{5}-\frac {\ln \left (\tan \left (\frac {x}{2}\right )+2\right )}{5}\) \(22\)
risch \(\frac {\ln \left ({\mathrm e}^{i x}-\frac {3}{5}-\frac {4 i}{5}\right )}{5}-\frac {\ln \left ({\mathrm e}^{i x}+\frac {3}{5}+\frac {4 i}{5}\right )}{5}\) \(26\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(-4*cos(x)+3*sin(x)),x,method=_RETURNVERBOSE)

[Out]

1/5*ln(2*tan(1/2*x)-1)-1/5*ln(tan(1/2*x)+2)

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 30 vs. \(2 (12) = 24\).
time = 0.26, size = 30, normalized size = 1.67 \begin {gather*} \frac {1}{5} \, \log \left (\frac {2 \, \sin \left (x\right )}{\cos \left (x\right ) + 1} - 1\right ) - \frac {1}{5} \, \log \left (\frac {\sin \left (x\right )}{\cos \left (x\right ) + 1} + 2\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(-4*cos(x)+3*sin(x)),x, algorithm="maxima")

[Out]

1/5*log(2*sin(x)/(cos(x) + 1) - 1) - 1/5*log(sin(x)/(cos(x) + 1) + 2)

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 27 vs. \(2 (12) = 24\).
time = 0.35, size = 27, normalized size = 1.50 \begin {gather*} -\frac {1}{10} \, \log \left (\frac {3}{2} \, \cos \left (x\right ) + 2 \, \sin \left (x\right ) + \frac {5}{2}\right ) + \frac {1}{10} \, \log \left (-\frac {3}{2} \, \cos \left (x\right ) - 2 \, \sin \left (x\right ) + \frac {5}{2}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(-4*cos(x)+3*sin(x)),x, algorithm="fricas")

[Out]

-1/10*log(3/2*cos(x) + 2*sin(x) + 5/2) + 1/10*log(-3/2*cos(x) - 2*sin(x) + 5/2)

________________________________________________________________________________________

Sympy [A]
time = 0.14, size = 20, normalized size = 1.11 \begin {gather*} - \frac {\log {\left (\tan {\left (\frac {x}{2} \right )} + 2 \right )}}{5} + \frac {\log {\left (2 \tan {\left (\frac {x}{2} \right )} - 1 \right )}}{5} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(-4*cos(x)+3*sin(x)),x)

[Out]

-log(tan(x/2) + 2)/5 + log(2*tan(x/2) - 1)/5

________________________________________________________________________________________

Giac [A]
time = 0.00, size = 30, normalized size = 1.67 \begin {gather*} 2 \left (-\frac {\ln \left |\tan \left (\frac {x}{2}\right )+2\right |}{10}+\frac {\ln \left |2 \tan \left (\frac {x}{2}\right )-1\right |}{10}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(-4*cos(x)+3*sin(x)),x)

[Out]

1/5*log(abs(2*tan(1/2*x) - 1)) - 1/5*log(abs(tan(1/2*x) + 2))

________________________________________________________________________________________

Mupad [B]
time = 0.49, size = 11, normalized size = 0.61 \begin {gather*} -\frac {2\,\mathrm {atanh}\left (\frac {4\,\mathrm {tan}\left (\frac {x}{2}\right )}{5}+\frac {3}{5}\right )}{5} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(-1/(4*cos(x) - 3*sin(x)),x)

[Out]

-(2*atanh((4*tan(x/2))/5 + 3/5))/5

________________________________________________________________________________________