Integrand size = 32, antiderivative size = 76 \[ \int \frac {\tan (c+d x) (A+B \tan (c+d x))}{(a+i a \tan (c+d x))^2} \, dx=-\frac {(i A+B) x}{4 a^2}+\frac {A+3 i B}{4 a^2 d (1+i \tan (c+d x))}-\frac {A+i B}{4 d (a+i a \tan (c+d x))^2} \] Output:
-1/4*(I*A+B)*x/a^2+1/4*(A+3*I*B)/a^2/d/(1+I*tan(d*x+c))-1/4*(A+I*B)/d/(a+I *a*tan(d*x+c))^2
Time = 0.43 (sec) , antiderivative size = 92, normalized size of antiderivative = 1.21 \[ \int \frac {\tan (c+d x) (A+B \tan (c+d x))}{(a+i a \tan (c+d x))^2} \, dx=\frac {\sec ^2(c+d x) (-4 i B+(A+4 i A d x+B (i+4 d x)) \cos (2 (c+d x))+(-i A+B-4 A d x+4 i B d x) \sin (2 (c+d x)))}{16 a^2 d (-i+\tan (c+d x))^2} \] Input:
Integrate[(Tan[c + d*x]*(A + B*Tan[c + d*x]))/(a + I*a*Tan[c + d*x])^2,x]
Output:
(Sec[c + d*x]^2*((-4*I)*B + (A + (4*I)*A*d*x + B*(I + 4*d*x))*Cos[2*(c + d *x)] + ((-I)*A + B - 4*A*d*x + (4*I)*B*d*x)*Sin[2*(c + d*x)]))/(16*a^2*d*( -I + Tan[c + d*x])^2)
Time = 0.39 (sec) , antiderivative size = 82, normalized size of antiderivative = 1.08, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.156, Rules used = {3042, 4073, 3042, 4009, 24}
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 {\tan (c+d x) (A+B \tan (c+d x))}{(a+i a \tan (c+d x))^2} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\tan (c+d x) (A+B \tan (c+d x))}{(a+i a \tan (c+d x))^2}dx\) |
\(\Big \downarrow \) 4073 |
\(\displaystyle -\frac {i \int \frac {a (A+i B)+2 a B \tan (c+d x)}{i \tan (c+d x) a+a}dx}{2 a^2}-\frac {A+i B}{4 d (a+i a \tan (c+d x))^2}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle -\frac {i \int \frac {a (A+i B)+2 a B \tan (c+d x)}{i \tan (c+d x) a+a}dx}{2 a^2}-\frac {A+i B}{4 d (a+i a \tan (c+d x))^2}\) |
\(\Big \downarrow \) 4009 |
\(\displaystyle -\frac {i \left (\frac {1}{2} (A-i B) \int 1dx+\frac {-3 B+i A}{2 d (1+i \tan (c+d x))}\right )}{2 a^2}-\frac {A+i B}{4 d (a+i a \tan (c+d x))^2}\) |
\(\Big \downarrow \) 24 |
\(\displaystyle -\frac {i \left (\frac {-3 B+i A}{2 d (1+i \tan (c+d x))}+\frac {1}{2} x (A-i B)\right )}{2 a^2}-\frac {A+i B}{4 d (a+i a \tan (c+d x))^2}\) |
Input:
Int[(Tan[c + d*x]*(A + B*Tan[c + d*x]))/(a + I*a*Tan[c + d*x])^2,x]
Output:
((-1/2*I)*(((A - I*B)*x)/2 + (I*A - 3*B)/(2*d*(1 + I*Tan[c + d*x]))))/a^2 - (A + I*B)/(4*d*(a + I*a*Tan[c + d*x])^2)
Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(-(b*c - a*d))*((a + b*Tan[e + f*x])^m/(2*a *f*m)), x] + Simp[(b*c + a*d)/(2*a*b) Int[(a + b*Tan[e + f*x])^(m + 1), x ], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 + b^2 , 0] && LtQ[m, 0]
Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(-( A*b - a*B))*(a*c + b*d)*((a + b*Tan[e + f*x])^m/(2*a^2*f*m)), x] + Simp[1/( 2*a*b) Int[(a + b*Tan[e + f*x])^(m + 1)*Simp[A*b*c + a*B*c + a*A*d + b*B* d + 2*a*B*d*Tan[e + f*x], x], x], x] /; FreeQ[{a, b, c, d, e, f, A, B}, x] && NeQ[b*c - a*d, 0] && LtQ[m, -1] && EqQ[a^2 + b^2, 0]
Time = 0.21 (sec) , antiderivative size = 73, normalized size of antiderivative = 0.96
method | result | size |
risch | \(-\frac {x B}{4 a^{2}}-\frac {i x A}{4 a^{2}}+\frac {i {\mathrm e}^{-2 i \left (d x +c \right )} B}{4 a^{2} d}-\frac {i {\mathrm e}^{-4 i \left (d x +c \right )} B}{16 a^{2} d}-\frac {{\mathrm e}^{-4 i \left (d x +c \right )} A}{16 a^{2} d}\) | \(73\) |
derivativedivides | \(-\frac {i A \arctan \left (\tan \left (d x +c \right )\right )}{4 d \,a^{2}}-\frac {B \arctan \left (\tan \left (d x +c \right )\right )}{4 d \,a^{2}}+\frac {A}{4 d \,a^{2} \left (-i+\tan \left (d x +c \right )\right )^{2}}+\frac {i B}{4 d \,a^{2} \left (-i+\tan \left (d x +c \right )\right )^{2}}-\frac {i A}{4 d \,a^{2} \left (-i+\tan \left (d x +c \right )\right )}+\frac {3 B}{4 d \,a^{2} \left (-i+\tan \left (d x +c \right )\right )}\) | \(117\) |
default | \(-\frac {i A \arctan \left (\tan \left (d x +c \right )\right )}{4 d \,a^{2}}-\frac {B \arctan \left (\tan \left (d x +c \right )\right )}{4 d \,a^{2}}+\frac {A}{4 d \,a^{2} \left (-i+\tan \left (d x +c \right )\right )^{2}}+\frac {i B}{4 d \,a^{2} \left (-i+\tan \left (d x +c \right )\right )^{2}}-\frac {i A}{4 d \,a^{2} \left (-i+\tan \left (d x +c \right )\right )}+\frac {3 B}{4 d \,a^{2} \left (-i+\tan \left (d x +c \right )\right )}\) | \(117\) |
Input:
int(tan(d*x+c)*(A+B*tan(d*x+c))/(a+I*a*tan(d*x+c))^2,x,method=_RETURNVERBO SE)
Output:
-1/4*x/a^2*B-1/4*I*x/a^2*A+1/4*I*B/a^2/d*exp(-2*I*(d*x+c))-1/16*I/a^2/d*ex p(-4*I*(d*x+c))*B-1/16/a^2/d*exp(-4*I*(d*x+c))*A
Time = 0.08 (sec) , antiderivative size = 52, normalized size of antiderivative = 0.68 \[ \int \frac {\tan (c+d x) (A+B \tan (c+d x))}{(a+i a \tan (c+d x))^2} \, dx=-\frac {{\left (4 \, {\left (i \, A + B\right )} d x e^{\left (4 i \, d x + 4 i \, c\right )} - 4 i \, B e^{\left (2 i \, d x + 2 i \, c\right )} + A + i \, B\right )} e^{\left (-4 i \, d x - 4 i \, c\right )}}{16 \, a^{2} d} \] Input:
integrate(tan(d*x+c)*(A+B*tan(d*x+c))/(a+I*a*tan(d*x+c))^2,x, algorithm="f ricas")
Output:
-1/16*(4*(I*A + B)*d*x*e^(4*I*d*x + 4*I*c) - 4*I*B*e^(2*I*d*x + 2*I*c) + A + I*B)*e^(-4*I*d*x - 4*I*c)/(a^2*d)
Time = 0.21 (sec) , antiderivative size = 167, normalized size of antiderivative = 2.20 \[ \int \frac {\tan (c+d x) (A+B \tan (c+d x))}{(a+i a \tan (c+d x))^2} \, dx=\begin {cases} \frac {\left (16 i B a^{2} d e^{4 i c} e^{- 2 i d x} + \left (- 4 A a^{2} d e^{2 i c} - 4 i B a^{2} d e^{2 i c}\right ) e^{- 4 i d x}\right ) e^{- 6 i c}}{64 a^{4} d^{2}} & \text {for}\: a^{4} d^{2} e^{6 i c} \neq 0 \\x \left (- \frac {- i A - B}{4 a^{2}} + \frac {\left (- i A e^{4 i c} + i A - B e^{4 i c} + 2 B e^{2 i c} - B\right ) e^{- 4 i c}}{4 a^{2}}\right ) & \text {otherwise} \end {cases} + \frac {x \left (- i A - B\right )}{4 a^{2}} \] Input:
integrate(tan(d*x+c)*(A+B*tan(d*x+c))/(a+I*a*tan(d*x+c))**2,x)
Output:
Piecewise(((16*I*B*a**2*d*exp(4*I*c)*exp(-2*I*d*x) + (-4*A*a**2*d*exp(2*I* c) - 4*I*B*a**2*d*exp(2*I*c))*exp(-4*I*d*x))*exp(-6*I*c)/(64*a**4*d**2), N e(a**4*d**2*exp(6*I*c), 0)), (x*(-(-I*A - B)/(4*a**2) + (-I*A*exp(4*I*c) + I*A - B*exp(4*I*c) + 2*B*exp(2*I*c) - B)*exp(-4*I*c)/(4*a**2)), True)) + x*(-I*A - B)/(4*a**2)
Exception generated. \[ \int \frac {\tan (c+d x) (A+B \tan (c+d x))}{(a+i a \tan (c+d x))^2} \, dx=\text {Exception raised: RuntimeError} \] Input:
integrate(tan(d*x+c)*(A+B*tan(d*x+c))/(a+I*a*tan(d*x+c))^2,x, algorithm="m axima")
Output:
Exception raised: RuntimeError >> ECL says: expt: undefined: 0 to a negati ve exponent.
Time = 0.44 (sec) , antiderivative size = 80, normalized size of antiderivative = 1.05 \[ \int \frac {\tan (c+d x) (A+B \tan (c+d x))}{(a+i a \tan (c+d x))^2} \, dx=\frac {{\left (A - i \, B\right )} \log \left (\tan \left (d x + c\right ) + i\right )}{8 \, a^{2} d} - \frac {{\left (A - i \, B\right )} \log \left (\tan \left (d x + c\right ) - i\right )}{8 \, a^{2} d} - \frac {i \, {\left (A + 3 i \, B\right )} \tan \left (d x + c\right ) + 2 i \, B}{4 \, a^{2} d {\left (\tan \left (d x + c\right ) - i\right )}^{2}} \] Input:
integrate(tan(d*x+c)*(A+B*tan(d*x+c))/(a+I*a*tan(d*x+c))^2,x, algorithm="g iac")
Output:
1/8*(A - I*B)*log(tan(d*x + c) + I)/(a^2*d) - 1/8*(A - I*B)*log(tan(d*x + c) - I)/(a^2*d) - 1/4*(I*(A + 3*I*B)*tan(d*x + c) + 2*I*B)/(a^2*d*(tan(d*x + c) - I)^2)
Time = 3.22 (sec) , antiderivative size = 106, normalized size of antiderivative = 1.39 \[ \int \frac {\tan (c+d x) (A+B \tan (c+d x))}{(a+i a \tan (c+d x))^2} \, dx=\frac {\frac {B}{2\,a^2}+\mathrm {tan}\left (c+d\,x\right )\,\left (\frac {A}{4\,a^2}+\frac {B\,3{}\mathrm {i}}{4\,a^2}\right )}{d\,\left ({\mathrm {tan}\left (c+d\,x\right )}^2\,1{}\mathrm {i}+2\,\mathrm {tan}\left (c+d\,x\right )-\mathrm {i}\right )}+\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )-\mathrm {i}\right )\,\left (B+A\,1{}\mathrm {i}\right )\,1{}\mathrm {i}}{8\,a^2\,d}+\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )+1{}\mathrm {i}\right )\,\left (A-B\,1{}\mathrm {i}\right )}{8\,a^2\,d} \] Input:
int((tan(c + d*x)*(A + B*tan(c + d*x)))/(a + a*tan(c + d*x)*1i)^2,x)
Output:
(B/(2*a^2) + tan(c + d*x)*(A/(4*a^2) + (B*3i)/(4*a^2)))/(d*(2*tan(c + d*x) + tan(c + d*x)^2*1i - 1i)) + (log(tan(c + d*x) - 1i)*(A*1i + B)*1i)/(8*a^ 2*d) + (log(tan(c + d*x) + 1i)*(A - B*1i))/(8*a^2*d)
\[ \int \frac {\tan (c+d x) (A+B \tan (c+d x))}{(a+i a \tan (c+d x))^2} \, dx=\frac {-\left (\int \frac {\tan \left (d x +c \right )^{2}}{\tan \left (d x +c \right )^{2}-2 \tan \left (d x +c \right ) i -1}d x \right ) b -\left (\int \frac {\tan \left (d x +c \right )}{\tan \left (d x +c \right )^{2}-2 \tan \left (d x +c \right ) i -1}d x \right ) a}{a^{2}} \] Input:
int(tan(d*x+c)*(A+B*tan(d*x+c))/(a+I*a*tan(d*x+c))^2,x)
Output:
( - (int(tan(c + d*x)**2/(tan(c + d*x)**2 - 2*tan(c + d*x)*i - 1),x)*b + i nt(tan(c + d*x)/(tan(c + d*x)**2 - 2*tan(c + d*x)*i - 1),x)*a))/a**2