\(\int \frac {A+B \cos (x)+C \sin (x)}{b \cos (x)+c \sin (x)} \, dx\) [475]

Optimal result
Mathematica [A] (verified)
Rubi [A] (verified)
Maple [B] (verified)
Fricas [A] (verification not implemented)
Sympy [C] (verification not implemented)
Maxima [B] (verification not implemented)
Giac [A] (verification not implemented)
Mupad [B] (verification not implemented)
Reduce [B] (verification not implemented)

Optimal result

Integrand size = 22, antiderivative size = 84 \[ \int \frac {A+B \cos (x)+C \sin (x)}{b \cos (x)+c \sin (x)} \, dx=\frac {(b B+c C) x}{b^2+c^2}-\frac {A \text {arctanh}\left (\frac {c \cos (x)-b \sin (x)}{\sqrt {b^2+c^2}}\right )}{\sqrt {b^2+c^2}}+\frac {(B c-b C) \log (b \cos (x)+c \sin (x))}{b^2+c^2} \] Output:

(B*b+C*c)*x/(b^2+c^2)-A*arctanh((c*cos(x)-b*sin(x))/(b^2+c^2)^(1/2))/(b^2+ 
c^2)^(1/2)+(B*c-C*b)*ln(b*cos(x)+c*sin(x))/(b^2+c^2)
 

Mathematica [A] (verified)

Time = 0.32 (sec) , antiderivative size = 78, normalized size of antiderivative = 0.93 \[ \int \frac {A+B \cos (x)+C \sin (x)}{b \cos (x)+c \sin (x)} \, dx=\frac {(b B+c C) x+2 A \sqrt {b^2+c^2} \text {arctanh}\left (\frac {-c+b \tan \left (\frac {x}{2}\right )}{\sqrt {b^2+c^2}}\right )+(B c-b C) \log (b \cos (x)+c \sin (x))}{b^2+c^2} \] Input:

Integrate[(A + B*Cos[x] + C*Sin[x])/(b*Cos[x] + c*Sin[x]),x]
 

Output:

((b*B + c*C)*x + 2*A*Sqrt[b^2 + c^2]*ArcTanh[(-c + b*Tan[x/2])/Sqrt[b^2 + 
c^2]] + (B*c - b*C)*Log[b*Cos[x] + c*Sin[x]])/(b^2 + c^2)
 

Rubi [A] (verified)

Time = 0.32 (sec) , antiderivative size = 84, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.227, Rules used = {3042, 3615, 3042, 3553, 219}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \frac {A+B \cos (x)+C \sin (x)}{b \cos (x)+c \sin (x)} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {A+B \cos (x)+C \sin (x)}{b \cos (x)+c \sin (x)}dx\)

\(\Big \downarrow \) 3615

\(\displaystyle A \int \frac {1}{b \cos (x)+c \sin (x)}dx+\frac {x (b B+c C)}{b^2+c^2}+\frac {(B c-b C) \log (b \cos (x)+c \sin (x))}{b^2+c^2}\)

\(\Big \downarrow \) 3042

\(\displaystyle A \int \frac {1}{b \cos (x)+c \sin (x)}dx+\frac {x (b B+c C)}{b^2+c^2}+\frac {(B c-b C) \log (b \cos (x)+c \sin (x))}{b^2+c^2}\)

\(\Big \downarrow \) 3553

\(\displaystyle -A \int \frac {1}{b^2+c^2-(c \cos (x)-b \sin (x))^2}d(c \cos (x)-b \sin (x))+\frac {x (b B+c C)}{b^2+c^2}+\frac {(B c-b C) \log (b \cos (x)+c \sin (x))}{b^2+c^2}\)

\(\Big \downarrow \) 219

\(\displaystyle -\frac {A \text {arctanh}\left (\frac {c \cos (x)-b \sin (x)}{\sqrt {b^2+c^2}}\right )}{\sqrt {b^2+c^2}}+\frac {x (b B+c C)}{b^2+c^2}+\frac {(B c-b C) \log (b \cos (x)+c \sin (x))}{b^2+c^2}\)

Input:

