Integrand size = 21, antiderivative size = 150 \[ \int \frac {\tan ^4(c+d x)}{(a+b \sec (c+d x))^2} \, dx=\frac {x}{a^2}-\frac {2 a \text {arctanh}(\sin (c+d x))}{b^3 d}+\frac {2 \sqrt {a-b} \sqrt {a+b} \left (2 a^2+b^2\right ) \text {arctanh}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{a^2 b^3 d}+\frac {\left (2 a^2-b^2\right ) \sin (c+d x)}{a b^2 d (b+a \cos (c+d x))}+\frac {\tan (c+d x)}{b d (b+a \cos (c+d x))} \] Output:
x/a^2-2*a*arctanh(sin(d*x+c))/b^3/d+2*(a-b)^(1/2)*(a+b)^(1/2)*(2*a^2+b^2)* arctanh((a-b)^(1/2)*tan(1/2*d*x+1/2*c)/(a+b)^(1/2))/a^2/b^3/d+(2*a^2-b^2)* sin(d*x+c)/a/b^2/d/(b+a*cos(d*x+c))+tan(d*x+c)/b/d/(b+a*cos(d*x+c))
Leaf count is larger than twice the leaf count of optimal. \(327\) vs. \(2(150)=300\).
Time = 1.44 (sec) , antiderivative size = 327, normalized size of antiderivative = 2.18 \[ \int \frac {\tan ^4(c+d x)}{(a+b \sec (c+d x))^2} \, dx=\frac {(b+a \cos (c+d x)) \sec ^2(c+d x) \left (\frac {(c+d x) (b+a \cos (c+d x))}{a^2}+\frac {2 \left (-2 a^4+a^2 b^2+b^4\right ) \text {arctanh}\left (\frac {(-a+b) \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2-b^2}}\right ) (b+a \cos (c+d x))}{a^2 b^3 \sqrt {a^2-b^2}}+\frac {2 a (b+a \cos (c+d x)) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )}{b^3}-\frac {2 a (b+a \cos (c+d x)) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )}{b^3}+\frac {(b+a \cos (c+d x)) \sin \left (\frac {1}{2} (c+d x)\right )}{b^2 \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )}+\frac {(b+a \cos (c+d x)) \sin \left (\frac {1}{2} (c+d x)\right )}{b^2 \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )}+\frac {\left (a^2-b^2\right ) \sin (c+d x)}{a b^2}\right )}{d (a+b \sec (c+d x))^2} \] Input:
Integrate[Tan[c + d*x]^4/(a + b*Sec[c + d*x])^2,x]
Output:
((b + a*Cos[c + d*x])*Sec[c + d*x]^2*(((c + d*x)*(b + a*Cos[c + d*x]))/a^2 + (2*(-2*a^4 + a^2*b^2 + b^4)*ArcTanh[((-a + b)*Tan[(c + d*x)/2])/Sqrt[a^ 2 - b^2]]*(b + a*Cos[c + d*x]))/(a^2*b^3*Sqrt[a^2 - b^2]) + (2*a*(b + a*Co s[c + d*x])*Log[Cos[(c + d*x)/2] - Sin[(c + d*x)/2]])/b^3 - (2*a*(b + a*Co s[c + d*x])*Log[Cos[(c + d*x)/2] + Sin[(c + d*x)/2]])/b^3 + ((b + a*Cos[c + d*x])*Sin[(c + d*x)/2])/(b^2*(Cos[(c + d*x)/2] - Sin[(c + d*x)/2])) + (( b + a*Cos[c + d*x])*Sin[(c + d*x)/2])/(b^2*(Cos[(c + d*x)/2] + Sin[(c + d* x)/2])) + ((a^2 - b^2)*Sin[c + d*x])/(a*b^2)))/(d*(a + b*Sec[c + d*x])^2)
Time = 0.84 (sec) , antiderivative size = 174, normalized size of antiderivative = 1.16, number of steps used = 12, number of rules used = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.524, Rules used = {3042, 4386, 3042, 3369, 25, 3042, 3536, 3042, 3138, 221, 4257}
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 ^4(c+d x)}{(a+b \sec (c+d x))^2} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\cot \left (c+d x+\frac {\pi }{2}\right )^4}{\left (a+b \csc \left (c+d x+\frac {\pi }{2}\right )\right )^2}dx\) |
\(\Big \downarrow \) 4386 |
\(\displaystyle \int \frac {\sin ^2(c+d x) \tan ^2(c+d x)}{(a \cos (c+d x)+b)^2}dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\cos \left (c+d x+\frac {\pi }{2}\right )^4}{\sin \left (c+d x+\frac {\pi }{2}\right )^2 \left (a \sin \left (c+d x+\frac {\pi }{2}\right )+b\right )^2}dx\) |
\(\Big \downarrow \) 3369 |
\(\displaystyle \frac {\int -\frac {\left (2 a^2+b \cos (c+d x) a-b^2 \cos ^2(c+d x)\right ) \sec (c+d x)}{b+a \cos (c+d x)}dx}{a b^2}+\frac {\left (2 a^2-b^2\right ) \sin (c+d x)}{a b^2 d (a \cos (c+d x)+b)}+\frac {\tan (c+d x)}{b d (a \cos (c+d x)+b)}\) |
\(\Big \downarrow \) 25 |
\(\displaystyle -\frac {\int \frac {\left (2 a^2+b \cos (c+d x) a-b^2 \cos ^2(c+d x)\right ) \sec (c+d x)}{b+a \cos (c+d x)}dx}{a b^2}+\frac {\left (2 a^2-b^2\right ) \sin (c+d x)}{a b^2 d (a \cos (c+d x)+b)}+\frac {\tan (c+d x)}{b d (a \cos (c+d x)+b)}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle -\frac {\int \frac {2 a^2+b \sin \left (c+d x+\frac {\pi }{2}\right ) a-b^2 \sin \left (c+d x+\frac {\pi }{2}\right )^2}{\sin \left (c+d x+\frac {\pi }{2}\right ) \left (b+a \sin \left (c+d x+\frac {\pi }{2}\right )\right )}dx}{a b^2}+\frac {\left (2 a^2-b^2\right ) \sin (c+d x)}{a b^2 d (a \cos (c+d x)+b)}+\frac {\tan (c+d x)}{b d (a \cos (c+d x)+b)}\) |
\(\Big \downarrow \) 3536 |
\(\displaystyle -\frac {-\frac {\left (a^2-b^2\right ) \left (2 a^2+b^2\right ) \int \frac {1}{b+a \cos (c+d x)}dx}{a b}+\frac {2 a^2 \int \sec (c+d x)dx}{b}-\frac {b^2 x}{a}}{a b^2}+\frac {\left (2 a^2-b^2\right ) \sin (c+d x)}{a b^2 d (a \cos (c+d x)+b)}+\frac {\tan (c+d x)}{b d (a \cos (c+d x)+b)}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle -\frac {-\frac {\left (a^2-b^2\right ) \left (2 a^2+b^2\right ) \int \frac {1}{b+a \sin \left (c+d x+\frac {\pi }{2}\right )}dx}{a b}+\frac {2 a^2 \int \csc \left (c+d x+\frac {\pi }{2}\right )dx}{b}-\frac {b^2 x}{a}}{a b^2}+\frac {\left (2 a^2-b^2\right ) \sin (c+d x)}{a b^2 d (a \cos (c+d x)+b)}+\frac {\tan (c+d x)}{b d (a \cos (c+d x)+b)}\) |
\(\Big \downarrow \) 3138 |
\(\displaystyle -\frac {-\frac {2 \left (a^2-b^2\right ) \left (2 a^2+b^2\right ) \int \frac {1}{-\left ((a-b) \tan ^2\left (\frac {1}{2} (c+d x)\right )\right )+a+b}d\tan \left (\frac {1}{2} (c+d x)\right )}{a b d}+\frac {2 a^2 \int \csc \left (c+d x+\frac {\pi }{2}\right )dx}{b}-\frac {b^2 x}{a}}{a b^2}+\frac {\left (2 a^2-b^2\right ) \sin (c+d x)}{a b^2 d (a \cos (c+d x)+b)}+\frac {\tan (c+d x)}{b d (a \cos (c+d x)+b)}\) |
\(\Big \downarrow \) 221 |
\(\displaystyle -\frac {\frac {2 a^2 \int \csc \left (c+d x+\frac {\pi }{2}\right )dx}{b}-\frac {2 \left (a^2-b^2\right ) \left (2 a^2+b^2\right ) \text {arctanh}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{a b d \sqrt {a-b} \sqrt {a+b}}-\frac {b^2 x}{a}}{a b^2}+\frac {\left (2 a^2-b^2\right ) \sin (c+d x)}{a b^2 d (a \cos (c+d x)+b)}+\frac {\tan (c+d x)}{b d (a \cos (c+d x)+b)}\) |
\(\Big \downarrow \) 4257 |
\(\displaystyle -\frac {-\frac {2 \left (a^2-b^2\right ) \left (2 a^2+b^2\right ) \text {arctanh}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{a b d \sqrt {a-b} \sqrt {a+b}}+\frac {2 a^2 \text {arctanh}(\sin (c+d x))}{b d}-\frac {b^2 x}{a}}{a b^2}+\frac {\left (2 a^2-b^2\right ) \sin (c+d x)}{a b^2 d (a \cos (c+d x)+b)}+\frac {\tan (c+d x)}{b d (a \cos (c+d x)+b)}\) |
Input:
Int[Tan[c + d*x]^4/(a + b*Sec[c + d*x])^2,x]
Output:
-((-((b^2*x)/a) + (2*a^2*ArcTanh[Sin[c + d*x]])/(b*d) - (2*(a^2 - b^2)*(2* a^2 + b^2)*ArcTanh[(Sqrt[a - b]*Tan[(c + d*x)/2])/Sqrt[a + b]])/(a*Sqrt[a - b]*b*Sqrt[a + b]*d))/(a*b^2)) + ((2*a^2 - b^2)*Sin[c + d*x])/(a*b^2*d*(b + a*Cos[c + d*x])) + Tan[c + d*x]/(b*d*(b + a*Cos[c + d*x]))
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[-a/b, 2]/a)*ArcTanh[x /Rt[-a/b, 2]], x] /; FreeQ[{a, b}, x] && NegQ[a/b]
Int[((a_) + (b_.)*sin[Pi/2 + (c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> With[{ e = FreeFactors[Tan[(c + d*x)/2], x]}, Simp[2*(e/d) Subst[Int[1/(a + b + (a - b)*e^2*x^2), x], x, Tan[(c + d*x)/2]/e], x]] /; FreeQ[{a, b, c, d}, x] && NeQ[a^2 - b^2, 0]
Int[cos[(e_.) + (f_.)*(x_)]^4*((d_.)*sin[(e_.) + (f_.)*(x_)])^(n_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_), x_Symbol] :> Simp[Cos[e + f*x]*(d*Sin[ e + f*x])^(n + 1)*((a + b*Sin[e + f*x])^(m + 1)/(a*d*f*(n + 1))), x] + (-Si mp[(a^2*(n + 1) - b^2*(m + n + 2))*Cos[e + f*x]*(d*Sin[e + f*x])^(n + 2)*(( a + b*Sin[e + f*x])^(m + 1)/(a^2*b*d^2*f*(n + 1)*(m + 1))), x] + Simp[1/(a^ 2*b*d*(n + 1)*(m + 1)) Int[(d*Sin[e + f*x])^(n + 1)*(a + b*Sin[e + f*x])^ (m + 1)*Simp[a^2*(n + 1)*(n + 2) - b^2*(m + n + 2)*(m + n + 3) + a*b*(m + 1 )*Sin[e + f*x] - (a^2*(n + 1)*(n + 3) - b^2*(m + n + 2)*(m + n + 4))*Sin[e + f*x]^2, x], x], x]) /; FreeQ[{a, b, d, e, f}, x] && NeQ[a^2 - b^2, 0] && IntegersQ[2*m, 2*n] && LtQ[m, -1] && LtQ[n, -1]
Int[((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)] + (C_.)*sin[(e_.) + (f_.)*(x_)]^ 2)/(((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*sin[(e_.) + (f_.) *(x_)])), x_Symbol] :> Simp[C*(x/(b*d)), x] + (Simp[(A*b^2 - a*b*B + a^2*C) /(b*(b*c - a*d)) Int[1/(a + b*Sin[e + f*x]), x], x] - Simp[(c^2*C - B*c*d + A*d^2)/(d*(b*c - a*d)) Int[1/(c + d*Sin[e + f*x]), x], x]) /; FreeQ[{a , b, c, d, e, f, A, B, C}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0]
Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]
Int[cot[(c_.) + (d_.)*(x_)]^(m_.)*(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_))^(n _), x_Symbol] :> Int[Cos[c + d*x]^m*((b + a*Sin[c + d*x])^n/Sin[c + d*x]^(m + n)), x] /; FreeQ[{a, b, c, d}, x] && NeQ[a^2 - b^2, 0] && IntegerQ[n] && IntegerQ[m] && (IntegerQ[m/2] || LeQ[m, 1])
Time = 0.67 (sec) , antiderivative size = 219, normalized size of antiderivative = 1.46
method | result | size |
derivativedivides | \(\frac {-\frac {1}{b^{2} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}+\frac {2 a \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{b^{3}}+\frac {2 \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a^{2}}-\frac {2 \left (\frac {\left (a^{3} b -a \,b^{3}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} a -\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} b -a -b}-\frac {\left (2 a^{4}-a^{2} b^{2}-b^{4}\right ) \operatorname {arctanh}\left (\frac {\left (a -b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\sqrt {\left (a +b \right ) \left (a -b \right )}}\right )}{\sqrt {\left (a +b \right ) \left (a -b \right )}}\right )}{a^{2} b^{3}}-\frac {1}{b^{2} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}-\frac {2 a \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{b^{3}}}{d}\) | \(219\) |
default | \(\frac {-\frac {1}{b^{2} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}+\frac {2 a \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{b^{3}}+\frac {2 \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a^{2}}-\frac {2 \left (\frac {\left (a^{3} b -a \,b^{3}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} a -\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} b -a -b}-\frac {\left (2 a^{4}-a^{2} b^{2}-b^{4}\right ) \operatorname {arctanh}\left (\frac {\left (a -b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\sqrt {\left (a +b \right ) \left (a -b \right )}}\right )}{\sqrt {\left (a +b \right ) \left (a -b \right )}}\right )}{a^{2} b^{3}}-\frac {1}{b^{2} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}-\frac {2 a \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{b^{3}}}{d}\) | \(219\) |
risch | \(\frac {x}{a^{2}}+\frac {2 i \left (a^{2} b \,{\mathrm e}^{3 i \left (d x +c \right )}-b^{3} {\mathrm e}^{3 i \left (d x +c \right )}+2 a^{3} {\mathrm e}^{2 i \left (d x +c \right )}-a \,b^{2} {\mathrm e}^{2 i \left (d x +c \right )}+3 a^{2} b \,{\mathrm e}^{i \left (d x +c \right )}-b^{3} {\mathrm e}^{i \left (d x +c \right )}+2 a^{3}-a \,b^{2}\right )}{a^{2} b^{2} d \left (a \,{\mathrm e}^{2 i \left (d x +c \right )}+2 b \,{\mathrm e}^{i \left (d x +c \right )}+a \right ) \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}-\frac {2 a \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{d \,b^{3}}+\frac {2 \sqrt {a^{2}-b^{2}}\, \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i \sqrt {a^{2}-b^{2}}+b}{a}\right )}{d \,b^{3}}+\frac {\sqrt {a^{2}-b^{2}}\, \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i \sqrt {a^{2}-b^{2}}+b}{a}\right )}{d b \,a^{2}}-\frac {2 \sqrt {a^{2}-b^{2}}\, \ln \left ({\mathrm e}^{i \left (d x +c \right )}-\frac {i \sqrt {a^{2}-b^{2}}-b}{a}\right )}{d \,b^{3}}-\frac {\sqrt {a^{2}-b^{2}}\, \ln \left ({\mathrm e}^{i \left (d x +c \right )}-\frac {i \sqrt {a^{2}-b^{2}}-b}{a}\right )}{d b \,a^{2}}+\frac {2 a \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{d \,b^{3}}\) | \(412\) |
Input:
int(tan(d*x+c)^4/(a+b*sec(d*x+c))^2,x,method=_RETURNVERBOSE)
Output:
1/d*(-1/b^2/(tan(1/2*d*x+1/2*c)-1)+2*a/b^3*ln(tan(1/2*d*x+1/2*c)-1)+2/a^2* arctan(tan(1/2*d*x+1/2*c))-2/a^2/b^3*((a^3*b-a*b^3)*tan(1/2*d*x+1/2*c)/(ta n(1/2*d*x+1/2*c)^2*a-tan(1/2*d*x+1/2*c)^2*b-a-b)-(2*a^4-a^2*b^2-b^4)/((a+b )*(a-b))^(1/2)*arctanh((a-b)*tan(1/2*d*x+1/2*c)/((a+b)*(a-b))^(1/2)))-1/b^ 2/(tan(1/2*d*x+1/2*c)+1)-2*a/b^3*ln(tan(1/2*d*x+1/2*c)+1))
Time = 0.20 (sec) , antiderivative size = 584, normalized size of antiderivative = 3.89 \[ \int \frac {\tan ^4(c+d x)}{(a+b \sec (c+d x))^2} \, dx=\left [\frac {2 \, a b^{3} d x \cos \left (d x + c\right )^{2} + 2 \, b^{4} d x \cos \left (d x + c\right ) + {\left ({\left (2 \, a^{3} + a b^{2}\right )} \cos \left (d x + c\right )^{2} + {\left (2 \, a^{2} b + b^{3}\right )} \cos \left (d x + c\right )\right )} \sqrt {a^{2} - b^{2}} \log \left (\frac {2 \, a b \cos \left (d x + c\right ) - {\left (a^{2} - 2 \, b^{2}\right )} \cos \left (d x + c\right )^{2} + 2 \, \sqrt {a^{2} - b^{2}} {\left (b \cos \left (d x + c\right ) + a\right )} \sin \left (d x + c\right ) + 2 \, a^{2} - b^{2}}{a^{2} \cos \left (d x + c\right )^{2} + 2 \, a b \cos \left (d x + c\right ) + b^{2}}\right ) - 2 \, {\left (a^{4} \cos \left (d x + c\right )^{2} + a^{3} b \cos \left (d x + c\right )\right )} \log \left (\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (a^{4} \cos \left (d x + c\right )^{2} + a^{3} b \cos \left (d x + c\right )\right )} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (a^{2} b^{2} + {\left (2 \, a^{3} b - a b^{3}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{2 \, {\left (a^{3} b^{3} d \cos \left (d x + c\right )^{2} + a^{2} b^{4} d \cos \left (d x + c\right )\right )}}, \frac {a b^{3} d x \cos \left (d x + c\right )^{2} + b^{4} d x \cos \left (d x + c\right ) + {\left ({\left (2 \, a^{3} + a b^{2}\right )} \cos \left (d x + c\right )^{2} + {\left (2 \, a^{2} b + b^{3}\right )} \cos \left (d x + c\right )\right )} \sqrt {-a^{2} + b^{2}} \arctan \left (-\frac {\sqrt {-a^{2} + b^{2}} {\left (b \cos \left (d x + c\right ) + a\right )}}{{\left (a^{2} - b^{2}\right )} \sin \left (d x + c\right )}\right ) - {\left (a^{4} \cos \left (d x + c\right )^{2} + a^{3} b \cos \left (d x + c\right )\right )} \log \left (\sin \left (d x + c\right ) + 1\right ) + {\left (a^{4} \cos \left (d x + c\right )^{2} + a^{3} b \cos \left (d x + c\right )\right )} \log \left (-\sin \left (d x + c\right ) + 1\right ) + {\left (a^{2} b^{2} + {\left (2 \, a^{3} b - a b^{3}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{a^{3} b^{3} d \cos \left (d x + c\right )^{2} + a^{2} b^{4} d \cos \left (d x + c\right )}\right ] \] Input:
integrate(tan(d*x+c)^4/(a+b*sec(d*x+c))^2,x, algorithm="fricas")
Output:
[1/2*(2*a*b^3*d*x*cos(d*x + c)^2 + 2*b^4*d*x*cos(d*x + c) + ((2*a^3 + a*b^ 2)*cos(d*x + c)^2 + (2*a^2*b + b^3)*cos(d*x + c))*sqrt(a^2 - b^2)*log((2*a *b*cos(d*x + c) - (a^2 - 2*b^2)*cos(d*x + c)^2 + 2*sqrt(a^2 - b^2)*(b*cos( d*x + c) + a)*sin(d*x + c) + 2*a^2 - b^2)/(a^2*cos(d*x + c)^2 + 2*a*b*cos( d*x + c) + b^2)) - 2*(a^4*cos(d*x + c)^2 + a^3*b*cos(d*x + c))*log(sin(d*x + c) + 1) + 2*(a^4*cos(d*x + c)^2 + a^3*b*cos(d*x + c))*log(-sin(d*x + c) + 1) + 2*(a^2*b^2 + (2*a^3*b - a*b^3)*cos(d*x + c))*sin(d*x + c))/(a^3*b^ 3*d*cos(d*x + c)^2 + a^2*b^4*d*cos(d*x + c)), (a*b^3*d*x*cos(d*x + c)^2 + b^4*d*x*cos(d*x + c) + ((2*a^3 + a*b^2)*cos(d*x + c)^2 + (2*a^2*b + b^3)*c os(d*x + c))*sqrt(-a^2 + b^2)*arctan(-sqrt(-a^2 + b^2)*(b*cos(d*x + c) + a )/((a^2 - b^2)*sin(d*x + c))) - (a^4*cos(d*x + c)^2 + a^3*b*cos(d*x + c))* log(sin(d*x + c) + 1) + (a^4*cos(d*x + c)^2 + a^3*b*cos(d*x + c))*log(-sin (d*x + c) + 1) + (a^2*b^2 + (2*a^3*b - a*b^3)*cos(d*x + c))*sin(d*x + c))/ (a^3*b^3*d*cos(d*x + c)^2 + a^2*b^4*d*cos(d*x + c))]
\[ \int \frac {\tan ^4(c+d x)}{(a+b \sec (c+d x))^2} \, dx=\int \frac {\tan ^{4}{\left (c + d x \right )}}{\left (a + b \sec {\left (c + d x \right )}\right )^{2}}\, dx \] Input:
integrate(tan(d*x+c)**4/(a+b*sec(d*x+c))**2,x)
Output:
Integral(tan(c + d*x)**4/(a + b*sec(c + d*x))**2, x)
Exception generated. \[ \int \frac {\tan ^4(c+d x)}{(a+b \sec (c+d x))^2} \, dx=\text {Exception raised: ValueError} \] Input:
integrate(tan(d*x+c)^4/(a+b*sec(d*x+c))^2,x, algorithm="maxima")
Output:
Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'assume' command before evaluation *may* help (example of legal syntax is 'assume(4*a^2-4*b^2>0)', see `assume?` f or more de
Leaf count of result is larger than twice the leaf count of optimal. 294 vs. \(2 (141) = 282\).
Time = 0.30 (sec) , antiderivative size = 294, normalized size of antiderivative = 1.96 \[ \int \frac {\tan ^4(c+d x)}{(a+b \sec (c+d x))^2} \, dx=\frac {\frac {d x + c}{a^{2}} - \frac {2 \, a \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right )}{b^{3}} + \frac {2 \, a \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right )}{b^{3}} - \frac {2 \, {\left (2 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 2 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 2 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a + b\right )} a b^{2}} + \frac {2 \, {\left (2 \, a^{4} - a^{2} b^{2} - b^{4}\right )} {\left (\pi \left \lfloor \frac {d x + c}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (-2 \, a + 2 \, b\right ) + \arctan \left (-\frac {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\sqrt {-a^{2} + b^{2}}}\right )\right )}}{\sqrt {-a^{2} + b^{2}} a^{2} b^{3}}}{d} \] Input:
integrate(tan(d*x+c)^4/(a+b*sec(d*x+c))^2,x, algorithm="giac")
Output:
((d*x + c)/a^2 - 2*a*log(abs(tan(1/2*d*x + 1/2*c) + 1))/b^3 + 2*a*log(abs( tan(1/2*d*x + 1/2*c) - 1))/b^3 - 2*(2*a^2*tan(1/2*d*x + 1/2*c)^3 - a*b*tan (1/2*d*x + 1/2*c)^3 - b^2*tan(1/2*d*x + 1/2*c)^3 - 2*a^2*tan(1/2*d*x + 1/2 *c) - a*b*tan(1/2*d*x + 1/2*c) + b^2*tan(1/2*d*x + 1/2*c))/((a*tan(1/2*d*x + 1/2*c)^4 - b*tan(1/2*d*x + 1/2*c)^4 - 2*a*tan(1/2*d*x + 1/2*c)^2 + a + b)*a*b^2) + 2*(2*a^4 - a^2*b^2 - b^4)*(pi*floor(1/2*(d*x + c)/pi + 1/2)*sg n(-2*a + 2*b) + arctan(-(a*tan(1/2*d*x + 1/2*c) - b*tan(1/2*d*x + 1/2*c))/ sqrt(-a^2 + b^2)))/(sqrt(-a^2 + b^2)*a^2*b^3))/d
Time = 12.57 (sec) , antiderivative size = 7044, normalized size of antiderivative = 46.96 \[ \int \frac {\tan ^4(c+d x)}{(a+b \sec (c+d x))^2} \, dx=\text {Too large to display} \] Input:
int(tan(c + d*x)^4/(a + b/cos(c + d*x))^2,x)
Output:
(2*atan((((((((((8192*(8*a^5*b^13 - 3*a^4*b^14 - 9*a^6*b^12 + 5*a^7*b^11 + 6*a^8*b^10 - 13*a^9*b^9 + 6*a^10*b^8))/(a^3*b^8) - (tan(c/2 + (d*x)/2)*(2 *a^6*b^15 - 6*a^7*b^14 + 8*a^8*b^13 - 8*a^9*b^12 + 6*a^10*b^11 - 2*a^11*b^ 10)*8192i)/(a^6*b^8))*1i)/a^2 - (8192*tan(c/2 + (d*x)/2)*(2*a^2*b^15 - 6*a ^3*b^14 + 10*a^4*b^13 - 10*a^5*b^12 + a^6*b^11 + 3*a^7*b^10 - 9*a^8*b^9 + 25*a^9*b^8 - 28*a^10*b^7 + 28*a^11*b^6 - 24*a^12*b^5 + 8*a^13*b^4))/(a^4*b ^8))*1i)/a^2 - (8192*(3*b^14 - 5*a*b^13 + 6*a^2*b^12 - 8*a^3*b^11 - 5*a^4* b^10 + 11*a^5*b^9 - 18*a^6*b^8 + 40*a^7*b^7 - 34*a^8*b^6 + 14*a^9*b^5 + 24 *a^10*b^4 - 52*a^11*b^3 + 24*a^12*b^2))/(a^3*b^8))*1i)/a^2 + (8192*tan(c/2 + (d*x)/2)*(16*a^12*b - a*b^12 - 16*a^13 + b^13 + 2*a^2*b^11 - 2*a^3*b^10 + 5*a^4*b^9 - 21*a^5*b^8 + 44*a^6*b^7 - 44*a^7*b^6 + 12*a^8*b^5 + 4*a^9*b ^4 - 16*a^10*b^3 + 16*a^11*b^2))/(a^4*b^8))/a^2 - ((((((((8192*(8*a^5*b^13 - 3*a^4*b^14 - 9*a^6*b^12 + 5*a^7*b^11 + 6*a^8*b^10 - 13*a^9*b^9 + 6*a^10 *b^8))/(a^3*b^8) + (tan(c/2 + (d*x)/2)*(2*a^6*b^15 - 6*a^7*b^14 + 8*a^8*b^ 13 - 8*a^9*b^12 + 6*a^10*b^11 - 2*a^11*b^10)*8192i)/(a^6*b^8))*1i)/a^2 + ( 8192*tan(c/2 + (d*x)/2)*(2*a^2*b^15 - 6*a^3*b^14 + 10*a^4*b^13 - 10*a^5*b^ 12 + a^6*b^11 + 3*a^7*b^10 - 9*a^8*b^9 + 25*a^9*b^8 - 28*a^10*b^7 + 28*a^1 1*b^6 - 24*a^12*b^5 + 8*a^13*b^4))/(a^4*b^8))*1i)/a^2 - (8192*(3*b^14 - 5* a*b^13 + 6*a^2*b^12 - 8*a^3*b^11 - 5*a^4*b^10 + 11*a^5*b^9 - 18*a^6*b^8 + 40*a^7*b^7 - 34*a^8*b^6 + 14*a^9*b^5 + 24*a^10*b^4 - 52*a^11*b^3 + 24*a...
Time = 0.16 (sec) , antiderivative size = 599, normalized size of antiderivative = 3.99 \[ \int \frac {\tan ^4(c+d x)}{(a+b \sec (c+d x))^2} \, dx =\text {Too large to display} \] Input:
int(tan(d*x+c)^4/(a+b*sec(d*x+c))^2,x)
Output:
(4*sqrt( - a**2 + b**2)*atan((tan((c + d*x)/2)*a - tan((c + d*x)/2)*b)/sqr t( - a**2 + b**2))*cos(c + d*x)*a**2*b + 2*sqrt( - a**2 + b**2)*atan((tan( (c + d*x)/2)*a - tan((c + d*x)/2)*b)/sqrt( - a**2 + b**2))*cos(c + d*x)*b* *3 - 4*sqrt( - a**2 + b**2)*atan((tan((c + d*x)/2)*a - tan((c + d*x)/2)*b) /sqrt( - a**2 + b**2))*sin(c + d*x)**2*a**3 - 2*sqrt( - a**2 + b**2)*atan( (tan((c + d*x)/2)*a - tan((c + d*x)/2)*b)/sqrt( - a**2 + b**2))*sin(c + d* x)**2*a*b**2 + 4*sqrt( - a**2 + b**2)*atan((tan((c + d*x)/2)*a - tan((c + d*x)/2)*b)/sqrt( - a**2 + b**2))*a**3 + 2*sqrt( - a**2 + b**2)*atan((tan(( c + d*x)/2)*a - tan((c + d*x)/2)*b)/sqrt( - a**2 + b**2))*a*b**2 + 2*cos(c + d*x)*log(tan((c + d*x)/2) - 1)*a**3*b - 2*cos(c + d*x)*log(tan((c + d*x )/2) + 1)*a**3*b + 2*cos(c + d*x)*sin(c + d*x)*a**3*b - cos(c + d*x)*sin(c + d*x)*a*b**3 + cos(c + d*x)*b**4*d*x - 2*log(tan((c + d*x)/2) - 1)*sin(c + d*x)**2*a**4 + 2*log(tan((c + d*x)/2) - 1)*a**4 + 2*log(tan((c + d*x)/2 ) + 1)*sin(c + d*x)**2*a**4 - 2*log(tan((c + d*x)/2) + 1)*a**4 - sin(c + d *x)**2*a*b**3*d*x + sin(c + d*x)*a**2*b**2 + a*b**3*d*x)/(a**2*b**3*d*(cos (c + d*x)*b - sin(c + d*x)**2*a + a))