Integrand size = 23, antiderivative size = 137 \[ \int \frac {(c+d x)^2}{a+i a \tan (e+f x)} \, dx=-\frac {d^2 x}{4 a f^2}-\frac {i (c+d x)^2}{4 a f}+\frac {(c+d x)^3}{6 a d}-\frac {i d^2}{4 f^3 (a+i a \tan (e+f x))}+\frac {d (c+d x)}{2 f^2 (a+i a \tan (e+f x))}+\frac {i (c+d x)^2}{2 f (a+i a \tan (e+f x))} \] Output:
-1/4*d^2*x/a/f^2-1/4*I*(d*x+c)^2/a/f+1/6*(d*x+c)^3/a/d-1/4*I*d^2/f^3/(a+I* a*tan(f*x+e))+1/2*d*(d*x+c)/f^2/(a+I*a*tan(f*x+e))+1/2*I*(d*x+c)^2/f/(a+I* a*tan(f*x+e))
Time = 0.43 (sec) , antiderivative size = 178, normalized size of antiderivative = 1.30 \[ \int \frac {(c+d x)^2}{a+i a \tan (e+f x)} \, dx=\frac {\sec (e+f x) (\cos (f x)+i \sin (f x)) \left ((d+(1+i) c f+(1+i) d f x) ((1+i) c f+d (-i+(1+i) f x)) \cos (2 f x) (\cos (e)-i \sin (e))+\frac {4}{3} f^3 x \left (3 c^2+3 c d x+d^2 x^2\right ) (\cos (e)+i \sin (e))-i (d+(1+i) c f+(1+i) d f x) ((1+i) c f+d (-i+(1+i) f x)) (\cos (e)-i \sin (e)) \sin (2 f x)\right )}{8 f^3 (a+i a \tan (e+f x))} \] Input:
Integrate[(c + d*x)^2/(a + I*a*Tan[e + f*x]),x]
Output:
(Sec[e + f*x]*(Cos[f*x] + I*Sin[f*x])*((d + (1 + I)*c*f + (1 + I)*d*f*x)*( (1 + I)*c*f + d*(-I + (1 + I)*f*x))*Cos[2*f*x]*(Cos[e] - I*Sin[e]) + (4*f^ 3*x*(3*c^2 + 3*c*d*x + d^2*x^2)*(Cos[e] + I*Sin[e]))/3 - I*(d + (1 + I)*c* f + (1 + I)*d*f*x)*((1 + I)*c*f + d*(-I + (1 + I)*f*x))*(Cos[e] - I*Sin[e] )*Sin[2*f*x]))/(8*f^3*(a + I*a*Tan[e + f*x]))
Time = 0.50 (sec) , antiderivative size = 147, normalized size of antiderivative = 1.07, number of steps used = 7, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.304, Rules used = {3042, 4206, 3042, 4206, 3042, 3960, 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 {(c+d x)^2}{a+i a \tan (e+f x)} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {(c+d x)^2}{a+i a \tan (e+f x)}dx\) |
\(\Big \downarrow \) 4206 |
\(\displaystyle -\frac {i d \int \frac {c+d x}{i \tan (e+f x) a+a}dx}{f}+\frac {i (c+d x)^2}{2 f (a+i a \tan (e+f x))}+\frac {(c+d x)^3}{6 a d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle -\frac {i d \int \frac {c+d x}{i \tan (e+f x) a+a}dx}{f}+\frac {i (c+d x)^2}{2 f (a+i a \tan (e+f x))}+\frac {(c+d x)^3}{6 a d}\) |
\(\Big \downarrow \) 4206 |
\(\displaystyle -\frac {i d \left (-\frac {i d \int \frac {1}{i \tan (e+f x) a+a}dx}{2 f}+\frac {i (c+d x)}{2 f (a+i a \tan (e+f x))}+\frac {(c+d x)^2}{4 a d}\right )}{f}+\frac {i (c+d x)^2}{2 f (a+i a \tan (e+f x))}+\frac {(c+d x)^3}{6 a d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle -\frac {i d \left (-\frac {i d \int \frac {1}{i \tan (e+f x) a+a}dx}{2 f}+\frac {i (c+d x)}{2 f (a+i a \tan (e+f x))}+\frac {(c+d x)^2}{4 a d}\right )}{f}+\frac {i (c+d x)^2}{2 f (a+i a \tan (e+f x))}+\frac {(c+d x)^3}{6 a d}\) |
\(\Big \downarrow \) 3960 |
\(\displaystyle -\frac {i d \left (-\frac {i d \left (\frac {\int 1dx}{2 a}+\frac {i}{2 f (a+i a \tan (e+f x))}\right )}{2 f}+\frac {i (c+d x)}{2 f (a+i a \tan (e+f x))}+\frac {(c+d x)^2}{4 a d}\right )}{f}+\frac {i (c+d x)^2}{2 f (a+i a \tan (e+f x))}+\frac {(c+d x)^3}{6 a d}\) |
\(\Big \downarrow \) 24 |
\(\displaystyle \frac {i (c+d x)^2}{2 f (a+i a \tan (e+f x))}-\frac {i d \left (\frac {i (c+d x)}{2 f (a+i a \tan (e+f x))}+\frac {(c+d x)^2}{4 a d}-\frac {i d \left (\frac {x}{2 a}+\frac {i}{2 f (a+i a \tan (e+f x))}\right )}{2 f}\right )}{f}+\frac {(c+d x)^3}{6 a d}\) |
Input:
Int[(c + d*x)^2/(a + I*a*Tan[e + f*x]),x]
Output:
(c + d*x)^3/(6*a*d) + ((I/2)*(c + d*x)^2)/(f*(a + I*a*Tan[e + f*x])) - (I* d*((c + d*x)^2/(4*a*d) + ((I/2)*(c + d*x))/(f*(a + I*a*Tan[e + f*x])) - (( I/2)*d*(x/(2*a) + (I/2)/(f*(a + I*a*Tan[e + f*x]))))/f))/f
Int[((a_) + (b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[a*((a + b*Tan[c + d*x])^n/(2*b*d*n)), x] + Simp[1/(2*a) Int[(a + b*Tan[c + d*x])^ (n + 1), x], x] /; FreeQ[{a, b, c, d}, x] && EqQ[a^2 + b^2, 0] && LtQ[n, 0]
Int[((c_.) + (d_.)*(x_))^(m_.)/((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Sy mbol] :> Simp[(c + d*x)^(m + 1)/(2*a*d*(m + 1)), x] + (Simp[a*d*(m/(2*b*f)) Int[(c + d*x)^(m - 1)/(a + b*Tan[e + f*x]), x], x] - Simp[a*((c + d*x)^m /(2*b*f*(a + b*Tan[e + f*x]))), x]) /; FreeQ[{a, b, c, d, e, f}, x] && EqQ[ a^2 + b^2, 0] && GtQ[m, 0]
Time = 0.61 (sec) , antiderivative size = 108, normalized size of antiderivative = 0.79
method | result | size |
risch | \(\frac {d^{2} x^{3}}{6 a}+\frac {d c \,x^{2}}{2 a}+\frac {c^{2} x}{2 a}+\frac {c^{3}}{6 a d}+\frac {i \left (2 d^{2} x^{2} f^{2}+4 c d \,f^{2} x -2 i d^{2} f x +2 c^{2} f^{2}-2 i c d f -d^{2}\right ) {\mathrm e}^{-2 i \left (f x +e \right )}}{8 a \,f^{3}}\) | \(108\) |
Input:
int((d*x+c)^2/(a+I*a*tan(f*x+e)),x,method=_RETURNVERBOSE)
Output:
1/6/a*d^2*x^3+1/2/a*d*c*x^2+1/2/a*c^2*x+1/6/a/d*c^3+1/8*I*(2*d^2*x^2*f^2-2 *I*d^2*f*x+4*c*d*f^2*x-2*I*c*d*f+2*c^2*f^2-d^2)/a/f^3*exp(-2*I*(f*x+e))
Time = 0.07 (sec) , antiderivative size = 105, normalized size of antiderivative = 0.77 \[ \int \frac {(c+d x)^2}{a+i a \tan (e+f x)} \, dx=\frac {{\left (6 i \, d^{2} f^{2} x^{2} + 6 i \, c^{2} f^{2} + 6 \, c d f - 3 i \, d^{2} - 6 \, {\left (-2 i \, c d f^{2} - d^{2} f\right )} x + 4 \, {\left (d^{2} f^{3} x^{3} + 3 \, c d f^{3} x^{2} + 3 \, c^{2} f^{3} x\right )} e^{\left (2 i \, f x + 2 i \, e\right )}\right )} e^{\left (-2 i \, f x - 2 i \, e\right )}}{24 \, a f^{3}} \] Input:
integrate((d*x+c)^2/(a+I*a*tan(f*x+e)),x, algorithm="fricas")
Output:
1/24*(6*I*d^2*f^2*x^2 + 6*I*c^2*f^2 + 6*c*d*f - 3*I*d^2 - 6*(-2*I*c*d*f^2 - d^2*f)*x + 4*(d^2*f^3*x^3 + 3*c*d*f^3*x^2 + 3*c^2*f^3*x)*e^(2*I*f*x + 2* I*e))*e^(-2*I*f*x - 2*I*e)/(a*f^3)
Time = 0.17 (sec) , antiderivative size = 165, normalized size of antiderivative = 1.20 \[ \int \frac {(c+d x)^2}{a+i a \tan (e+f x)} \, dx=\begin {cases} \frac {\left (2 i c^{2} f^{2} + 4 i c d f^{2} x + 2 c d f + 2 i d^{2} f^{2} x^{2} + 2 d^{2} f x - i d^{2}\right ) e^{- 2 i e} e^{- 2 i f x}}{8 a f^{3}} & \text {for}\: a f^{3} e^{2 i e} \neq 0 \\\frac {c^{2} x e^{- 2 i e}}{2 a} + \frac {c d x^{2} e^{- 2 i e}}{2 a} + \frac {d^{2} x^{3} e^{- 2 i e}}{6 a} & \text {otherwise} \end {cases} + \frac {c^{2} x}{2 a} + \frac {c d x^{2}}{2 a} + \frac {d^{2} x^{3}}{6 a} \] Input:
integrate((d*x+c)**2/(a+I*a*tan(f*x+e)),x)
Output:
Piecewise(((2*I*c**2*f**2 + 4*I*c*d*f**2*x + 2*c*d*f + 2*I*d**2*f**2*x**2 + 2*d**2*f*x - I*d**2)*exp(-2*I*e)*exp(-2*I*f*x)/(8*a*f**3), Ne(a*f**3*exp (2*I*e), 0)), (c**2*x*exp(-2*I*e)/(2*a) + c*d*x**2*exp(-2*I*e)/(2*a) + d** 2*x**3*exp(-2*I*e)/(6*a), True)) + c**2*x/(2*a) + c*d*x**2/(2*a) + d**2*x* *3/(6*a)
Exception generated. \[ \int \frac {(c+d x)^2}{a+i a \tan (e+f x)} \, dx=\text {Exception raised: RuntimeError} \] Input:
integrate((d*x+c)^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.22 (sec) , antiderivative size = 119, normalized size of antiderivative = 0.87 \[ \int \frac {(c+d x)^2}{a+i a \tan (e+f x)} \, dx=\frac {{\left (4 \, d^{2} f^{3} x^{3} e^{\left (2 i \, f x + 2 i \, e\right )} + 12 \, c d f^{3} x^{2} e^{\left (2 i \, f x + 2 i \, e\right )} + 12 \, c^{2} f^{3} x e^{\left (2 i \, f x + 2 i \, e\right )} + 6 i \, d^{2} f^{2} x^{2} + 12 i \, c d f^{2} x + 6 i \, c^{2} f^{2} + 6 \, d^{2} f x + 6 \, c d f - 3 i \, d^{2}\right )} e^{\left (-2 i \, f x - 2 i \, e\right )}}{24 \, a f^{3}} \] Input:
integrate((d*x+c)^2/(a+I*a*tan(f*x+e)),x, algorithm="giac")
Output:
1/24*(4*d^2*f^3*x^3*e^(2*I*f*x + 2*I*e) + 12*c*d*f^3*x^2*e^(2*I*f*x + 2*I* e) + 12*c^2*f^3*x*e^(2*I*f*x + 2*I*e) + 6*I*d^2*f^2*x^2 + 12*I*c*d*f^2*x + 6*I*c^2*f^2 + 6*d^2*f*x + 6*c*d*f - 3*I*d^2)*e^(-2*I*f*x - 2*I*e)/(a*f^3)
Time = 8.73 (sec) , antiderivative size = 241, normalized size of antiderivative = 1.76 \[ \int \frac {(c+d x)^2}{a+i a \tan (e+f x)} \, dx=\frac {12\,c^2\,f^3\,x-3\,d^2\,\sin \left (2\,e+2\,f\,x\right )+6\,c^2\,f^2\,\sin \left (2\,e+2\,f\,x\right )+4\,d^2\,f^3\,x^3+6\,c\,d\,f\,\cos \left (2\,e+2\,f\,x\right )+6\,d^2\,f^2\,x^2\,\sin \left (2\,e+2\,f\,x\right )+12\,c\,d\,f^3\,x^2+6\,d^2\,f\,x\,\cos \left (2\,e+2\,f\,x\right )+12\,c\,d\,f^2\,x\,\sin \left (2\,e+2\,f\,x\right )-d^2\,\cos \left (2\,e+2\,f\,x\right )\,3{}\mathrm {i}+c^2\,f^2\,\cos \left (2\,e+2\,f\,x\right )\,6{}\mathrm {i}-c\,d\,f\,\sin \left (2\,e+2\,f\,x\right )\,6{}\mathrm {i}+d^2\,f^2\,x^2\,\cos \left (2\,e+2\,f\,x\right )\,6{}\mathrm {i}-d^2\,f\,x\,\sin \left (2\,e+2\,f\,x\right )\,6{}\mathrm {i}+c\,d\,f^2\,x\,\cos \left (2\,e+2\,f\,x\right )\,12{}\mathrm {i}}{24\,a\,f^3} \] Input:
int((c + d*x)^2/(a + a*tan(e + f*x)*1i),x)
Output:
(12*c^2*f^3*x - 3*d^2*sin(2*e + 2*f*x) - d^2*cos(2*e + 2*f*x)*3i + c^2*f^2 *cos(2*e + 2*f*x)*6i + 6*c^2*f^2*sin(2*e + 2*f*x) + 4*d^2*f^3*x^3 + 6*c*d* f*cos(2*e + 2*f*x) - c*d*f*sin(2*e + 2*f*x)*6i + d^2*f^2*x^2*cos(2*e + 2*f *x)*6i + 6*d^2*f^2*x^2*sin(2*e + 2*f*x) + 12*c*d*f^3*x^2 + 6*d^2*f*x*cos(2 *e + 2*f*x) - d^2*f*x*sin(2*e + 2*f*x)*6i + c*d*f^2*x*cos(2*e + 2*f*x)*12i + 12*c*d*f^2*x*sin(2*e + 2*f*x))/(24*a*f^3)
\[ \int \frac {(c+d x)^2}{a+i a \tan (e+f x)} \, dx=\frac {\left (\int \frac {x^{2}}{\tan \left (f x +e \right ) i +1}d x \right ) d^{2}+2 \left (\int \frac {x}{\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((d*x+c)^2/(a+I*a*tan(f*x+e)),x)
Output:
(int(x**2/(tan(e + f*x)*i + 1),x)*d**2 + 2*int(x/(tan(e + f*x)*i + 1),x)*c *d + int(1/(tan(e + f*x)*i + 1),x)*c**2)/a