3.3.61 \(\int \frac {3 \cos (x)+4 \sin (x)}{4 \cos (x)+3 \sin (x)} \, dx\) [261]

Optimal. Leaf size=20 \[ \frac {24 x}{25}-\frac {7}{25} \log (4 \cos (x)+3 \sin (x)) \]

[Out]

24/25*x-7/25*ln(3*sin(x)+4*cos(x))

________________________________________________________________________________________

Rubi [A]
time = 0.02, antiderivative size = 20, normalized size of antiderivative = 1.00, number of steps used = 1, number of rules used = 1, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.048, Rules used = {3212} \begin {gather*} \frac {24 x}{25}-\frac {7}{25} \log (3 \sin (x)+4 \cos (x)) \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(3*Cos[x] + 4*Sin[x])/(4*Cos[x] + 3*Sin[x]),x]

[Out]

(24*x)/25 - (7*Log[4*Cos[x] + 3*Sin[x]])/25

Rule 3212

Int[((A_.) + cos[(d_.) + (e_.)*(x_)]*(B_.) + (C_.)*sin[(d_.) + (e_.)*(x_)])/((a_.) + cos[(d_.) + (e_.)*(x_)]*(
b_.) + (c_.)*sin[(d_.) + (e_.)*(x_)]), x_Symbol] :> Simp[(b*B + c*C)*(x/(b^2 + c^2)), x] + Simp[(c*B - b*C)*(L
og[a + b*Cos[d + e*x] + c*Sin[d + e*x]]/(e*(b^2 + c^2))), x] /; FreeQ[{a, b, c, d, e, A, B, C}, x] && NeQ[b^2
+ c^2, 0] && EqQ[A*(b^2 + c^2) - a*(b*B + c*C), 0]

Rubi steps

\begin {gather*} \begin {aligned} \text {Integral} &=\frac {24 x}{25}-\frac {7}{25} \log (4 \cos (x)+3 \sin (x))\\ \end {aligned} \end {gather*}

________________________________________________________________________________________

Mathematica [A]
time = 0.02, size = 20, normalized size = 1.00 \begin {gather*} \frac {24 x}{25}-\frac {7}{25} \log (4 \cos (x)+3 \sin (x)) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(3*Cos[x] + 4*Sin[x])/(4*Cos[x] + 3*Sin[x]),x]

[Out]

(24*x)/25 - (7*Log[4*Cos[x] + 3*Sin[x]])/25

________________________________________________________________________________________

Maple [A]
time = 0.22, size = 25, normalized size = 1.25

