Integrand size = 28, antiderivative size = 75 \[ \int \frac {(c+d \tan (e+f x))^2}{a+i a \tan (e+f x)} \, dx=\frac {\left (c^2-2 i c d+d^2\right ) x}{2 a}+\frac {i d^2 \log (\cos (e+f x))}{a f}+\frac {i (c+i d)^2}{2 f (a+i a \tan (e+f x))} \] Output:
1/2*(c^2-2*I*c*d+d^2)*x/a+I*d^2*ln(cos(f*x+e))/a/f+1/2*I*(c+I*d)^2/f/(a+I* a*tan(f*x+e))
Time = 1.01 (sec) , antiderivative size = 143, normalized size of antiderivative = 1.91 \[ \int \frac {(c+d \tan (e+f x))^2}{a+i a \tan (e+f x)} \, dx=-\frac {i \left ((c+i d) \left (\left (c^2-2 i c d+3 d^2\right ) \log (i-\tan (e+f x))-(c-i d)^2 \log (i+\tan (e+f x))\right )+2 d^2 (-3 i c+d) \tan (e+f x)-2 i d^3 \tan ^2(e+f x)+\frac {2 i (c+d \tan (e+f x))^3}{-i+\tan (e+f x)}\right )}{4 a (c+i d) f} \] Input:
Integrate[(c + d*Tan[e + f*x])^2/(a + I*a*Tan[e + f*x]),x]
Output:
((-1/4*I)*((c + I*d)*((c^2 - (2*I)*c*d + 3*d^2)*Log[I - Tan[e + f*x]] - (c - I*d)^2*Log[I + Tan[e + f*x]]) + 2*d^2*((-3*I)*c + d)*Tan[e + f*x] - (2* I)*d^3*Tan[e + f*x]^2 + ((2*I)*(c + d*Tan[e + f*x])^3)/(-I + Tan[e + f*x]) ))/(a*(c + I*d)*f)
Time = 0.30 (sec) , antiderivative size = 76, normalized size of antiderivative = 1.01, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.107, Rules used = {3042, 4023, 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 {(c+d \tan (e+f x))^2}{a+i a \tan (e+f x)} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {(c+d \tan (e+f x))^2}{a+i a \tan (e+f x)}dx\) |
\(\Big \downarrow \) 4023 |
\(\displaystyle \frac {\int \left (a \left (c^2-2 i d c+d^2\right )-2 i a d^2 \tan (e+f x)\right )dx}{2 a^2}+\frac {i (c+i d)^2}{2 f (a+i a \tan (e+f x))}\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {a x \left (c^2-2 i c d+d^2\right )+\frac {2 i a d^2 \log (\cos (e+f x))}{f}}{2 a^2}+\frac {i (c+i d)^2}{2 f (a+i a \tan (e+f x))}\) |
Input:
Int[(c + d*Tan[e + f*x])^2/(a + I*a*Tan[e + f*x]),x]
Output:
(a*(c^2 - (2*I)*c*d + d^2)*x + ((2*I)*a*d^2*Log[Cos[e + f*x]])/f)/(2*a^2) + ((I/2)*(c + I*d)^2)/(f*(a + I*a*Tan[e + f*x]))
Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^2, x_Symbol] :> Simp[(-b)*(a*c + b*d)^2*((a + b*Tan[e + f*x])^ m/(2*a^3*f*m)), x] + Simp[1/(2*a^2) Int[(a + b*Tan[e + f*x])^(m + 1)*Simp [a*c^2 - 2*b*c*d + a*d^2 - 2*b*d^2*Tan[e + f*x], x], x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && LeQ[m, -1] && EqQ[a^2 + b^2, 0]
Time = 0.22 (sec) , antiderivative size = 126, normalized size of antiderivative = 1.68
method | result | size |
risch | \(-\frac {i x c d}{a}+\frac {c^{2} x}{2 a}+\frac {3 x \,d^{2}}{2 a}-\frac {{\mathrm e}^{-2 i \left (f x +e \right )} c d}{2 a f}+\frac {i {\mathrm e}^{-2 i \left (f x +e \right )} c^{2}}{4 a f}-\frac {i {\mathrm e}^{-2 i \left (f x +e \right )} d^{2}}{4 a f}+\frac {2 d^{2} e}{a f}+\frac {i d^{2} \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )}{a f}\) | \(126\) |
derivativedivides | \(-\frac {i \ln \left (1+\tan \left (f x +e \right )^{2}\right ) d^{2}}{2 f a}-\frac {i c d \arctan \left (\tan \left (f x +e \right )\right )}{f a}+\frac {\arctan \left (\tan \left (f x +e \right )\right ) c^{2}}{2 f a}+\frac {\arctan \left (\tan \left (f x +e \right )\right ) d^{2}}{2 f a}+\frac {i c d}{f a \left (-i+\tan \left (f x +e \right )\right )}+\frac {c^{2}}{2 f a \left (-i+\tan \left (f x +e \right )\right )}-\frac {d^{2}}{2 f a \left (-i+\tan \left (f x +e \right )\right )}\) | \(145\) |
default | \(-\frac {i \ln \left (1+\tan \left (f x +e \right )^{2}\right ) d^{2}}{2 f a}-\frac {i c d \arctan \left (\tan \left (f x +e \right )\right )}{f a}+\frac {\arctan \left (\tan \left (f x +e \right )\right ) c^{2}}{2 f a}+\frac {\arctan \left (\tan \left (f x +e \right )\right ) d^{2}}{2 f a}+\frac {i c d}{f a \left (-i+\tan \left (f x +e \right )\right )}+\frac {c^{2}}{2 f a \left (-i+\tan \left (f x +e \right )\right )}-\frac {d^{2}}{2 f a \left (-i+\tan \left (f x +e \right )\right )}\) | \(145\) |
Input:
int((c+d*tan(f*x+e))^2/(a+I*a*tan(f*x+e)),x,method=_RETURNVERBOSE)
Output:
-I*x/a*c*d+1/2*c^2*x/a+3/2*x/a*d^2-1/2/a/f*exp(-2*I*(f*x+e))*c*d+1/4*I/a/f *exp(-2*I*(f*x+e))*c^2-1/4*I/a/f*exp(-2*I*(f*x+e))*d^2+2*d^2/a/f*e+I*d^2/a /f*ln(exp(2*I*(f*x+e))+1)
Time = 0.09 (sec) , antiderivative size = 84, normalized size of antiderivative = 1.12 \[ \int \frac {(c+d \tan (e+f x))^2}{a+i a \tan (e+f x)} \, dx=\frac {{\left (2 \, {\left (c^{2} - 2 i \, c d + 3 \, d^{2}\right )} f x e^{\left (2 i \, f x + 2 i \, e\right )} + 4 i \, d^{2} e^{\left (2 i \, f x + 2 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) + i \, c^{2} - 2 \, c d - i \, d^{2}\right )} e^{\left (-2 i \, f x - 2 i \, e\right )}}{4 \, a f} \] Input:
integrate((c+d*tan(f*x+e))^2/(a+I*a*tan(f*x+e)),x, algorithm="fricas")
Output:
1/4*(2*(c^2 - 2*I*c*d + 3*d^2)*f*x*e^(2*I*f*x + 2*I*e) + 4*I*d^2*e^(2*I*f* x + 2*I*e)*log(e^(2*I*f*x + 2*I*e) + 1) + I*c^2 - 2*c*d - I*d^2)*e^(-2*I*f *x - 2*I*e)/(a*f)
Time = 0.29 (sec) , antiderivative size = 170, normalized size of antiderivative = 2.27 \[ \int \frac {(c+d \tan (e+f x))^2}{a+i a \tan (e+f x)} \, dx=\begin {cases} \frac {\left (i c^{2} - 2 c d - i d^{2}\right ) e^{- 2 i e} e^{- 2 i f x}}{4 a f} & \text {for}\: a f e^{2 i e} \neq 0 \\x \left (- \frac {c^{2} - 2 i c d + 3 d^{2}}{2 a} + \frac {\left (c^{2} e^{2 i e} + c^{2} - 2 i c d e^{2 i e} + 2 i c d + 3 d^{2} e^{2 i e} - d^{2}\right ) e^{- 2 i e}}{2 a}\right ) & \text {otherwise} \end {cases} + \frac {i d^{2} \log {\left (e^{2 i f x} + e^{- 2 i e} \right )}}{a f} + \frac {x \left (c^{2} - 2 i c d + 3 d^{2}\right )}{2 a} \] Input:
integrate((c+d*tan(f*x+e))**2/(a+I*a*tan(f*x+e)),x)
Output:
Piecewise(((I*c**2 - 2*c*d - I*d**2)*exp(-2*I*e)*exp(-2*I*f*x)/(4*a*f), Ne (a*f*exp(2*I*e), 0)), (x*(-(c**2 - 2*I*c*d + 3*d**2)/(2*a) + (c**2*exp(2*I *e) + c**2 - 2*I*c*d*exp(2*I*e) + 2*I*c*d + 3*d**2*exp(2*I*e) - d**2)*exp( -2*I*e)/(2*a)), True)) + I*d**2*log(exp(2*I*f*x) + exp(-2*I*e))/(a*f) + x* (c**2 - 2*I*c*d + 3*d**2)/(2*a)
Exception generated. \[ \int \frac {(c+d \tan (e+f x))^2}{a+i a \tan (e+f x)} \, dx=\text {Exception raised: RuntimeError} \] Input:
integrate((c+d*tan(f*x+e))^2/(a+I*a*tan(f*x+e)),x, algorithm="maxima")
Output:
Exception raised: RuntimeError >> ECL says: expt: undefined: 0 to a negati ve exponent.
Time = 0.55 (sec) , antiderivative size = 96, normalized size of antiderivative = 1.28 \[ \int \frac {(c+d \tan (e+f x))^2}{a+i a \tan (e+f x)} \, dx=-\frac {{\left (-i \, c^{2} - 2 \, c d + i \, d^{2}\right )} \log \left (\tan \left (f x + e\right ) + i\right )}{4 \, a f} + \frac {{\left (-i \, c^{2} - 2 \, c d - 3 i \, d^{2}\right )} \log \left (\tan \left (f x + e\right ) - i\right )}{4 \, a f} + \frac {c^{2} + 2 i \, c d - d^{2}}{2 \, a f {\left (\tan \left (f x + e\right ) - i\right )}} \] Input:
integrate((c+d*tan(f*x+e))^2/(a+I*a*tan(f*x+e)),x, algorithm="giac")
Output:
-1/4*(-I*c^2 - 2*c*d + I*d^2)*log(tan(f*x + e) + I)/(a*f) + 1/4*(-I*c^2 - 2*c*d - 3*I*d^2)*log(tan(f*x + e) - I)/(a*f) + 1/2*(c^2 + 2*I*c*d - d^2)/( a*f*(tan(f*x + e) - I))
Time = 2.27 (sec) , antiderivative size = 112, normalized size of antiderivative = 1.49 \[ \int \frac {(c+d \tan (e+f x))^2}{a+i a \tan (e+f x)} \, dx=-\frac {\frac {c\,d}{a}-\frac {c^2\,1{}\mathrm {i}}{2\,a}+\frac {d^2\,1{}\mathrm {i}}{2\,a}}{f\,\left (1+\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )}-\frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )-\mathrm {i}\right )\,\left (c^2-c\,d\,2{}\mathrm {i}+3\,d^2\right )\,1{}\mathrm {i}}{4\,a\,f}+\frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )+1{}\mathrm {i}\right )\,\left (c^2\,1{}\mathrm {i}+2\,c\,d-d^2\,1{}\mathrm {i}\right )}{4\,a\,f} \] Input:
int((c + d*tan(e + f*x))^2/(a + a*tan(e + f*x)*1i),x)
Output:
(log(tan(e + f*x) + 1i)*(2*c*d + c^2*1i - d^2*1i))/(4*a*f) - (log(tan(e + f*x) - 1i)*(c^2 - c*d*2i + 3*d^2)*1i)/(4*a*f) - ((d^2*1i)/(2*a) - (c^2*1i) /(2*a) + (c*d)/a)/(f*(tan(e + f*x)*1i + 1))
\[ \int \frac {(c+d \tan (e+f x))^2}{a+i a \tan (e+f x)} \, dx=\frac {\left (\int \frac {\tan \left (f x +e \right )^{2}}{\tan \left (f x +e \right ) i +1}d x \right ) d^{2}+2 \left (\int \frac {\tan \left (f x +e \right )}{\tan \left (f x +e \right ) i +1}d x \right ) c d +\left (\int \frac {1}{\tan \left (f x +e \right ) i +1}d x \right ) c^{2}}{a} \] Input:
int((c+d*tan(f*x+e))^2/(a+I*a*tan(f*x+e)),x)
Output:
(int(tan(e + f*x)**2/(tan(e + f*x)*i + 1),x)*d**2 + 2*int(tan(e + f*x)/(ta n(e + f*x)*i + 1),x)*c*d + int(1/(tan(e + f*x)*i + 1),x)*c**2)/a