Int[(A + B*Cos[x] + C*Sin[x])/(b*Cos[x] + c*Sin[x]),x]
 

Output:

((b*B + c*C)*x)/(b^2 + c^2) - (A*ArcTanh[(c*Cos[x] - b*Sin[x])/Sqrt[b^2 + 
c^2]])/Sqrt[b^2 + c^2] + ((B*c - b*C)*Log[b*Cos[x] + c*Sin[x]])/(b^2 + c^2 
)
 

Defintions of rubi rules used

rule 219
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] && (Gt 
Q[a, 0] || LtQ[b, 0])
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 3553
Int[(cos[(c_.) + (d_.)*(x_)]*(a_.) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(-1), x 
_Symbol] :> Simp[-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]
 

rule 3615
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)*(Log[a 
 + b*Cos[d + e*x] + c*Sin[d + e*x]]/(e*(b^2 + c^2))), x] + Simp[(A*(b^2 + c 
^2) - a*(b*B + c*C))/(b^2 + c^2)   Int[1/(a + b*Cos[d + e*x] + c*Sin[d + e* 
x]), x], x]) /; FreeQ[{a, b, c, d, e, A, B, C}, x] && NeQ[b^2 + c^2, 0] && 
NeQ[A*(b^2 + c^2) - a*(b*B + c*C), 0]
 
Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(166\) vs. \(2(80)=160\).

Time = 0.26 (sec) , antiderivative size = 167, normalized size of antiderivative = 1.99

method result size
default \(\frac {\frac {\left (b B c -b^{2} C \right ) \ln \left (b \tan \left (\frac {x}{2}\right )^{2}-2 c \tan \left (\frac {x}{2}\right )-b \right )}{b}-\frac {2 \left (-A \,b^{2}-A \,c^{2}-B \,c^{2}+C b c +\frac {\left (b B c -b^{2} C \right ) c}{b}\right ) \operatorname {arctanh}\left (\frac {2 b \tan \left (\frac {x}{2}\right )-2 c}{2 \sqrt {b^{2}+c^{2}}}\right )}{\sqrt {b^{2}+c^{2}}}}{b^{2}+c^{2}}+\frac {\left (-B c +b C \right ) \ln \left (1+\tan \left (\frac {x}{2}\right )^{2}\right )+2 \left (B b +C c \right ) \arctan \left (\tan \left (\frac {x}{2}\right )\right )}{b^{2}+c^{2}}\) \(167\)
risch \(\frac {i x C}{i c -b}-\frac {x B}{i c -b}-\frac {2 i x B \,b^{2} c}{b^{4}+2 b^{2} c^{2}+c^{4}}-\frac {2 i x B \,c^{3}}{b^{4}+2 b^{2} c^{2}+c^{4}}+\frac {2 i x C \,b^{3}}{b^{4}+2 b^{2} c^{2}+c^{4}}+\frac {2 i x C b \,c^{2}}{b^{4}+2 b^{2} c^{2}+c^{4}}+\frac {\ln \left ({\mathrm e}^{i x}+\frac {\left (i b -c \right ) \sqrt {A^{2} b^{2}+A^{2} c^{2}}}{A \left (b^{2}+c^{2}\right )}\right ) B c}{b^{2}+c^{2}}-\frac {\ln \left ({\mathrm e}^{i x}+\frac {\left (i b -c \right ) \sqrt {A^{2} b^{2}+A^{2} c^{2}}}{A \left (b^{2}+c^{2}\right )}\right ) b C}{b^{2}+c^{2}}+\frac {\ln \left ({\mathrm e}^{i x}+\frac {\left (i b -c \right ) \sqrt {A^{2} b^{2}+A^{2} c^{2}}}{A \left (b^{2}+c^{2}\right )}\right ) \sqrt {A^{2} b^{2}+A^{2} c^{2}}}{b^{2}+c^{2}}+\frac {\ln \left ({\mathrm e}^{i x}-\frac {\left (i b -c \right ) \sqrt {A^{2} b^{2}+A^{2} c^{2}}}{A \left (b^{2}+c^{2}\right )}\right ) B c}{b^{2}+c^{2}}-\frac {\ln \left ({\mathrm e}^{i x}-\frac {\left (i b -c \right ) \sqrt {A^{2} b^{2}+A^{2} c^{2}}}{A \left (b^{2}+c^{2}\right )}\right ) b C}{b^{2}+c^{2}}-\frac {\ln \left ({\mathrm e}^{i x}-\frac {\left (i b -c \right ) \sqrt {A^{2} b^{2}+A^{2} c^{2}}}{A \left (b^{2}+c^{2}\right )}\right ) \sqrt {A^{2} b^{2}+A^{2} c^{2}}}{b^{2}+c^{2}}\) \(511\)

