Integrand size = 32, antiderivative size = 85 \[ \int \frac {B \tan (c+d x)+C \tan ^2(c+d x)}{a+b \tan (c+d x)} \, dx=\frac {(b B-a C) x}{a^2+b^2}-\frac {(a B+b C) \log (\cos (c+d x))}{\left (a^2+b^2\right ) d}-\frac {a (b B-a C) \log (a+b \tan (c+d x))}{b \left (a^2+b^2\right ) d} \] Output:
(B*b-C*a)*x/(a^2+b^2)-(B*a+C*b)*ln(cos(d*x+c))/(a^2+b^2)/d-a*(B*b-C*a)*ln( a+b*tan(d*x+c))/b/(a^2+b^2)/d
Result contains complex when optimal does not.
Time = 0.13 (sec) , antiderivative size = 98, normalized size of antiderivative = 1.15 \[ \int \frac {B \tan (c+d x)+C \tan ^2(c+d x)}{a+b \tan (c+d x)} \, dx=\frac {(a-i b) b (B+i C) \log (i-\tan (c+d x))+(a+i b) b (B-i C) \log (i+\tan (c+d x))+2 a (-b B+a C) \log (a+b \tan (c+d x))}{2 b \left (a^2+b^2\right ) d} \] Input:
Integrate[(B*Tan[c + d*x] + C*Tan[c + d*x]^2)/(a + b*Tan[c + d*x]),x]
Output:
((a - I*b)*b*(B + I*C)*Log[I - Tan[c + d*x]] + (a + I*b)*b*(B - I*C)*Log[I + Tan[c + d*x]] + 2*a*(-(b*B) + a*C)*Log[a + b*Tan[c + d*x]])/(2*b*(a^2 + b^2)*d)
Time = 0.63 (sec) , antiderivative size = 95, normalized size of antiderivative = 1.12, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.125, Rules used = {3042, 4853, 2160, 2009}
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 {B \tan (c+d x)+C \tan ^2(c+d x)}{a+b \tan (c+d x)} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {B \tan (c+d x)+C \tan (c+d x)^2}{a+b \tan (c+d x)}dx\) |
\(\Big \downarrow \) 4853 |
\(\displaystyle \frac {\int \frac {\tan (c+d x) (B+C \tan (c+d x))}{(a+b \tan (c+d x)) \left (\tan ^2(c+d x)+1\right )}d\tan (c+d x)}{d}\) |
\(\Big \downarrow \) 2160 |
\(\displaystyle \frac {\int \left (\frac {a (a C-b B)}{\left (a^2+b^2\right ) (a+b \tan (c+d x))}+\frac {b B-a C+(a B+b C) \tan (c+d x)}{\left (a^2+b^2\right ) \left (\tan ^2(c+d x)+1\right )}\right )d\tan (c+d x)}{d}\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {\frac {(b B-a C) \arctan (\tan (c+d x))}{a^2+b^2}+\frac {(a B+b C) \log \left (\tan ^2(c+d x)+1\right )}{2 \left (a^2+b^2\right )}-\frac {a (b B-a C) \log (a+b \tan (c+d x))}{b \left (a^2+b^2\right )}}{d}\) |
Input:
Int[(B*Tan[c + d*x] + C*Tan[c + d*x]^2)/(a + b*Tan[c + d*x]),x]
Output:
(((b*B - a*C)*ArcTan[Tan[c + d*x]])/(a^2 + b^2) - (a*(b*B - a*C)*Log[a + b *Tan[c + d*x]])/(b*(a^2 + b^2)) + ((a*B + b*C)*Log[1 + Tan[c + d*x]^2])/(2 *(a^2 + b^2)))/d
Int[(Pq_)*((d_) + (e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegrand[(d + e*x)^m*Pq*(a + b*x^2)^p, x], x] /; FreeQ[{a, b, d, e, m}, x] && PolyQ[Pq, x] && IGtQ[p, -2]
Int[u_, x_Symbol] :> With[{v = FunctionOfTrig[u, x]}, Simp[With[{d = FreeFa ctors[Tan[v], x]}, d/Coefficient[v, x, 1] Subst[Int[SubstFor[1/(1 + d^2*x ^2), Tan[v]/d, u, x], x], x, Tan[v]/d]], x] /; !FalseQ[v] && FunctionOfQ[N onfreeFactors[Tan[v], x], u, x, True] && TryPureTanSubst[ActivateTrig[u], x ]]
Time = 0.09 (sec) , antiderivative size = 87, normalized size of antiderivative = 1.02
method | result | size |
derivativedivides | \(\frac {-\frac {a \left (B b -C a \right ) \ln \left (a +b \tan \left (d x +c \right )\right )}{\left (a^{2}+b^{2}\right ) b}+\frac {\frac {\left (B a +C b \right ) \ln \left (1+\tan \left (d x +c \right )^{2}\right )}{2}+\left (B b -C a \right ) \arctan \left (\tan \left (d x +c \right )\right )}{a^{2}+b^{2}}}{d}\) | \(87\) |
default | \(\frac {-\frac {a \left (B b -C a \right ) \ln \left (a +b \tan \left (d x +c \right )\right )}{\left (a^{2}+b^{2}\right ) b}+\frac {\frac {\left (B a +C b \right ) \ln \left (1+\tan \left (d x +c \right )^{2}\right )}{2}+\left (B b -C a \right ) \arctan \left (\tan \left (d x +c \right )\right )}{a^{2}+b^{2}}}{d}\) | \(87\) |
norman | \(\frac {\left (B b -C a \right ) x}{a^{2}+b^{2}}+\frac {\left (B a +C b \right ) \ln \left (1+\tan \left (d x +c \right )^{2}\right )}{2 d \left (a^{2}+b^{2}\right )}-\frac {a \left (B b -C a \right ) \ln \left (a +b \tan \left (d x +c \right )\right )}{b \left (a^{2}+b^{2}\right ) d}\) | \(90\) |
parallelrisch | \(\frac {2 B \,b^{2} d x -2 C a b d x +B \ln \left (1+\tan \left (d x +c \right )^{2}\right ) a b -2 B \ln \left (a +b \tan \left (d x +c \right )\right ) a b +C \ln \left (1+\tan \left (d x +c \right )^{2}\right ) b^{2}+2 C \ln \left (a +b \tan \left (d x +c \right )\right ) a^{2}}{2 \left (a^{2}+b^{2}\right ) d b}\) | \(98\) |
risch | \(\frac {i x B}{i b -a}+\frac {x C}{i b -a}+\frac {2 i C x}{b}+\frac {2 i C c}{d b}+\frac {2 i a B x}{a^{2}+b^{2}}+\frac {2 i a B c}{\left (a^{2}+b^{2}\right ) d}-\frac {2 i a^{2} C x}{\left (a^{2}+b^{2}\right ) b}-\frac {2 i a^{2} C c}{\left (a^{2}+b^{2}\right ) d b}-\frac {\ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right ) C}{b d}-\frac {a \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-\frac {i b +a}{i b -a}\right ) B}{\left (a^{2}+b^{2}\right ) d}+\frac {a^{2} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-\frac {i b +a}{i b -a}\right ) C}{\left (a^{2}+b^{2}\right ) d b}\) | \(240\) |
Input:
int((B*tan(d*x+c)+C*tan(d*x+c)^2)/(a+b*tan(d*x+c)),x,method=_RETURNVERBOSE )
Output:
1/d*(-a*(B*b-C*a)/(a^2+b^2)/b*ln(a+b*tan(d*x+c))+1/(a^2+b^2)*(1/2*(B*a+C*b )*ln(1+tan(d*x+c)^2)+(B*b-C*a)*arctan(tan(d*x+c))))
Time = 0.10 (sec) , antiderivative size = 110, normalized size of antiderivative = 1.29 \[ \int \frac {B \tan (c+d x)+C \tan ^2(c+d x)}{a+b \tan (c+d x)} \, dx=-\frac {2 \, {\left (C a b - B b^{2}\right )} d x - {\left (C a^{2} - B a b\right )} \log \left (\frac {b^{2} \tan \left (d x + c\right )^{2} + 2 \, a b \tan \left (d x + c\right ) + a^{2}}{\tan \left (d x + c\right )^{2} + 1}\right ) + {\left (C a^{2} + C b^{2}\right )} \log \left (\frac {1}{\tan \left (d x + c\right )^{2} + 1}\right )}{2 \, {\left (a^{2} b + b^{3}\right )} d} \] Input:
integrate((B*tan(d*x+c)+C*tan(d*x+c)^2)/(a+b*tan(d*x+c)),x, algorithm="fri cas")
Output:
-1/2*(2*(C*a*b - B*b^2)*d*x - (C*a^2 - B*a*b)*log((b^2*tan(d*x + c)^2 + 2* a*b*tan(d*x + c) + a^2)/(tan(d*x + c)^2 + 1)) + (C*a^2 + C*b^2)*log(1/(tan (d*x + c)^2 + 1)))/((a^2*b + b^3)*d)
Result contains complex when optimal does not.
Time = 0.52 (sec) , antiderivative size = 711, normalized size of antiderivative = 8.36 \[ \int \frac {B \tan (c+d x)+C \tan ^2(c+d x)}{a+b \tan (c+d x)} \, dx =\text {Too large to display} \] Input:
integrate((B*tan(d*x+c)+C*tan(d*x+c)**2)/(a+b*tan(d*x+c)),x)
Output:
Piecewise((zoo*x*(B*tan(c) + C*tan(c)**2)/tan(c), Eq(a, 0) & Eq(b, 0) & Eq (d, 0)), ((B*log(tan(c + d*x)**2 + 1)/(2*d) - C*x + C*tan(c + d*x)/d)/a, E q(b, 0)), (B*d*x*tan(c + d*x)/(2*b*d*tan(c + d*x) - 2*I*b*d) - I*B*d*x/(2* b*d*tan(c + d*x) - 2*I*b*d) - B/(2*b*d*tan(c + d*x) - 2*I*b*d) + I*C*d*x*t an(c + d*x)/(2*b*d*tan(c + d*x) - 2*I*b*d) + C*d*x/(2*b*d*tan(c + d*x) - 2 *I*b*d) + C*log(tan(c + d*x)**2 + 1)*tan(c + d*x)/(2*b*d*tan(c + d*x) - 2* I*b*d) - I*C*log(tan(c + d*x)**2 + 1)/(2*b*d*tan(c + d*x) - 2*I*b*d) - I*C /(2*b*d*tan(c + d*x) - 2*I*b*d), Eq(a, -I*b)), (B*d*x*tan(c + d*x)/(2*b*d* tan(c + d*x) + 2*I*b*d) + I*B*d*x/(2*b*d*tan(c + d*x) + 2*I*b*d) - B/(2*b* d*tan(c + d*x) + 2*I*b*d) - I*C*d*x*tan(c + d*x)/(2*b*d*tan(c + d*x) + 2*I *b*d) + C*d*x/(2*b*d*tan(c + d*x) + 2*I*b*d) + C*log(tan(c + d*x)**2 + 1)* tan(c + d*x)/(2*b*d*tan(c + d*x) + 2*I*b*d) + I*C*log(tan(c + d*x)**2 + 1) /(2*b*d*tan(c + d*x) + 2*I*b*d) + I*C/(2*b*d*tan(c + d*x) + 2*I*b*d), Eq(a , I*b)), (x*(B*tan(c) + C*tan(c)**2)/(a + b*tan(c)), Eq(d, 0)), (-2*B*a*b* log(a/b + tan(c + d*x))/(2*a**2*b*d + 2*b**3*d) + B*a*b*log(tan(c + d*x)** 2 + 1)/(2*a**2*b*d + 2*b**3*d) + 2*B*b**2*d*x/(2*a**2*b*d + 2*b**3*d) + 2* C*a**2*log(a/b + tan(c + d*x))/(2*a**2*b*d + 2*b**3*d) - 2*C*a*b*d*x/(2*a* *2*b*d + 2*b**3*d) + C*b**2*log(tan(c + d*x)**2 + 1)/(2*a**2*b*d + 2*b**3* d), True))
Time = 0.11 (sec) , antiderivative size = 94, normalized size of antiderivative = 1.11 \[ \int \frac {B \tan (c+d x)+C \tan ^2(c+d x)}{a+b \tan (c+d x)} \, dx=-\frac {\frac {2 \, {\left (C a - B b\right )} {\left (d x + c\right )}}{a^{2} + b^{2}} - \frac {2 \, {\left (C a^{2} - B a b\right )} \log \left (b \tan \left (d x + c\right ) + a\right )}{a^{2} b + b^{3}} - \frac {{\left (B a + C b\right )} \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{a^{2} + b^{2}}}{2 \, d} \] Input:
integrate((B*tan(d*x+c)+C*tan(d*x+c)^2)/(a+b*tan(d*x+c)),x, algorithm="max ima")
Output:
-1/2*(2*(C*a - B*b)*(d*x + c)/(a^2 + b^2) - 2*(C*a^2 - B*a*b)*log(b*tan(d* x + c) + a)/(a^2*b + b^3) - (B*a + C*b)*log(tan(d*x + c)^2 + 1)/(a^2 + b^2 ))/d
Time = 0.42 (sec) , antiderivative size = 100, normalized size of antiderivative = 1.18 \[ \int \frac {B \tan (c+d x)+C \tan ^2(c+d x)}{a+b \tan (c+d x)} \, dx=-\frac {{\left (C a - B b\right )} {\left (d x + c\right )}}{a^{2} d + b^{2} d} + \frac {{\left (B a + C b\right )} \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{2 \, {\left (a^{2} d + b^{2} d\right )}} + \frac {{\left (C a^{2} - B a b\right )} \log \left ({\left | b \tan \left (d x + c\right ) + a \right |}\right )}{a^{2} b d + b^{3} d} \] Input:
integrate((B*tan(d*x+c)+C*tan(d*x+c)^2)/(a+b*tan(d*x+c)),x, algorithm="gia c")
Output:
-(C*a - B*b)*(d*x + c)/(a^2*d + b^2*d) + 1/2*(B*a + C*b)*log(tan(d*x + c)^ 2 + 1)/(a^2*d + b^2*d) + (C*a^2 - B*a*b)*log(abs(b*tan(d*x + c) + a))/(a^2 *b*d + b^3*d)
Time = 5.69 (sec) , antiderivative size = 100, normalized size of antiderivative = 1.18 \[ \int \frac {B \tan (c+d x)+C \tan ^2(c+d x)}{a+b \tan (c+d x)} \, dx=\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )-\mathrm {i}\right )\,\left (-C+B\,1{}\mathrm {i}\right )}{2\,d\,\left (-b+a\,1{}\mathrm {i}\right )}+\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )+1{}\mathrm {i}\right )\,\left (B-C\,1{}\mathrm {i}\right )}{2\,d\,\left (a-b\,1{}\mathrm {i}\right )}-\frac {a\,\ln \left (a+b\,\mathrm {tan}\left (c+d\,x\right )\right )\,\left (B\,b-C\,a\right )}{b\,d\,\left (a^2+b^2\right )} \] Input:
int((B*tan(c + d*x) + C*tan(c + d*x)^2)/(a + b*tan(c + d*x)),x)
Output:
(log(tan(c + d*x) - 1i)*(B*1i - C))/(2*d*(a*1i - b)) + (log(tan(c + d*x) + 1i)*(B - C*1i))/(2*d*(a - b*1i)) - (a*log(a + b*tan(c + d*x))*(B*b - C*a) )/(b*d*(a^2 + b^2))
Time = 0.18 (sec) , antiderivative size = 98, normalized size of antiderivative = 1.15 \[ \int \frac {B \tan (c+d x)+C \tan ^2(c+d x)}{a+b \tan (c+d x)} \, dx=\frac {\mathrm {log}\left (\tan \left (d x +c \right )^{2}+1\right ) a \,b^{2}+\mathrm {log}\left (\tan \left (d x +c \right )^{2}+1\right ) b^{2} c +2 \,\mathrm {log}\left (a +\tan \left (d x +c \right ) b \right ) a^{2} c -2 \,\mathrm {log}\left (a +\tan \left (d x +c \right ) b \right ) a \,b^{2}-2 a b c d x +2 b^{3} d x}{2 b d \left (a^{2}+b^{2}\right )} \] Input:
int((B*tan(d*x+c)+C*tan(d*x+c)^2)/(a+b*tan(d*x+c)),x)
Output:
(log(tan(c + d*x)**2 + 1)*a*b**2 + log(tan(c + d*x)**2 + 1)*b**2*c + 2*log (tan(c + d*x)*b + a)*a**2*c - 2*log(tan(c + d*x)*b + a)*a*b**2 - 2*a*b*c*d *x + 2*b**3*d*x)/(2*b*d*(a**2 + b**2))