method result size
risch \(\frac {24 x}{25}+\frac {7 i x}{25}-\frac {7 \ln \left ({\mathrm e}^{2 i x}+\frac {7}{25}+\frac {24 i}{25}\right )}{25}\) \(21\)
default \(\frac {7 \ln \left (1+\tan ^{2}\left (x \right )\right )}{50}+\frac {24 \arctan \left (\tan \left (x \right )\right )}{25}-\frac {7 \ln \left (3 \tan \left (x \right )+4\right )}{25}\) \(25\)
parallelrisch \(\ln \left (\frac {2}{\left (-2048 \left (\cot \left (x \right )-\csc \left (x \right )+2\right )^{7}\right )^{\frac {1}{25}}}\right )+\ln \left (\frac {1}{\left (-2 \cot \left (x \right )+2 \csc \left (x \right )+1\right )^{\frac {7}{25}}}\right )+\ln \left (\left (\frac {1}{1+\cos \left (x \right )}\right )^{\frac {7}{25}}\right )+\frac {24 x}{25}\) \(44\)
norman \(\frac {\frac {24 x}{25}+\frac {24 x \left (\tan ^{2}\left (\frac {x}{2}\right )\right )}{25}}{1+\tan ^{2}\left (\frac {x}{2}\right )}-\frac {7 \ln \left (\tan \left (\frac {x}{2}\right )-2\right )}{25}-\frac {7 \ln \left (2 \tan \left (\frac {x}{2}\right )+1\right )}{25}+\frac {7 \ln \left (1+\tan ^{2}\left (\frac {x}{2}\right )\right )}{25}\) \(57\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

7/50*ln(1+tan(x)^2)+24/25*arctan(tan(x))-7/25*ln(3*tan(x)+4)

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 58 vs. \(2 (16) = 32\).
time = 0.44, size = 58, normalized size = 2.90 \begin {gather*} \frac {48}{25} \, \arctan \left (\frac {\sin \left (x\right )}{\cos \left (x\right ) + 1}\right ) - \frac {7}{25} \, \log \left (\frac {2 \, \sin \left (x\right )}{\cos \left (x\right ) + 1} + 1\right ) - \frac {7}{25} \, \log \left (\frac {\sin \left (x\right )}{\cos \left (x\right ) + 1} - 2\right ) + \frac {7}{25} \, \log \left (\frac {\sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}} + 1\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

48/25*arctan(sin(x)/(cos(x) + 1)) - 7/25*log(2*sin(x)/(cos(x) + 1) + 1) - 7/25*log(sin(x)/(cos(x) + 1) - 2) +
7/25*log(sin(x)^2/(cos(x) + 1)^2 + 1)

________________________________________________________________________________________

Fricas [A]
time = 0.62, size = 16, normalized size = 0.80 \begin {gather*} \frac {24}{25} \, x - \frac {7}{25} \, \log \left (-2 \, \cos \left (x\right ) - \frac {3}{2} \, \sin \left (x\right )\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

24/25*x - 7/25*log(-2*cos(x) - 3/2*sin(x))

________________________________________________________________________________________

Sympy [A]
time = 0.06, size = 19, normalized size = 0.95 \begin {gather*} \frac {24 x}{25} - \frac {7 \log {\left (3 \sin {\left (x \right )} + 4 \cos {\left (x \right )} \right )}}{25} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

24*x/25 - 7*log(3*sin(x) + 4*cos(x))/25

________________________________________________________________________________________

Giac [A]
time = 0.41, size = 23, normalized size = 1.15 \begin {gather*} \frac {24}{25} \, x + \frac {7}{50} \, \log \left (\tan \left (x\right )^{2} + 1\right ) - \frac {7}{25} \, \log \left ({\left | 3 \, \tan \left (x\right ) + 4 \right |}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((4*sin(x)+3*cos(x))/(3*sin(x)+4*cos(x)),x, algorithm="giac")

[Out]

24/25*x + 7/50*log(tan(x)^2 + 1) - 7/25*log(abs(3*tan(x) + 4))

________________________________________________________________________________________

Mupad [B]
time = 0.58, size = 32, normalized size = 1.60 \begin {gather*} \frac {24\,x}{25}-\frac {7\,\ln \left ({\mathrm {tan}\left (\frac {x}{2}\right )}^2-\frac {3\,\mathrm {tan}\left (\frac {x}{2}\right )}{2}-1\right )}{25}+\frac {7\,\ln \left ({\mathrm {tan}\left (\frac {x}{2}\right )}^2+1\right )}{25} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((3*cos(x) + 4*sin(x))/(4*cos(x) + 3*sin(x)),x)

[Out]

(24*x)/25 - (7*log(tan(x/2)^2 - (3*tan(x/2))/2 - 1))/25 + (7*log(tan(x/2)^2 + 1))/25

________________________________________________________________________________________

Chatgpt [F] Failed to verify
time = 1.00, size = 11, normalized size = 0.55 \begin {gather*} -\frac {4 \ln \left (\cos \left (x \right )\right )}{3}+\frac {3 \ln \left (\sin \left (x \right )\right )}{4} \end {gather*}

Warning: Unable to verify antiderivative.

[In]

int((4*sin(x)+3*cos(x))/(3*sin(x)+4*cos(x)),x)

[Out]

-4/3*ln(cos(x))+3/4*ln(sin(x))

________________________________________________________________________________________