Input:

int((A+B*cos(x)+C*sin(x))/(b*cos(x)+c*sin(x)),x,method=_RETURNVERBOSE)
 

Output:

2/(b^2+c^2)*(1/2*(B*b*c-C*b^2)/b*ln(b*tan(1/2*x)^2-2*c*tan(1/2*x)-b)-(-A*b 
^2-A*c^2-B*c^2+C*b*c+(B*b*c-C*b^2)*c/b)/(b^2+c^2)^(1/2)*arctanh(1/2*(2*b*t 
an(1/2*x)-2*c)/(b^2+c^2)^(1/2)))+2/(b^2+c^2)*(1/2*(-B*c+C*b)*ln(1+tan(1/2* 
x)^2)+(B*b+C*c)*arctan(tan(1/2*x)))
 

Fricas [A] (verification not implemented)

Time = 0.09 (sec) , antiderivative size = 155, normalized size of antiderivative = 1.85 \[ \int \frac {A+B \cos (x)+C \sin (x)}{b \cos (x)+c \sin (x)} \, dx=\frac {\sqrt {b^{2} + c^{2}} A \log \left (-\frac {2 \, b c \cos \left (x\right ) \sin \left (x\right ) + {\left (b^{2} - c^{2}\right )} \cos \left (x\right )^{2} - 2 \, b^{2} - c^{2} + 2 \, \sqrt {b^{2} + c^{2}} {\left (c \cos \left (x\right ) - b \sin \left (x\right )\right )}}{2 \, b c \cos \left (x\right ) \sin \left (x\right ) + {\left (b^{2} - c^{2}\right )} \cos \left (x\right )^{2} + c^{2}}\right ) + 2 \, {\left (B b + C c\right )} x - {\left (C b - B c\right )} \log \left (2 \, b c \cos \left (x\right ) \sin \left (x\right ) + {\left (b^{2} - c^{2}\right )} \cos \left (x\right )^{2} + c^{2}\right )}{2 \, {\left (b^{2} + c^{2}\right )}} \] Input:

integrate((A+B*cos(x)+C*sin(x))/(b*cos(x)+c*sin(x)),x, algorithm="fricas")
 

Output:

1/2*(sqrt(b^2 + c^2)*A*log(-(2*b*c*cos(x)*sin(x) + (b^2 - c^2)*cos(x)^2 - 
2*b^2 - c^2 + 2*sqrt(b^2 + c^2)*(c*cos(x) - b*sin(x)))/(2*b*c*cos(x)*sin(x 
) + (b^2 - c^2)*cos(x)^2 + c^2)) + 2*(B*b + C*c)*x - (C*b - B*c)*log(2*b*c 
*cos(x)*sin(x) + (b^2 - c^2)*cos(x)^2 + c^2))/(b^2 + c^2)
 

Sympy [C] (verification not implemented)

Result contains complex when optimal does not.

Time = 12.10 (sec) , antiderivative size = 1030, normalized size of antiderivative = 12.26 \[ \int \frac {A+B \cos (x)+C \sin (x)}{b \cos (x)+c \sin (x)} \, dx=\text {Too large to display} \] Input:

integrate((A+B*cos(x)+C*sin(x))/(b*cos(x)+c*sin(x)),x)
 

Output:

