Integrand size = 21, antiderivative size = 152 \[ \int \frac {\cos ^2(c+d x)}{(a+b \tan (c+d x))^2} \, dx=\frac {\left (a^4+6 a^2 b^2-3 b^4\right ) x}{2 \left (a^2+b^2\right )^3}+\frac {4 a b^3 \log (a \cos (c+d x)+b \sin (c+d x))}{\left (a^2+b^2\right )^3 d}+\frac {b \left (a^2-3 b^2\right )}{2 \left (a^2+b^2\right )^2 d (a+b \tan (c+d x))}+\frac {\cos ^2(c+d x) (b+a \tan (c+d x))}{2 \left (a^2+b^2\right ) d (a+b \tan (c+d x))} \] Output:
1/2*(a^4+6*a^2*b^2-3*b^4)*x/(a^2+b^2)^3+4*a*b^3*ln(a*cos(d*x+c)+b*sin(d*x+ c))/(a^2+b^2)^3/d+1/2*b*(a^2-3*b^2)/(a^2+b^2)^2/d/(a+b*tan(d*x+c))+1/2*cos (d*x+c)^2*(b+a*tan(d*x+c))/(a^2+b^2)/d/(a+b*tan(d*x+c))
Time = 2.74 (sec) , antiderivative size = 304, normalized size of antiderivative = 2.00 \[ \int \frac {\cos ^2(c+d x)}{(a+b \tan (c+d x))^2} \, dx=\frac {-\frac {a b \left (\left (-a+\sqrt {-b^2}\right ) \log \left (\sqrt {-b^2}-b \tan (c+d x)\right )-2 \sqrt {-b^2} \log (a+b \tan (c+d x))+\left (a+\sqrt {-b^2}\right ) \log \left (\sqrt {-b^2}+b \tan (c+d x)\right )\right )}{\sqrt {-b^2} \left (a^2+b^2\right )}+\frac {\cos ^2(c+d x) (b+a \tan (c+d x))}{a+b \tan (c+d x)}+\frac {b \left (a^2-3 b^2\right ) \left (\left (2 a+\frac {-a^2+b^2}{\sqrt {-b^2}}\right ) \log \left (\sqrt {-b^2}-b \tan (c+d x)\right )-4 a \log (a+b \tan (c+d x))+\left (2 a+\frac {a^2-b^2}{\sqrt {-b^2}}\right ) \log \left (\sqrt {-b^2}+b \tan (c+d x)\right )+\frac {2 \left (a^2+b^2\right )}{a+b \tan (c+d x)}\right )}{2 \left (a^2+b^2\right )^2}}{2 \left (a^2+b^2\right ) d} \] Input:
Integrate[Cos[c + d*x]^2/(a + b*Tan[c + d*x])^2,x]
Output:
(-((a*b*((-a + Sqrt[-b^2])*Log[Sqrt[-b^2] - b*Tan[c + d*x]] - 2*Sqrt[-b^2] *Log[a + b*Tan[c + d*x]] + (a + Sqrt[-b^2])*Log[Sqrt[-b^2] + b*Tan[c + d*x ]]))/(Sqrt[-b^2]*(a^2 + b^2))) + (Cos[c + d*x]^2*(b + a*Tan[c + d*x]))/(a + b*Tan[c + d*x]) + (b*(a^2 - 3*b^2)*((2*a + (-a^2 + b^2)/Sqrt[-b^2])*Log[ Sqrt[-b^2] - b*Tan[c + d*x]] - 4*a*Log[a + b*Tan[c + d*x]] + (2*a + (a^2 - b^2)/Sqrt[-b^2])*Log[Sqrt[-b^2] + b*Tan[c + d*x]] + (2*(a^2 + b^2))/(a + b*Tan[c + d*x])))/(2*(a^2 + b^2)^2))/(2*(a^2 + b^2)*d)
Time = 0.43 (sec) , antiderivative size = 210, normalized size of antiderivative = 1.38, number of steps used = 8, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {3042, 3987, 27, 496, 25, 657, 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 {\cos ^2(c+d x)}{(a+b \tan (c+d x))^2} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {1}{\sec (c+d x)^2 (a+b \tan (c+d x))^2}dx\) |
\(\Big \downarrow \) 3987 |
\(\displaystyle \frac {\int \frac {b^4}{(a+b \tan (c+d x))^2 \left (\tan ^2(c+d x) b^2+b^2\right )^2}d(b \tan (c+d x))}{b d}\) |
\(\Big \downarrow \) 27 |
\(\displaystyle \frac {b^3 \int \frac {1}{(a+b \tan (c+d x))^2 \left (\tan ^2(c+d x) b^2+b^2\right )^2}d(b \tan (c+d x))}{d}\) |
\(\Big \downarrow \) 496 |
\(\displaystyle \frac {b^3 \left (\frac {a b \tan (c+d x)+b^2}{2 b^2 \left (a^2+b^2\right ) \left (b^2 \tan ^2(c+d x)+b^2\right ) (a+b \tan (c+d x))}-\frac {\int -\frac {a^2+2 b \tan (c+d x) a+3 b^2}{(a+b \tan (c+d x))^2 \left (\tan ^2(c+d x) b^2+b^2\right )}d(b \tan (c+d x))}{2 b^2 \left (a^2+b^2\right )}\right )}{d}\) |
\(\Big \downarrow \) 25 |
\(\displaystyle \frac {b^3 \left (\frac {\int \frac {a^2+2 b \tan (c+d x) a+3 b^2}{(a+b \tan (c+d x))^2 \left (\tan ^2(c+d x) b^2+b^2\right )}d(b \tan (c+d x))}{2 b^2 \left (a^2+b^2\right )}+\frac {a b \tan (c+d x)+b^2}{2 b^2 \left (a^2+b^2\right ) \left (b^2 \tan ^2(c+d x)+b^2\right ) (a+b \tan (c+d x))}\right )}{d}\) |
\(\Big \downarrow \) 657 |
\(\displaystyle \frac {b^3 \left (\frac {\int \left (\frac {8 a b^2}{\left (a^2+b^2\right )^2 (a+b \tan (c+d x))}+\frac {a^4+6 b^2 a^2-8 b^3 \tan (c+d x) a-3 b^4}{\left (a^2+b^2\right )^2 \left (\tan ^2(c+d x) b^2+b^2\right )}+\frac {3 b^2-a^2}{\left (a^2+b^2\right ) (a+b \tan (c+d x))^2}\right )d(b \tan (c+d x))}{2 b^2 \left (a^2+b^2\right )}+\frac {a b \tan (c+d x)+b^2}{2 b^2 \left (a^2+b^2\right ) \left (b^2 \tan ^2(c+d x)+b^2\right ) (a+b \tan (c+d x))}\right )}{d}\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {b^3 \left (\frac {a b \tan (c+d x)+b^2}{2 b^2 \left (a^2+b^2\right ) \left (b^2 \tan ^2(c+d x)+b^2\right ) (a+b \tan (c+d x))}+\frac {\frac {a^2-3 b^2}{\left (a^2+b^2\right ) (a+b \tan (c+d x))}-\frac {4 a b^2 \log \left (b^2 \tan ^2(c+d x)+b^2\right )}{\left (a^2+b^2\right )^2}+\frac {8 a b^2 \log (a+b \tan (c+d x))}{\left (a^2+b^2\right )^2}+\frac {\left (a^4+6 a^2 b^2-3 b^4\right ) \arctan (\tan (c+d x))}{b \left (a^2+b^2\right )^2}}{2 b^2 \left (a^2+b^2\right )}\right )}{d}\) |
Input:
Int[Cos[c + d*x]^2/(a + b*Tan[c + d*x])^2,x]
Output:
(b^3*((b^2 + a*b*Tan[c + d*x])/(2*b^2*(a^2 + b^2)*(a + b*Tan[c + d*x])*(b^ 2 + b^2*Tan[c + d*x]^2)) + (((a^4 + 6*a^2*b^2 - 3*b^4)*ArcTan[Tan[c + d*x] ])/(b*(a^2 + b^2)^2) + (8*a*b^2*Log[a + b*Tan[c + d*x]])/(a^2 + b^2)^2 - ( 4*a*b^2*Log[b^2 + b^2*Tan[c + d*x]^2])/(a^2 + b^2)^2 + (a^2 - 3*b^2)/((a^2 + b^2)*(a + b*Tan[c + d*x])))/(2*b^2*(a^2 + b^2))))/d
Int[(a_)*(Fx_), x_Symbol] :> Simp[a Int[Fx, x], x] /; FreeQ[a, x] && !Ma tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
Int[((c_) + (d_.)*(x_))^(n_)*((a_) + (b_.)*(x_)^2)^(p_), x_Symbol] :> Simp[ (-(a*d + b*c*x))*(c + d*x)^(n + 1)*((a + b*x^2)^(p + 1)/(2*a*(p + 1)*(b*c^2 + a*d^2))), x] + Simp[1/(2*a*(p + 1)*(b*c^2 + a*d^2)) Int[(c + d*x)^n*(a + b*x^2)^(p + 1)*Simp[b*c^2*(2*p + 3) + a*d^2*(n + 2*p + 3) + b*c*d*(n + 2 *p + 4)*x, x], x], x] /; FreeQ[{a, b, c, d, n}, x] && LtQ[p, -1] && IntQuad raticQ[a, 0, b, c, d, n, p, x]
Int[(((d_.) + (e_.)*(x_))^(m_.)*((f_.) + (g_.)*(x_))^(n_.))/((a_) + (c_.)*( x_)^2), x_Symbol] :> Int[ExpandIntegrand[(d + e*x)^m*((f + g*x)^n/(a + c*x^ 2)), x], x] /; FreeQ[{a, c, d, e, f, g, m}, x] && IntegersQ[n]
Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_ ), x_Symbol] :> Simp[1/(b*f) Subst[Int[(a + x)^n*(1 + x^2/b^2)^(m/2 - 1), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, n}, x] && NeQ[a^2 + b^2, 0] && IntegerQ[m/2]
Time = 4.22 (sec) , antiderivative size = 154, normalized size of antiderivative = 1.01
method | result | size |
derivativedivides | \(\frac {-\frac {b^{3}}{\left (a^{2}+b^{2}\right )^{2} \left (a +b \tan \left (d x +c \right )\right )}+\frac {4 b^{3} a \ln \left (a +b \tan \left (d x +c \right )\right )}{\left (a^{2}+b^{2}\right )^{3}}+\frac {\frac {\left (\frac {a^{4}}{2}-\frac {b^{4}}{2}\right ) \tan \left (d x +c \right )+a^{3} b +a \,b^{3}}{1+\tan \left (d x +c \right )^{2}}-2 a \,b^{3} \ln \left (1+\tan \left (d x +c \right )^{2}\right )+\frac {\left (a^{4}+6 b^{2} a^{2}-3 b^{4}\right ) \arctan \left (\tan \left (d x +c \right )\right )}{2}}{\left (a^{2}+b^{2}\right )^{3}}}{d}\) | \(154\) |
default | \(\frac {-\frac {b^{3}}{\left (a^{2}+b^{2}\right )^{2} \left (a +b \tan \left (d x +c \right )\right )}+\frac {4 b^{3} a \ln \left (a +b \tan \left (d x +c \right )\right )}{\left (a^{2}+b^{2}\right )^{3}}+\frac {\frac {\left (\frac {a^{4}}{2}-\frac {b^{4}}{2}\right ) \tan \left (d x +c \right )+a^{3} b +a \,b^{3}}{1+\tan \left (d x +c \right )^{2}}-2 a \,b^{3} \ln \left (1+\tan \left (d x +c \right )^{2}\right )+\frac {\left (a^{4}+6 b^{2} a^{2}-3 b^{4}\right ) \arctan \left (\tan \left (d x +c \right )\right )}{2}}{\left (a^{2}+b^{2}\right )^{3}}}{d}\) | \(154\) |
risch | \(\frac {3 i x b}{6 i a^{2} b -2 i b^{3}-2 a^{3}+6 a \,b^{2}}-\frac {x a}{6 i a^{2} b -2 i b^{3}-2 a^{3}+6 a \,b^{2}}-\frac {i {\mathrm e}^{2 i \left (d x +c \right )}}{8 \left (-2 i a b +a^{2}-b^{2}\right ) d}+\frac {i {\mathrm e}^{-2 i \left (d x +c \right )}}{8 \left (2 i a b +a^{2}-b^{2}\right ) d}-\frac {8 i a \,b^{3} x}{a^{6}+3 a^{4} b^{2}+3 a^{2} b^{4}+b^{6}}-\frac {8 i a \,b^{3} c}{d \left (a^{6}+3 a^{4} b^{2}+3 a^{2} b^{4}+b^{6}\right )}-\frac {2 i b^{4}}{\left (-i a +b \right )^{2} d \left (i a +b \right )^{3} \left (b \,{\mathrm e}^{2 i \left (d x +c \right )}+i a \,{\mathrm e}^{2 i \left (d x +c \right )}-b +i a \right )}+\frac {4 a \,b^{3} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-\frac {i b +a}{i b -a}\right )}{d \left (a^{6}+3 a^{4} b^{2}+3 a^{2} b^{4}+b^{6}\right )}\) | \(318\) |
Input:
int(cos(d*x+c)^2/(a+b*tan(d*x+c))^2,x,method=_RETURNVERBOSE)
Output:
1/d*(-b^3/(a^2+b^2)^2/(a+b*tan(d*x+c))+4*b^3/(a^2+b^2)^3*a*ln(a+b*tan(d*x+ c))+1/(a^2+b^2)^3*(((1/2*a^4-1/2*b^4)*tan(d*x+c)+a^3*b+a*b^3)/(1+tan(d*x+c )^2)-2*a*b^3*ln(1+tan(d*x+c)^2)+1/2*(a^4+6*a^2*b^2-3*b^4)*arctan(tan(d*x+c ))))
Time = 0.11 (sec) , antiderivative size = 279, normalized size of antiderivative = 1.84 \[ \int \frac {\cos ^2(c+d x)}{(a+b \tan (c+d x))^2} \, dx=\frac {{\left (a^{4} b + 2 \, a^{2} b^{3} + b^{5}\right )} \cos \left (d x + c\right )^{3} - {\left (a^{2} b^{3} + 3 \, b^{5} - {\left (a^{5} + 6 \, a^{3} b^{2} - 3 \, a b^{4}\right )} d x\right )} \cos \left (d x + c\right ) + 4 \, {\left (a^{2} b^{3} \cos \left (d x + c\right ) + a b^{4} \sin \left (d x + c\right )\right )} \log \left (2 \, a b \cos \left (d x + c\right ) \sin \left (d x + c\right ) + {\left (a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} + b^{2}\right ) - {\left (a^{3} b^{2} - a b^{4} - {\left (a^{4} b + 6 \, a^{2} b^{3} - 3 \, b^{5}\right )} d x - {\left (a^{5} + 2 \, a^{3} b^{2} + a b^{4}\right )} \cos \left (d x + c\right )^{2}\right )} \sin \left (d x + c\right )}{2 \, {\left ({\left (a^{7} + 3 \, a^{5} b^{2} + 3 \, a^{3} b^{4} + a b^{6}\right )} d \cos \left (d x + c\right ) + {\left (a^{6} b + 3 \, a^{4} b^{3} + 3 \, a^{2} b^{5} + b^{7}\right )} d \sin \left (d x + c\right )\right )}} \] Input:
integrate(cos(d*x+c)^2/(a+b*tan(d*x+c))^2,x, algorithm="fricas")
Output:
1/2*((a^4*b + 2*a^2*b^3 + b^5)*cos(d*x + c)^3 - (a^2*b^3 + 3*b^5 - (a^5 + 6*a^3*b^2 - 3*a*b^4)*d*x)*cos(d*x + c) + 4*(a^2*b^3*cos(d*x + c) + a*b^4*s in(d*x + c))*log(2*a*b*cos(d*x + c)*sin(d*x + c) + (a^2 - b^2)*cos(d*x + c )^2 + b^2) - (a^3*b^2 - a*b^4 - (a^4*b + 6*a^2*b^3 - 3*b^5)*d*x - (a^5 + 2 *a^3*b^2 + a*b^4)*cos(d*x + c)^2)*sin(d*x + c))/((a^7 + 3*a^5*b^2 + 3*a^3* b^4 + a*b^6)*d*cos(d*x + c) + (a^6*b + 3*a^4*b^3 + 3*a^2*b^5 + b^7)*d*sin( d*x + c))
Timed out. \[ \int \frac {\cos ^2(c+d x)}{(a+b \tan (c+d x))^2} \, dx=\text {Timed out} \] Input:
integrate(cos(d*x+c)**2/(a+b*tan(d*x+c))**2,x)
Output:
Timed out
Time = 0.11 (sec) , antiderivative size = 282, normalized size of antiderivative = 1.86 \[ \int \frac {\cos ^2(c+d x)}{(a+b \tan (c+d x))^2} \, dx=\frac {\frac {8 \, a b^{3} \log \left (b \tan \left (d x + c\right ) + a\right )}{a^{6} + 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6}} - \frac {4 \, a b^{3} \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{a^{6} + 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6}} + \frac {{\left (a^{4} + 6 \, a^{2} b^{2} - 3 \, b^{4}\right )} {\left (d x + c\right )}}{a^{6} + 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6}} + \frac {2 \, a^{2} b - 2 \, b^{3} + {\left (a^{2} b - 3 \, b^{3}\right )} \tan \left (d x + c\right )^{2} + {\left (a^{3} + a b^{2}\right )} \tan \left (d x + c\right )}{a^{5} + 2 \, a^{3} b^{2} + a b^{4} + {\left (a^{4} b + 2 \, a^{2} b^{3} + b^{5}\right )} \tan \left (d x + c\right )^{3} + {\left (a^{5} + 2 \, a^{3} b^{2} + a b^{4}\right )} \tan \left (d x + c\right )^{2} + {\left (a^{4} b + 2 \, a^{2} b^{3} + b^{5}\right )} \tan \left (d x + c\right )}}{2 \, d} \] Input:
integrate(cos(d*x+c)^2/(a+b*tan(d*x+c))^2,x, algorithm="maxima")
Output:
1/2*(8*a*b^3*log(b*tan(d*x + c) + a)/(a^6 + 3*a^4*b^2 + 3*a^2*b^4 + b^6) - 4*a*b^3*log(tan(d*x + c)^2 + 1)/(a^6 + 3*a^4*b^2 + 3*a^2*b^4 + b^6) + (a^ 4 + 6*a^2*b^2 - 3*b^4)*(d*x + c)/(a^6 + 3*a^4*b^2 + 3*a^2*b^4 + b^6) + (2* a^2*b - 2*b^3 + (a^2*b - 3*b^3)*tan(d*x + c)^2 + (a^3 + a*b^2)*tan(d*x + c ))/(a^5 + 2*a^3*b^2 + a*b^4 + (a^4*b + 2*a^2*b^3 + b^5)*tan(d*x + c)^3 + ( a^5 + 2*a^3*b^2 + a*b^4)*tan(d*x + c)^2 + (a^4*b + 2*a^2*b^3 + b^5)*tan(d* x + c)))/d
Time = 0.20 (sec) , antiderivative size = 269, normalized size of antiderivative = 1.77 \[ \int \frac {\cos ^2(c+d x)}{(a+b \tan (c+d x))^2} \, dx=\frac {4 \, a b^{4} \log \left ({\left | b \tan \left (d x + c\right ) + a \right |}\right )}{a^{6} b d + 3 \, a^{4} b^{3} d + 3 \, a^{2} b^{5} d + b^{7} d} - \frac {2 \, a b^{3} \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{a^{6} d + 3 \, a^{4} b^{2} d + 3 \, a^{2} b^{4} d + b^{6} d} + \frac {{\left (a^{4} + 6 \, a^{2} b^{2} - 3 \, b^{4}\right )} {\left (d x + c\right )}}{2 \, {\left (a^{6} d + 3 \, a^{4} b^{2} d + 3 \, a^{2} b^{4} d + b^{6} d\right )}} + \frac {a^{2} b \tan \left (d x + c\right )^{2} - 3 \, b^{3} \tan \left (d x + c\right )^{2} + a^{3} \tan \left (d x + c\right ) + a b^{2} \tan \left (d x + c\right ) + 2 \, a^{2} b - 2 \, b^{3}}{2 \, {\left (a^{4} d + 2 \, a^{2} b^{2} d + b^{4} d\right )} {\left (b \tan \left (d x + c\right )^{3} + a \tan \left (d x + c\right )^{2} + b \tan \left (d x + c\right ) + a\right )}} \] Input:
integrate(cos(d*x+c)^2/(a+b*tan(d*x+c))^2,x, algorithm="giac")
Output:
4*a*b^4*log(abs(b*tan(d*x + c) + a))/(a^6*b*d + 3*a^4*b^3*d + 3*a^2*b^5*d + b^7*d) - 2*a*b^3*log(tan(d*x + c)^2 + 1)/(a^6*d + 3*a^4*b^2*d + 3*a^2*b^ 4*d + b^6*d) + 1/2*(a^4 + 6*a^2*b^2 - 3*b^4)*(d*x + c)/(a^6*d + 3*a^4*b^2* d + 3*a^2*b^4*d + b^6*d) + 1/2*(a^2*b*tan(d*x + c)^2 - 3*b^3*tan(d*x + c)^ 2 + a^3*tan(d*x + c) + a*b^2*tan(d*x + c) + 2*a^2*b - 2*b^3)/((a^4*d + 2*a ^2*b^2*d + b^4*d)*(b*tan(d*x + c)^3 + a*tan(d*x + c)^2 + b*tan(d*x + c) + a))
Time = 1.08 (sec) , antiderivative size = 246, normalized size of antiderivative = 1.62 \[ \int \frac {\cos ^2(c+d x)}{(a+b \tan (c+d x))^2} \, dx=\frac {\frac {a^2\,b-b^3}{{\left (a^2+b^2\right )}^2}+\frac {{\mathrm {tan}\left (c+d\,x\right )}^2\,\left (a^2\,b-3\,b^3\right )}{2\,\left (a^4+2\,a^2\,b^2+b^4\right )}+\frac {a\,\mathrm {tan}\left (c+d\,x\right )}{2\,\left (a^2+b^2\right )}}{d\,\left (b\,{\mathrm {tan}\left (c+d\,x\right )}^3+a\,{\mathrm {tan}\left (c+d\,x\right )}^2+b\,\mathrm {tan}\left (c+d\,x\right )+a\right )}+\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )-\mathrm {i}\right )\,\left (-3\,b+a\,1{}\mathrm {i}\right )}{4\,d\,\left (-a^3-a^2\,b\,3{}\mathrm {i}+3\,a\,b^2+b^3\,1{}\mathrm {i}\right )}+\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )+1{}\mathrm {i}\right )\,\left (a-b\,3{}\mathrm {i}\right )}{4\,d\,\left (-a^3\,1{}\mathrm {i}-3\,a^2\,b+a\,b^2\,3{}\mathrm {i}+b^3\right )}+\frac {4\,a\,b^3\,\ln \left (a+b\,\mathrm {tan}\left (c+d\,x\right )\right )}{d\,{\left (a^2+b^2\right )}^3} \] Input:
int(cos(c + d*x)^2/(a + b*tan(c + d*x))^2,x)
Output:
((a^2*b - b^3)/(a^2 + b^2)^2 + (tan(c + d*x)^2*(a^2*b - 3*b^3))/(2*(a^4 + b^4 + 2*a^2*b^2)) + (a*tan(c + d*x))/(2*(a^2 + b^2)))/(d*(a + b*tan(c + d* x) + a*tan(c + d*x)^2 + b*tan(c + d*x)^3)) + (log(tan(c + d*x) - 1i)*(a*1i - 3*b))/(4*d*(3*a*b^2 - a^2*b*3i - a^3 + b^3*1i)) + (log(tan(c + d*x) + 1 i)*(a - b*3i))/(4*d*(a*b^2*3i - 3*a^2*b - a^3*1i + b^3)) + (4*a*b^3*log(a + b*tan(c + d*x)))/(d*(a^2 + b^2)^3)
Time = 0.22 (sec) , antiderivative size = 480, normalized size of antiderivative = 3.16 \[ \int \frac {\cos ^2(c+d x)}{(a+b \tan (c+d x))^2} \, dx=\frac {-8 \cos \left (d x +c \right ) \mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+1\right ) a^{2} b^{4}+8 \cos \left (d x +c \right ) \mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} a -2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right ) b -a \right ) a^{2} b^{4}-\cos \left (d x +c \right ) \sin \left (d x +c \right )^{2} a^{4} b^{2}-2 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{2} a^{2} b^{4}-\cos \left (d x +c \right ) \sin \left (d x +c \right )^{2} b^{6}-\cos \left (d x +c \right ) a^{6}+\cos \left (d x +c \right ) a^{5} b d x +6 \cos \left (d x +c \right ) a^{3} b^{3} d x -\cos \left (d x +c \right ) a^{2} b^{4}-3 \cos \left (d x +c \right ) a \,b^{5} d x -2 \cos \left (d x +c \right ) b^{6}-8 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+1\right ) \sin \left (d x +c \right ) a \,b^{5}+8 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} a -2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right ) b -a \right ) \sin \left (d x +c \right ) a \,b^{5}-\sin \left (d x +c \right )^{3} a^{5} b -2 \sin \left (d x +c \right )^{3} a^{3} b^{3}-\sin \left (d x +c \right )^{3} a \,b^{5}+\sin \left (d x +c \right ) a^{4} b^{2} d x +6 \sin \left (d x +c \right ) a^{2} b^{4} d x -3 \sin \left (d x +c \right ) b^{6} d x}{2 b d \left (\cos \left (d x +c \right ) a^{7}+3 \cos \left (d x +c \right ) a^{5} b^{2}+3 \cos \left (d x +c \right ) a^{3} b^{4}+\cos \left (d x +c \right ) a \,b^{6}+\sin \left (d x +c \right ) a^{6} b +3 \sin \left (d x +c \right ) a^{4} b^{3}+3 \sin \left (d x +c \right ) a^{2} b^{5}+\sin \left (d x +c \right ) b^{7}\right )} \] Input:
int(cos(d*x+c)^2/(a+b*tan(d*x+c))^2,x)
Output:
( - 8*cos(c + d*x)*log(tan((c + d*x)/2)**2 + 1)*a**2*b**4 + 8*cos(c + d*x) *log(tan((c + d*x)/2)**2*a - 2*tan((c + d*x)/2)*b - a)*a**2*b**4 - cos(c + d*x)*sin(c + d*x)**2*a**4*b**2 - 2*cos(c + d*x)*sin(c + d*x)**2*a**2*b**4 - cos(c + d*x)*sin(c + d*x)**2*b**6 - cos(c + d*x)*a**6 + cos(c + d*x)*a* *5*b*d*x + 6*cos(c + d*x)*a**3*b**3*d*x - cos(c + d*x)*a**2*b**4 - 3*cos(c + d*x)*a*b**5*d*x - 2*cos(c + d*x)*b**6 - 8*log(tan((c + d*x)/2)**2 + 1)* sin(c + d*x)*a*b**5 + 8*log(tan((c + d*x)/2)**2*a - 2*tan((c + d*x)/2)*b - a)*sin(c + d*x)*a*b**5 - sin(c + d*x)**3*a**5*b - 2*sin(c + d*x)**3*a**3* b**3 - sin(c + d*x)**3*a*b**5 + sin(c + d*x)*a**4*b**2*d*x + 6*sin(c + d*x )*a**2*b**4*d*x - 3*sin(c + d*x)*b**6*d*x)/(2*b*d*(cos(c + d*x)*a**7 + 3*c os(c + d*x)*a**5*b**2 + 3*cos(c + d*x)*a**3*b**4 + cos(c + d*x)*a*b**6 + s in(c + d*x)*a**6*b + 3*sin(c + d*x)*a**4*b**3 + 3*sin(c + d*x)*a**2*b**5 + sin(c + d*x)*b**7))