Piecewise((zoo*(A*log(tan(x/2)) - B*log(tan(x/2)**2 + 1) + B*log(tan(x/2)) 
 + C*x), Eq(b, 0) & Eq(c, 0)), ((A*log(tan(x/2)) - B*log(tan(x/2)**2 + 1) 
+ B*log(tan(x/2)) + C*x)/c, Eq(b, 0)), (-2*A/(2*I*c*sin(x) + 2*c*cos(x)) - 
 B*x*sin(x)/(2*I*c*sin(x) + 2*c*cos(x)) + I*B*x*cos(x)/(2*I*c*sin(x) + 2*c 
*cos(x)) - B*cos(x)/(2*I*c*sin(x) + 2*c*cos(x)) + I*C*x*sin(x)/(2*I*c*sin( 
x) + 2*c*cos(x)) + C*x*cos(x)/(2*I*c*sin(x) + 2*c*cos(x)) - I*C*cos(x)/(2* 
I*c*sin(x) + 2*c*cos(x)), Eq(b, -I*c)), (-2*A/(-2*I*c*sin(x) + 2*c*cos(x)) 
 - B*x*sin(x)/(-2*I*c*sin(x) + 2*c*cos(x)) - I*B*x*cos(x)/(-2*I*c*sin(x) + 
 2*c*cos(x)) - B*cos(x)/(-2*I*c*sin(x) + 2*c*cos(x)) - I*C*x*sin(x)/(-2*I* 
c*sin(x) + 2*c*cos(x)) + C*x*cos(x)/(-2*I*c*sin(x) + 2*c*cos(x)) + I*C*cos 
(x)/(-2*I*c*sin(x) + 2*c*cos(x)), Eq(b, I*c)), (-A*b**2*log(tan(x/2) - c/b 
 - sqrt(b**2 + c**2)/b)/(b**2*sqrt(b**2 + c**2) + c**2*sqrt(b**2 + c**2)) 
+ A*b**2*log(tan(x/2) - c/b + sqrt(b**2 + c**2)/b)/(b**2*sqrt(b**2 + c**2) 
 + c**2*sqrt(b**2 + c**2)) - A*c**2*log(tan(x/2) - c/b - sqrt(b**2 + c**2) 
/b)/(b**2*sqrt(b**2 + c**2) + c**2*sqrt(b**2 + c**2)) + A*c**2*log(tan(x/2 
) - c/b + sqrt(b**2 + c**2)/b)/(b**2*sqrt(b**2 + c**2) + c**2*sqrt(b**2 + 
c**2)) + B*b*x*sqrt(b**2 + c**2)/(b**2*sqrt(b**2 + c**2) + c**2*sqrt(b**2 
+ c**2)) - B*c*sqrt(b**2 + c**2)*log(tan(x/2)**2 + 1)/(b**2*sqrt(b**2 + c* 
*2) + c**2*sqrt(b**2 + c**2)) + B*c*sqrt(b**2 + c**2)*log(tan(x/2) - c/b - 
 sqrt(b**2 + c**2)/b)/(b**2*sqrt(b**2 + c**2) + c**2*sqrt(b**2 + c**2))...
 

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 243 vs. \(2 (81) = 162\).

Time = 0.12 (sec) , antiderivative size = 243, normalized size of antiderivative = 2.89 \[ \int \frac {A+B \cos (x)+C \sin (x)}{b \cos (x)+c \sin (x)} \, dx=B {\left (\frac {2 \, b \arctan \left (\frac {\sin \left (x\right )}{\cos \left (x\right ) + 1}\right )}{b^{2} + c^{2}} + \frac {c \log \left (-b - \frac {2 \, c \sin \left (x\right )}{\cos \left (x\right ) + 1} + \frac {b \sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}}\right )}{b^{2} + c^{2}} - \frac {c \log \left (\frac {\sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}} + 1\right )}{b^{2} + c^{2}}\right )} + C {\left (\frac {2 \, c \arctan \left (\frac {\sin \left (x\right )}{\cos \left (x\right ) + 1}\right )}{b^{2} + c^{2}} - \frac {b \log \left (-b - \frac {2 \, c \sin \left (x\right )}{\cos \left (x\right ) + 1} + \frac {b \sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}}\right )}{b^{2} + c^{2}} + \frac {b \log \left (\frac {\sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}} + 1\right )}{b^{2} + c^{2}}\right )} - \frac {A \log \left (\frac {c - \frac {b \sin \left (x\right )}{\cos \left (x\right ) + 1} + \sqrt {b^{2} + c^{2}}}{c - \frac {b \sin \left (x\right )}{\cos \left (x\right ) + 1} - \sqrt {b^{2} + c^{2}}}\right )}{\sqrt {b^{2} + c^{2}}} \] Input:

integrate((A+B*cos(x)+C*sin(x))/(b*cos(x)+c*sin(x)),x, algorithm="maxima")
 

Output:

B*(2*b*arctan(sin(x)/(cos(x) + 1))/(b^2 + c^2) + c*log(-b - 2*c*sin(x)/(co 
s(x) + 1) + b*sin(x)^2/(cos(x) + 1)^2)/(b^2 + c^2) - c*log(sin(x)^2/(cos(x 
) + 1)^2 + 1)/(b^2 + c^2)) + C*(2*c*arctan(sin(x)/(cos(x) + 1))/(b^2 + c^2 
) - b*log(-b - 2*c*sin(x)/(cos(x) + 1) + b*sin(x)^2/(cos(x) + 1)^2)/(b^2 + 
 c^2) + b*log(sin(x)^2/(cos(x) + 1)^2 + 1)/(b^2 + c^2)) - A*log((c - b*sin 
(x)/(cos(x) + 1) + sqrt(b^2 + c^2))/(c - b*sin(x)/(cos(x) + 1) - sqrt(b^2 
+ c^2)))/sqrt(b^2 + c^2)
 

Giac [A] (verification not implemented)

Time = 0.31 (sec) , antiderivative size = 148, normalized size of antiderivative = 1.76 \[ \int \frac {A+B \cos (x)+C \sin (x)}{b \cos (x)+c \sin (x)} \, dx=-\frac {A \log \left (\frac {{\left | 2 \, b \tan \left (\frac {1}{2} \, x\right ) - 2 \, c - 2 \, \sqrt {b^{2} + c^{2}} \right |}}{{\left | 2 \, b \tan \left (\frac {1}{2} \, x\right ) - 2 \, c + 2 \, \sqrt {b^{2} + c^{2}} \right |}}\right )}{\sqrt {b^{2} + c^{2}}} + \frac {{\left (B b + C c\right )} x}{b^{2} + c^{2}} + \frac {{\left (C b - B c\right )} \log \left (\tan \left (\frac {1}{2} \, x\right )^{2} + 1\right )}{b^{2} + c^{2}} - \frac {{\left (C b - B c\right )} \log \left ({\left | b \tan \left (\frac {1}{2} \, x\right )^{2} - 2 \, c \tan \left (\frac {1}{2} \, x\right ) - b \right |}\right )}{b^{2} + c^{2}} \] Input:

integrate((A+B*cos(x)+C*sin(x))/(b*cos(x)+c*sin(x)),x, algorithm="giac")
 

Output:

-A*log(abs(2*b*tan(1/2*x) - 2*c - 2*sqrt(b^2 + c^2))/abs(2*b*tan(1/2*x) - 
2*c + 2*sqrt(b^2 + c^2)))/sqrt(b^2 + c^2) + (B*b + C*c)*x/(b^2 + c^2) + (C 
*b - B*c)*log(tan(1/2*x)^2 + 1)/(b^2 + c^2) - (C*b - B*c)*log(abs(b*tan(1/ 
2*x)^2 - 2*c*tan(1/2*x) - b))/(b^2 + c^2)
 

Mupad [B] (verification not implemented)

Time = 23.23 (sec) , antiderivative size = 1099, normalized size of antiderivative = 13.08 \[ \int \frac {A+B \cos (x)+C \sin (x)}{b \cos (x)+c \sin (x)} \, dx =\text {Too large to display} \] Input:

int((A + B*cos(x) + C*sin(x))/(b*cos(x) + c*sin(x)),x)
 

Output:

log(32*A^2*B*b^2 - 32*A*B^2*b^2 - 32*A*C^2*b^2 - 32*B*C^2*b^2 + 32*b*tan(x 
/2)*(B^3*c - 2*C^3*b - 2*A*B^2*c + A^2*B*c + A^2*C*b - 2*A*C^2*c - B^2*C*b 
 + 2*B*C^2*c) - ((A*((b^2 + c^2)^3)^(1/2) + B*c^3 - C*b^3 + B*b^2*c - C*b* 
c^2)*(32*b*tan(x/2)*(A^2*b^2 - A^2*c^2 + B^2*b^2 - 3*B^2*c^2 + 2*C^2*c^2 + 
 4*A*B*c^2 - 4*A*C*b*c + 6*B*C*b*c) - 32*B^2*b^2*c - 32*C^2*b^2*c - 64*A^2 
*b^2*c - 64*A*C*b^3 + 64*B*C*b^3 + ((A*((b^2 + c^2)^3)^(1/2) + B*c^3 - C*b 
^3 + B*b^2*c - C*b*c^2)*(32*A*b^4 + 32*B*b^4 + 32*A*b^2*c^2 - 64*B*b^2*c^2 
 - 32*C*b*c^3 + 64*C*b^3*c + 32*b*tan(x/2)*(2*A*c^3 + B*c^3 - 2*C*b^3 + 2* 
A*b^2*c + 4*B*b^2*c + C*b*c^2) + (96*b*c*(b + c*tan(x/2))*(A*((b^2 + c^2)^ 
3)^(1/2) + B*c^3 - C*b^3 + B*b^2*c - C*b*c^2))/(b^2 + c^2)))/(b^2 + c^2)^2 
 + 64*A*B*b^2*c + 64*B*C*b*c^2))/(b^2 + c^2)^2 - 32*A^2*C*b*c + 32*B^2*C*b 
*c)*((B*c - C*b)/(b^2 + c^2) + (A*((b^2 + c^2)^3)^(1/2))/(b^2 + c^2)^2) + 
log(32*A^2*B*b^2 - 32*A*B^2*b^2 - 32*A*C^2*b^2 - 32*B*C^2*b^2 + 32*b*tan(x 
/2)*(B^3*c - 2*C^3*b - 2*A*B^2*c + A^2*B*c + A^2*C*b - 2*A*C^2*c - B^2*C*b 
 + 2*B*C^2*c) - ((A*((b^2 + c^2)^3)^(1/2) - B*c^3 + C*b^3 - B*b^2*c + C*b* 
c^2)*(64*A^2*b^2*c + 32*B^2*b^2*c + 32*C^2*b^2*c - 32*b*tan(x/2)*(A^2*b^2 
- A^2*c^2 + B^2*b^2 - 3*B^2*c^2 + 2*C^2*c^2 + 4*A*B*c^2 - 4*A*C*b*c + 6*B* 
C*b*c) + 64*A*C*b^3 - 64*B*C*b^3 + ((A*((b^2 + c^2)^3)^(1/2) - B*c^3 + C*b 
^3 - B*b^2*c + C*b*c^2)*(32*A*b^4 + 32*B*b^4 + 32*A*b^2*c^2 - 64*B*b^2*c^2 
 - 32*C*b*c^3 + 64*C*b^3*c + 32*b*tan(x/2)*(2*A*c^3 + B*c^3 - 2*C*b^3 +...
 

Reduce [B] (verification not implemented)

Time = 0.15 (sec) , antiderivative size = 57, normalized size of antiderivative = 0.68 \[ \int \frac {A+B \cos (x)+C \sin (x)}{b \cos (x)+c \sin (x)} \, dx=\frac {-2 \sqrt {b^{2}+c^{2}}\, \mathit {atan} \left (\frac {\tan \left (\frac {x}{2}\right ) b i -c i}{\sqrt {b^{2}+c^{2}}}\right ) a i +b^{2} x +c^{2} x}{b^{2}+c^{2}} \] Input:

int((A+B*cos(x)+C*sin(x))/(b*cos(x)+c*sin(x)),x)
 

Output:

( - 2*sqrt(b**2 + c**2)*atan((tan(x/2)*b*i - c*i)/sqrt(b**2 + c**2))*a*i + 
 b**2*x + c**2*x)/(b**2 + c**2)