\(\int \frac {x^2 \sec ^2(c+d x)}{a+b \tan ^2(c+d x)} \, dx\) [161]
Optimal result
Integrand size = 26, antiderivative size = 337 \[
\int \frac {x^2 \sec ^2(c+d x)}{a+b \tan ^2(c+d x)} \, dx=-\frac {i x^2 \log \left (1+\frac {(a-b) e^{2 i (c+d x)}}{\left (\sqrt {a}-\sqrt {b}\right )^2}\right )}{2 \sqrt {a} \sqrt {b} d}+\frac {i x^2 \log \left (1+\frac {(a-b) e^{2 i (c+d x)}}{\left (\sqrt {a}+\sqrt {b}\right )^2}\right )}{2 \sqrt {a} \sqrt {b} d}-\frac {x \operatorname {PolyLog}\left (2,-\frac {(a-b) e^{2 i (c+d x)}}{\left (\sqrt {a}-\sqrt {b}\right )^2}\right )}{2 \sqrt {a} \sqrt {b} d^2}+\frac {x \operatorname {PolyLog}\left (2,-\frac {(a-b) e^{2 i (c+d x)}}{\left (\sqrt {a}+\sqrt {b}\right )^2}\right )}{2 \sqrt {a} \sqrt {b} d^2}+\frac {i \operatorname {PolyLog}\left (3,-\frac {\left (\sqrt {a}-\sqrt {b}\right ) e^{2 i (c+d x)}}{\sqrt {a}+\sqrt {b}}\right )}{4 \sqrt {a} \sqrt {b} d^3}-\frac {i \operatorname {PolyLog}\left (3,-\frac {\left (\sqrt {a}+\sqrt {b}\right ) e^{2 i (c+d x)}}{\sqrt {a}-\sqrt {b}}\right )}{4 \sqrt {a} \sqrt {b} d^3}
\]
[Out]
-1/2*I*x^2*ln(1+(a-b)*exp(2*I*(d*x+c))/(a^(1/2)-b^(1/2))^2)/d/a^(1/2)/b^(1/2)+1/2*I*x^2*ln(1+(a-b)*exp(2*I*(d*
x+c))/(a^(1/2)+b^(1/2))^2)/d/a^(1/2)/b^(1/2)-1/2*x*polylog(2,-(a-b)*exp(2*I*(d*x+c))/(a^(1/2)-b^(1/2))^2)/d^2/
a^(1/2)/b^(1/2)+1/2*x*polylog(2,-(a-b)*exp(2*I*(d*x+c))/(a^(1/2)+b^(1/2))^2)/d^2/a^(1/2)/b^(1/2)+1/4*I*polylog
(3,-exp(2*I*(d*x+c))*(a^(1/2)-b^(1/2))/(a^(1/2)+b^(1/2)))/d^3/a^(1/2)/b^(1/2)-1/4*I*polylog(3,-exp(2*I*(d*x+c)
)*(a^(1/2)+b^(1/2))/(a^(1/2)-b^(1/2)))/d^3/a^(1/2)/b^(1/2)
Rubi [A] (verified)
Time = 1.00 (sec) , antiderivative size = 337, normalized size of antiderivative = 1.00, number of
steps used = 11, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.269, Rules used = {4684, 3402, 2296, 2221, 2611,
2320, 6724} \[
\int \frac {x^2 \sec ^2(c+d x)}{a+b \tan ^2(c+d x)} \, dx=\frac {i \operatorname {PolyLog}\left (3,-\frac {\left (\sqrt {a}-\sqrt {b}\right ) e^{2 i (c+d x)}}{\sqrt {a}+\sqrt {b}}\right )}{4 \sqrt {a} \sqrt {b} d^3}-\frac {i \operatorname {PolyLog}\left (3,-\frac {\left (\sqrt {a}+\sqrt {b}\right ) e^{2 i (c+d x)}}{\sqrt {a}-\sqrt {b}}\right )}{4 \sqrt {a} \sqrt {b} d^3}-\frac {x \operatorname {PolyLog}\left (2,-\frac {(a-b) e^{2 i (c+d x)}}{\left (\sqrt {a}-\sqrt {b}\right )^2}\right )}{2 \sqrt {a} \sqrt {b} d^2}+\frac {x \operatorname {PolyLog}\left (2,-\frac {(a-b) e^{2 i (c+d x)}}{\left (\sqrt {a}+\sqrt {b}\right )^2}\right )}{2 \sqrt {a} \sqrt {b} d^2}-\frac {i x^2 \log \left (1+\frac {(a-b) e^{2 i (c+d x)}}{\left (\sqrt {a}-\sqrt {b}\right )^2}\right )}{2 \sqrt {a} \sqrt {b} d}+\frac {i x^2 \log \left (1+\frac {(a-b) e^{2 i (c+d x)}}{\left (\sqrt {a}+\sqrt {b}\right )^2}\right )}{2 \sqrt {a} \sqrt {b} d}
\]
[In]
Int[(x^2*Sec[c + d*x]^2)/(a + b*Tan[c + d*x]^2),x]
[Out]
((-1/2*I)*x^2*Log[1 + ((a - b)*E^((2*I)*(c + d*x)))/(Sqrt[a] - Sqrt[b])^2])/(Sqrt[a]*Sqrt[b]*d) + ((I/2)*x^2*L
og[1 + ((a - b)*E^((2*I)*(c + d*x)))/(Sqrt[a] + Sqrt[b])^2])/(Sqrt[a]*Sqrt[b]*d) - (x*PolyLog[2, -(((a - b)*E^
((2*I)*(c + d*x)))/(Sqrt[a] - Sqrt[b])^2)])/(2*Sqrt[a]*Sqrt[b]*d^2) + (x*PolyLog[2, -(((a - b)*E^((2*I)*(c + d
*x)))/(Sqrt[a] + Sqrt[b])^2)])/(2*Sqrt[a]*Sqrt[b]*d^2) + ((I/4)*PolyLog[3, -(((Sqrt[a] - Sqrt[b])*E^((2*I)*(c
+ d*x)))/(Sqrt[a] + Sqrt[b]))])/(Sqrt[a]*Sqrt[b]*d^3) - ((I/4)*PolyLog[3, -(((Sqrt[a] + Sqrt[b])*E^((2*I)*(c +
d*x)))/(Sqrt[a] - Sqrt[b]))])/(Sqrt[a]*Sqrt[b]*d^3)
Rule 2221
Int[(((F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)*((c_.) + (d_.)*(x_))^(m_.))/((a_) + (b_.)*((F_)^((g_.)*((e_.) +
(f_.)*(x_))))^(n_.)), x_Symbol] :> Simp[((c + d*x)^m/(b*f*g*n*Log[F]))*Log[1 + b*((F^(g*(e + f*x)))^n/a)], x]
- Dist[d*(m/(b*f*g*n*Log[F])), Int[(c + d*x)^(m - 1)*Log[1 + b*((F^(g*(e + f*x)))^n/a)], x], x] /; FreeQ[{F,
a, b, c, d, e, f, g, n}, x] && IGtQ[m, 0]
Rule 2296
Int[((F_)^(u_)*((f_.) + (g_.)*(x_))^(m_.))/((a_.) + (b_.)*(F_)^(u_) + (c_.)*(F_)^(v_)), x_Symbol] :> With[{q =
Rt[b^2 - 4*a*c, 2]}, Dist[2*(c/q), Int[(f + g*x)^m*(F^u/(b - q + 2*c*F^u)), x], x] - Dist[2*(c/q), Int[(f + g
*x)^m*(F^u/(b + q + 2*c*F^u)), x], x]] /; FreeQ[{F, a, b, c, f, g}, x] && EqQ[v, 2*u] && LinearQ[u, x] && NeQ[
b^2 - 4*a*c, 0] && IGtQ[m, 0]
Rule 2320
Int[u_, x_Symbol] :> With[{v = FunctionOfExponential[u, x]}, Dist[v/D[v, x], Subst[Int[FunctionOfExponentialFu
nction[u, x]/x, x], x, v], x]] /; FunctionOfExponentialQ[u, x] && !MatchQ[u, (w_)*((a_.)*(v_)^(n_))^(m_) /; F
reeQ[{a, m, n}, x] && IntegerQ[m*n]] && !MatchQ[u, E^((c_.)*((a_.) + (b_.)*x))*(F_)[v_] /; FreeQ[{a, b, c}, x
] && InverseFunctionQ[F[x]]]
Rule 2611
Int[Log[1 + (e_.)*((F_)^((c_.)*((a_.) + (b_.)*(x_))))^(n_.)]*((f_.) + (g_.)*(x_))^(m_.), x_Symbol] :> Simp[(-(
f + g*x)^m)*(PolyLog[2, (-e)*(F^(c*(a + b*x)))^n]/(b*c*n*Log[F])), x] + Dist[g*(m/(b*c*n*Log[F])), Int[(f + g*
x)^(m - 1)*PolyLog[2, (-e)*(F^(c*(a + b*x)))^n], x], x] /; FreeQ[{F, a, b, c, e, f, g, n}, x] && GtQ[m, 0]
Rule 3402
Int[((c_.) + (d_.)*(x_))^(m_.)/((a_) + (b_.)*sin[(e_.) + Pi*(k_.) + (f_.)*(x_)]), x_Symbol] :> Dist[2, Int[(c
+ d*x)^m*E^(I*Pi*(k - 1/2))*(E^(I*(e + f*x))/(b + 2*a*E^(I*Pi*(k - 1/2))*E^(I*(e + f*x)) - b*E^(2*I*k*Pi)*E^(2
*I*(e + f*x)))), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && IntegerQ[2*k] && NeQ[a^2 - b^2, 0] && IGtQ[m, 0]
Rule 4684
Int[(((f_.) + (g_.)*(x_))^(m_.)*Sec[(d_.) + (e_.)*(x_)]^2)/((b_) + (c_.)*Tan[(d_.) + (e_.)*(x_)]^2), x_Symbol]
:> Dist[2, Int[(f + g*x)^m/(b + c + (b - c)*Cos[2*d + 2*e*x]), x], x] /; FreeQ[{b, c, d, e, f, g}, x] && IGtQ
[m, 0]
Rule 6724
Int[PolyLog[n_, (c_.)*((a_.) + (b_.)*(x_))^(p_.)]/((d_.) + (e_.)*(x_)), x_Symbol] :> Simp[PolyLog[n + 1, c*(a
+ b*x)^p]/(e*p), x] /; FreeQ[{a, b, c, d, e, n, p}, x] && EqQ[b*d, a*e]
Rubi steps \begin{align*}
\text {integral}& = 2 \int \frac {x^2}{a+b+(a-b) \cos (2 c+2 d x)} \, dx \\ & = 4 \int \frac {e^{i (2 c+2 d x)} x^2}{a-b+2 (a+b) e^{i (2 c+2 d x)}+(a-b) e^{2 i (2 c+2 d x)}} \, dx \\ & = \frac {(2 (a-b)) \int \frac {e^{i (2 c+2 d x)} x^2}{-4 \sqrt {a} \sqrt {b}+2 (a+b)+2 (a-b) e^{i (2 c+2 d x)}} \, dx}{\sqrt {a} \sqrt {b}}-\frac {(2 (a-b)) \int \frac {e^{i (2 c+2 d x)} x^2}{4 \sqrt {a} \sqrt {b}+2 (a+b)+2 (a-b) e^{i (2 c+2 d x)}} \, dx}{\sqrt {a} \sqrt {b}} \\ & = -\frac {i x^2 \log \left (1+\frac {(a-b) e^{2 i (c+d x)}}{\left (\sqrt {a}-\sqrt {b}\right )^2}\right )}{2 \sqrt {a} \sqrt {b} d}+\frac {i x^2 \log \left (1+\frac {(a-b) e^{2 i (c+d x)}}{\left (\sqrt {a}+\sqrt {b}\right )^2}\right )}{2 \sqrt {a} \sqrt {b} d}+\frac {i \int x \log \left (1+\frac {2 (a-b) e^{i (2 c+2 d x)}}{-4 \sqrt {a} \sqrt {b}+2 (a+b)}\right ) \, dx}{\sqrt {a} \sqrt {b} d}-\frac {i \int x \log \left (1+\frac {2 (a-b) e^{i (2 c+2 d x)}}{4 \sqrt {a} \sqrt {b}+2 (a+b)}\right ) \, dx}{\sqrt {a} \sqrt {b} d} \\ & = -\frac {i x^2 \log \left (1+\frac {(a-b) e^{2 i (c+d x)}}{\left (\sqrt {a}-\sqrt {b}\right )^2}\right )}{2 \sqrt {a} \sqrt {b} d}+\frac {i x^2 \log \left (1+\frac {(a-b) e^{2 i (c+d x)}}{\left (\sqrt {a}+\sqrt {b}\right )^2}\right )}{2 \sqrt {a} \sqrt {b} d}-\frac {x \operatorname {PolyLog}\left (2,-\frac {(a-b) e^{2 i (c+d x)}}{\left (\sqrt {a}-\sqrt {b}\right )^2}\right )}{2 \sqrt {a} \sqrt {b} d^2}+\frac {x \operatorname {PolyLog}\left (2,-\frac {(a-b) e^{2 i (c+d x)}}{\left (\sqrt {a}+\sqrt {b}\right )^2}\right )}{2 \sqrt {a} \sqrt {b} d^2}+\frac {\int \operatorname {PolyLog}\left (2,-\frac {2 (a-b) e^{i (2 c+2 d x)}}{-4 \sqrt {a} \sqrt {b}+2 (a+b)}\right ) \, dx}{2 \sqrt {a} \sqrt {b} d^2}-\frac {\int \operatorname {PolyLog}\left (2,-\frac {2 (a-b) e^{i (2 c+2 d x)}}{4 \sqrt {a} \sqrt {b}+2 (a+b)}\right ) \, dx}{2 \sqrt {a} \sqrt {b} d^2} \\ & = -\frac {i x^2 \log \left (1+\frac {(a-b) e^{2 i (c+d x)}}{\left (\sqrt {a}-\sqrt {b}\right )^2}\right )}{2 \sqrt {a} \sqrt {b} d}+\frac {i x^2 \log \left (1+\frac {(a-b) e^{2 i (c+d x)}}{\left (\sqrt {a}+\sqrt {b}\right )^2}\right )}{2 \sqrt {a} \sqrt {b} d}-\frac {x \operatorname {PolyLog}\left (2,-\frac {(a-b) e^{2 i (c+d x)}}{\left (\sqrt {a}-\sqrt {b}\right )^2}\right )}{2 \sqrt {a} \sqrt {b} d^2}+\frac {x \operatorname {PolyLog}\left (2,-\frac {(a-b) e^{2 i (c+d x)}}{\left (\sqrt {a}+\sqrt {b}\right )^2}\right )}{2 \sqrt {a} \sqrt {b} d^2}+\frac {i \text {Subst}\left (\int \frac {\operatorname {PolyLog}\left (2,\frac {\left (-\sqrt {a}+\sqrt {b}\right ) x}{\sqrt {a}+\sqrt {b}}\right )}{x} \, dx,x,e^{i (2 c+2 d x)}\right )}{4 \sqrt {a} \sqrt {b} d^3}-\frac {i \text {Subst}\left (\int \frac {\operatorname {PolyLog}\left (2,-\frac {\left (\sqrt {a}+\sqrt {b}\right ) x}{\sqrt {a}-\sqrt {b}}\right )}{x} \, dx,x,e^{i (2 c+2 d x)}\right )}{4 \sqrt {a} \sqrt {b} d^3} \\ & = -\frac {i x^2 \log \left (1+\frac {(a-b) e^{2 i (c+d x)}}{\left (\sqrt {a}-\sqrt {b}\right )^2}\right )}{2 \sqrt {a} \sqrt {b} d}+\frac {i x^2 \log \left (1+\frac {(a-b) e^{2 i (c+d x)}}{\left (\sqrt {a}+\sqrt {b}\right )^2}\right )}{2 \sqrt {a} \sqrt {b} d}-\frac {x \operatorname {PolyLog}\left (2,-\frac {(a-b) e^{2 i (c+d x)}}{\left (\sqrt {a}-\sqrt {b}\right )^2}\right )}{2 \sqrt {a} \sqrt {b} d^2}+\frac {x \operatorname {PolyLog}\left (2,-\frac {(a-b) e^{2 i (c+d x)}}{\left (\sqrt {a}+\sqrt {b}\right )^2}\right )}{2 \sqrt {a} \sqrt {b} d^2}+\frac {i \operatorname {PolyLog}\left (3,-\frac {\left (\sqrt {a}-\sqrt {b}\right ) e^{2 i (c+d x)}}{\sqrt {a}+\sqrt {b}}\right )}{4 \sqrt {a} \sqrt {b} d^3}-\frac {i \operatorname {PolyLog}\left (3,-\frac {\left (\sqrt {a}+\sqrt {b}\right ) e^{2 i (c+d x)}}{\sqrt {a}-\sqrt {b}}\right )}{4 \sqrt {a} \sqrt {b} d^3} \\
\end{align*}
Mathematica [A] (verified)
Time = 1.02 (sec) , antiderivative size = 294, normalized size of antiderivative = 0.87
\[
\int \frac {x^2 \sec ^2(c+d x)}{a+b \tan ^2(c+d x)} \, dx=\frac {i \left (2 d^2 x^2 \log \left (1+\frac {\left (\sqrt {a}-\sqrt {b}\right ) e^{2 i (c+d x)}}{\sqrt {a}+\sqrt {b}}\right )-2 d^2 x^2 \log \left (1+\frac {\left (\sqrt {a}+\sqrt {b}\right ) e^{2 i (c+d x)}}{\sqrt {a}-\sqrt {b}}\right )-2 i d x \operatorname {PolyLog}\left (2,\frac {\left (-\sqrt {a}+\sqrt {b}\right ) e^{2 i (c+d x)}}{\sqrt {a}+\sqrt {b}}\right )+2 i d x \operatorname {PolyLog}\left (2,-\frac {\left (\sqrt {a}+\sqrt {b}\right ) e^{2 i (c+d x)}}{\sqrt {a}-\sqrt {b}}\right )+\operatorname {PolyLog}\left (3,\frac {\left (-\sqrt {a}+\sqrt {b}\right ) e^{2 i (c+d x)}}{\sqrt {a}+\sqrt {b}}\right )-\operatorname {PolyLog}\left (3,-\frac {\left (\sqrt {a}+\sqrt {b}\right ) e^{2 i (c+d x)}}{\sqrt {a}-\sqrt {b}}\right )\right )}{4 \sqrt {a} \sqrt {b} d^3}
\]
[In]
Integrate[(x^2*Sec[c + d*x]^2)/(a + b*Tan[c + d*x]^2),x]
[Out]
((I/4)*(2*d^2*x^2*Log[1 + ((Sqrt[a] - Sqrt[b])*E^((2*I)*(c + d*x)))/(Sqrt[a] + Sqrt[b])] - 2*d^2*x^2*Log[1 + (
(Sqrt[a] + Sqrt[b])*E^((2*I)*(c + d*x)))/(Sqrt[a] - Sqrt[b])] - (2*I)*d*x*PolyLog[2, ((-Sqrt[a] + Sqrt[b])*E^(
(2*I)*(c + d*x)))/(Sqrt[a] + Sqrt[b])] + (2*I)*d*x*PolyLog[2, -(((Sqrt[a] + Sqrt[b])*E^((2*I)*(c + d*x)))/(Sqr
t[a] - Sqrt[b]))] + PolyLog[3, ((-Sqrt[a] + Sqrt[b])*E^((2*I)*(c + d*x)))/(Sqrt[a] + Sqrt[b])] - PolyLog[3, -(
((Sqrt[a] + Sqrt[b])*E^((2*I)*(c + d*x)))/(Sqrt[a] - Sqrt[b]))]))/(Sqrt[a]*Sqrt[b]*d^3)
Maple [B] (verified)
Both result and optimal contain complex but leaf count of result is larger than twice the leaf
count of optimal. 1250 vs. \(2 (253 ) = 506\).
Time = 2.10 (sec) , antiderivative size = 1251, normalized size of antiderivative =
3.71
| | |
method | result | size |
| | |
risch |
\(\text {Expression too large to display}\) |
\(1251\) |
| | |
|
|
|
[In]
int(x^2*sec(d*x+c)^2/(a+b*tan(d*x+c)^2),x,method=_RETURNVERBOSE)
[Out]
1/2*I/d^3/(a*b)^(1/2)/(-2*(a*b)^(1/2)-a-b)*a*ln(1-(a-b)*exp(2*I*(d*x+c))/(-2*(a*b)^(1/2)-a-b))*c^2-1/2*I/d/(a*
b)^(1/2)/(-2*(a*b)^(1/2)-a-b)*b*ln(1-(a-b)*exp(2*I*(d*x+c))/(-2*(a*b)^(1/2)-a-b))*x^2-1/2*I/d/(a*b)^(1/2)/(-2*
(a*b)^(1/2)-a-b)*a*ln(1-(a-b)*exp(2*I*(d*x+c))/(-2*(a*b)^(1/2)-a-b))*x^2+1/d^2/(a*b)^(1/2)*c^2*x-1/2/d^2/(a*b)
^(1/2)*polylog(2,(a-b)*exp(2*I*(d*x+c))/(2*(a*b)^(1/2)-a-b))*x+2/d^2/(-2*(a*b)^(1/2)-a-b)*c^2*x-1/d^2/(-2*(a*b
)^(1/2)-a-b)*polylog(2,(a-b)*exp(2*I*(d*x+c))/(-2*(a*b)^(1/2)-a-b))*x-1/3/(a*b)^(1/2)/(-2*(a*b)^(1/2)-a-b)*b*x
^3-1/3/(a*b)^(1/2)/(-2*(a*b)^(1/2)-a-b)*a*x^3-1/4*I/d^3/(a*b)^(1/2)*polylog(3,(a-b)*exp(2*I*(d*x+c))/(2*(a*b)^
(1/2)-a-b))-1/2*I/d^3/(-2*(a*b)^(1/2)-a-b)*polylog(3,(a-b)*exp(2*I*(d*x+c))/(-2*(a*b)^(1/2)-a-b))+1/2*I/d^3/(a
*b)^(1/2)/(-2*(a*b)^(1/2)-a-b)*b*ln(1-(a-b)*exp(2*I*(d*x+c))/(-2*(a*b)^(1/2)-a-b))*c^2+4/3/d^3/(-2*(a*b)^(1/2)
-a-b)*c^3+2/3/d^3/(a*b)^(1/2)*c^3+I/d^3/(-2*(a*b)^(1/2)-a-b)*ln(1-(a-b)*exp(2*I*(d*x+c))/(-2*(a*b)^(1/2)-a-b))
*c^2+I/d^3*c^2/(a*b)^(1/2)*arctanh(1/4*(2*(a-b)*exp(2*I*(d*x+c))+2*a+2*b)/(a*b)^(1/2))+2/3/d^3/(a*b)^(1/2)/(-2
*(a*b)^(1/2)-a-b)*a*c^3+2/3/d^3/(a*b)^(1/2)/(-2*(a*b)^(1/2)-a-b)*b*c^3-1/2*I/d/(a*b)^(1/2)*ln(1-(a-b)*exp(2*I*
(d*x+c))/(2*(a*b)^(1/2)-a-b))*x^2-I/d/(-2*(a*b)^(1/2)-a-b)*ln(1-(a-b)*exp(2*I*(d*x+c))/(-2*(a*b)^(1/2)-a-b))*x
^2+1/2*I/d^3/(a*b)^(1/2)*ln(1-(a-b)*exp(2*I*(d*x+c))/(2*(a*b)^(1/2)-a-b))*c^2-1/3/(a*b)^(1/2)*x^3-2/3/(-2*(a*b
)^(1/2)-a-b)*x^3-1/4*I/d^3/(a*b)^(1/2)/(-2*(a*b)^(1/2)-a-b)*b*polylog(3,(a-b)*exp(2*I*(d*x+c))/(-2*(a*b)^(1/2)
-a-b))-1/4*I/d^3/(a*b)^(1/2)/(-2*(a*b)^(1/2)-a-b)*a*polylog(3,(a-b)*exp(2*I*(d*x+c))/(-2*(a*b)^(1/2)-a-b))-1/2
/d^2/(a*b)^(1/2)/(-2*(a*b)^(1/2)-a-b)*a*polylog(2,(a-b)*exp(2*I*(d*x+c))/(-2*(a*b)^(1/2)-a-b))*x+1/d^2/(a*b)^(
1/2)/(-2*(a*b)^(1/2)-a-b)*b*c^2*x-1/2/d^2/(a*b)^(1/2)/(-2*(a*b)^(1/2)-a-b)*b*polylog(2,(a-b)*exp(2*I*(d*x+c))/
(-2*(a*b)^(1/2)-a-b))*x+1/d^2/(a*b)^(1/2)/(-2*(a*b)^(1/2)-a-b)*a*c^2*x
Fricas [B] (verification not implemented)
Both result and optimal contain complex but leaf count of result is larger than twice the leaf
count of optimal. 4568 vs. \(2 (247) = 494\).
Time = 2.29 (sec) , antiderivative size = 4568, normalized size of antiderivative = 13.55
\[
\int \frac {x^2 \sec ^2(c+d x)}{a+b \tan ^2(c+d x)} \, dx=\text {Too large to display}
\]
[In]
integrate(x^2*sec(d*x+c)^2/(a+b*tan(d*x+c)^2),x, algorithm="fricas")
[Out]
1/4*(2*(a - b)*sqrt(a*b/(a^2 - 2*a*b + b^2))*d*x*dilog(-(((a + b)*cos(d*x + c) + (I*a + I*b)*sin(d*x + c) - 2*
((a - b)*cos(d*x + c) + (I*a - I*b)*sin(d*x + c))*sqrt(a*b/(a^2 - 2*a*b + b^2)))*sqrt(-(2*(a - b)*sqrt(a*b/(a^
2 - 2*a*b + b^2)) + a + b)/(a - b)) + a - b)/(a - b) + 1) + 2*(a - b)*sqrt(a*b/(a^2 - 2*a*b + b^2))*d*x*dilog(
(((a + b)*cos(d*x + c) - (I*a + I*b)*sin(d*x + c) - 2*((a - b)*cos(d*x + c) - (I*a - I*b)*sin(d*x + c))*sqrt(a
*b/(a^2 - 2*a*b + b^2)))*sqrt(-(2*(a - b)*sqrt(a*b/(a^2 - 2*a*b + b^2)) + a + b)/(a - b)) - a + b)/(a - b) + 1
) + 2*(a - b)*sqrt(a*b/(a^2 - 2*a*b + b^2))*d*x*dilog(-(((a + b)*cos(d*x + c) + (-I*a - I*b)*sin(d*x + c) - 2*
((a - b)*cos(d*x + c) + (-I*a + I*b)*sin(d*x + c))*sqrt(a*b/(a^2 - 2*a*b + b^2)))*sqrt(-(2*(a - b)*sqrt(a*b/(a
^2 - 2*a*b + b^2)) + a + b)/(a - b)) + a - b)/(a - b) + 1) + 2*(a - b)*sqrt(a*b/(a^2 - 2*a*b + b^2))*d*x*dilog
((((a + b)*cos(d*x + c) - (-I*a - I*b)*sin(d*x + c) - 2*((a - b)*cos(d*x + c) - (-I*a + I*b)*sin(d*x + c))*sqr
t(a*b/(a^2 - 2*a*b + b^2)))*sqrt(-(2*(a - b)*sqrt(a*b/(a^2 - 2*a*b + b^2)) + a + b)/(a - b)) - a + b)/(a - b)
+ 1) - 2*(a - b)*sqrt(a*b/(a^2 - 2*a*b + b^2))*d*x*dilog(-(((a + b)*cos(d*x + c) + (I*a + I*b)*sin(d*x + c) +
2*((a - b)*cos(d*x + c) - (-I*a + I*b)*sin(d*x + c))*sqrt(a*b/(a^2 - 2*a*b + b^2)))*sqrt((2*(a - b)*sqrt(a*b/(
a^2 - 2*a*b + b^2)) - a - b)/(a - b)) + a - b)/(a - b) + 1) - 2*(a - b)*sqrt(a*b/(a^2 - 2*a*b + b^2))*d*x*dilo
g((((a + b)*cos(d*x + c) - (I*a + I*b)*sin(d*x + c) + 2*((a - b)*cos(d*x + c) + (-I*a + I*b)*sin(d*x + c))*sqr
t(a*b/(a^2 - 2*a*b + b^2)))*sqrt((2*(a - b)*sqrt(a*b/(a^2 - 2*a*b + b^2)) - a - b)/(a - b)) - a + b)/(a - b) +
1) - 2*(a - b)*sqrt(a*b/(a^2 - 2*a*b + b^2))*d*x*dilog(-(((a + b)*cos(d*x + c) + (-I*a - I*b)*sin(d*x + c) +
2*((a - b)*cos(d*x + c) - (I*a - I*b)*sin(d*x + c))*sqrt(a*b/(a^2 - 2*a*b + b^2)))*sqrt((2*(a - b)*sqrt(a*b/(a
^2 - 2*a*b + b^2)) - a - b)/(a - b)) + a - b)/(a - b) + 1) - 2*(a - b)*sqrt(a*b/(a^2 - 2*a*b + b^2))*d*x*dilog
((((a + b)*cos(d*x + c) - (-I*a - I*b)*sin(d*x + c) + 2*((a - b)*cos(d*x + c) + (I*a - I*b)*sin(d*x + c))*sqrt
(a*b/(a^2 - 2*a*b + b^2)))*sqrt((2*(a - b)*sqrt(a*b/(a^2 - 2*a*b + b^2)) - a - b)/(a - b)) - a + b)/(a - b) +
1) + I*(a - b)*sqrt(a*b/(a^2 - 2*a*b + b^2))*c^2*log(2*sqrt(-(2*(a - b)*sqrt(a*b/(a^2 - 2*a*b + b^2)) + a + b)
/(a - b)) + 2*cos(d*x + c) + 2*I*sin(d*x + c)) - I*(a - b)*sqrt(a*b/(a^2 - 2*a*b + b^2))*c^2*log(2*sqrt(-(2*(a
- b)*sqrt(a*b/(a^2 - 2*a*b + b^2)) + a + b)/(a - b)) + 2*cos(d*x + c) - 2*I*sin(d*x + c)) - I*(a - b)*sqrt(a*
b/(a^2 - 2*a*b + b^2))*c^2*log(2*sqrt(-(2*(a - b)*sqrt(a*b/(a^2 - 2*a*b + b^2)) + a + b)/(a - b)) - 2*cos(d*x
+ c) + 2*I*sin(d*x + c)) + I*(a - b)*sqrt(a*b/(a^2 - 2*a*b + b^2))*c^2*log(2*sqrt(-(2*(a - b)*sqrt(a*b/(a^2 -
2*a*b + b^2)) + a + b)/(a - b)) - 2*cos(d*x + c) - 2*I*sin(d*x + c)) - I*(a - b)*sqrt(a*b/(a^2 - 2*a*b + b^2))
*c^2*log(2*sqrt((2*(a - b)*sqrt(a*b/(a^2 - 2*a*b + b^2)) - a - b)/(a - b)) + 2*cos(d*x + c) + 2*I*sin(d*x + c)
) + I*(a - b)*sqrt(a*b/(a^2 - 2*a*b + b^2))*c^2*log(2*sqrt((2*(a - b)*sqrt(a*b/(a^2 - 2*a*b + b^2)) - a - b)/(
a - b)) + 2*cos(d*x + c) - 2*I*sin(d*x + c)) + I*(a - b)*sqrt(a*b/(a^2 - 2*a*b + b^2))*c^2*log(2*sqrt((2*(a -
b)*sqrt(a*b/(a^2 - 2*a*b + b^2)) - a - b)/(a - b)) - 2*cos(d*x + c) + 2*I*sin(d*x + c)) - I*(a - b)*sqrt(a*b/(
a^2 - 2*a*b + b^2))*c^2*log(2*sqrt((2*(a - b)*sqrt(a*b/(a^2 - 2*a*b + b^2)) - a - b)/(a - b)) - 2*cos(d*x + c)
- 2*I*sin(d*x + c)) + (I*(a - b)*d^2*x^2 - I*(a - b)*c^2)*sqrt(a*b/(a^2 - 2*a*b + b^2))*log((((a + b)*cos(d*x
+ c) + (I*a + I*b)*sin(d*x + c) - 2*((a - b)*cos(d*x + c) + (I*a - I*b)*sin(d*x + c))*sqrt(a*b/(a^2 - 2*a*b +
b^2)))*sqrt(-(2*(a - b)*sqrt(a*b/(a^2 - 2*a*b + b^2)) + a + b)/(a - b)) + a - b)/(a - b)) + (-I*(a - b)*d^2*x
^2 + I*(a - b)*c^2)*sqrt(a*b/(a^2 - 2*a*b + b^2))*log(-(((a + b)*cos(d*x + c) - (I*a + I*b)*sin(d*x + c) - 2*(
(a - b)*cos(d*x + c) - (I*a - I*b)*sin(d*x + c))*sqrt(a*b/(a^2 - 2*a*b + b^2)))*sqrt(-(2*(a - b)*sqrt(a*b/(a^2
- 2*a*b + b^2)) + a + b)/(a - b)) - a + b)/(a - b)) + (-I*(a - b)*d^2*x^2 + I*(a - b)*c^2)*sqrt(a*b/(a^2 - 2*
a*b + b^2))*log((((a + b)*cos(d*x + c) + (-I*a - I*b)*sin(d*x + c) - 2*((a - b)*cos(d*x + c) + (-I*a + I*b)*si
n(d*x + c))*sqrt(a*b/(a^2 - 2*a*b + b^2)))*sqrt(-(2*(a - b)*sqrt(a*b/(a^2 - 2*a*b + b^2)) + a + b)/(a - b)) +
a - b)/(a - b)) + (I*(a - b)*d^2*x^2 - I*(a - b)*c^2)*sqrt(a*b/(a^2 - 2*a*b + b^2))*log(-(((a + b)*cos(d*x + c
) - (-I*a - I*b)*sin(d*x + c) - 2*((a - b)*cos(d*x + c) - (-I*a + I*b)*sin(d*x + c))*sqrt(a*b/(a^2 - 2*a*b + b
^2)))*sqrt(-(2*(a - b)*sqrt(a*b/(a^2 - 2*a*b + b^2)) + a + b)/(a - b)) - a + b)/(a - b)) + (-I*(a - b)*d^2*x^2
+ I*(a - b)*c^2)*sqrt(a*b/(a^2 - 2*a*b + b^2))*log((((a + b)*cos(d*x + c) + (I*a + I*b)*sin(d*x + c) + 2*((a
- b)*cos(d*x + c) - (-I*a + I*b)*sin(d*x + c))*sqrt(a*b/(a^2 - 2*a*b + b^2)))*sqrt((2*(a - b)*sqrt(a*b/(a^2 -
2*a*b + b^2)) - a - b)/(a - b)) + a - b)/(a - b)) + (I*(a - b)*d^2*x^2 - I*(a - b)*c^2)*sqrt(a*b/(a^2 - 2*a*b
+ b^2))*log(-(((a + b)*cos(d*x + c) - (I*a + I*b)*sin(d*x + c) + 2*((a - b)*cos(d*x + c) + (-I*a + I*b)*sin(d*
x + c))*sqrt(a*b/(a^2 - 2*a*b + b^2)))*sqrt((2*(a - b)*sqrt(a*b/(a^2 - 2*a*b + b^2)) - a - b)/(a - b)) - a + b
)/(a - b)) + (I*(a - b)*d^2*x^2 - I*(a - b)*c^2)*sqrt(a*b/(a^2 - 2*a*b + b^2))*log((((a + b)*cos(d*x + c) + (-
I*a - I*b)*sin(d*x + c) + 2*((a - b)*cos(d*x + c) - (I*a - I*b)*sin(d*x + c))*sqrt(a*b/(a^2 - 2*a*b + b^2)))*s
qrt((2*(a - b)*sqrt(a*b/(a^2 - 2*a*b + b^2)) - a - b)/(a - b)) + a - b)/(a - b)) + (-I*(a - b)*d^2*x^2 + I*(a
- b)*c^2)*sqrt(a*b/(a^2 - 2*a*b + b^2))*log(-(((a + b)*cos(d*x + c) - (-I*a - I*b)*sin(d*x + c) + 2*((a - b)*c
os(d*x + c) + (I*a - I*b)*sin(d*x + c))*sqrt(a*b/(a^2 - 2*a*b + b^2)))*sqrt((2*(a - b)*sqrt(a*b/(a^2 - 2*a*b +
b^2)) - a - b)/(a - b)) - a + b)/(a - b)) - 2*(-I*a + I*b)*sqrt(a*b/(a^2 - 2*a*b + b^2))*polylog(3, ((a + b)*
cos(d*x + c) + (I*a + I*b)*sin(d*x + c) - 2*((a - b)*cos(d*x + c) + (I*a - I*b)*sin(d*x + c))*sqrt(a*b/(a^2 -
2*a*b + b^2)))*sqrt(-(2*(a - b)*sqrt(a*b/(a^2 - 2*a*b + b^2)) + a + b)/(a - b))/(a - b)) - 2*(I*a - I*b)*sqrt(
a*b/(a^2 - 2*a*b + b^2))*polylog(3, -((a + b)*cos(d*x + c) - (I*a + I*b)*sin(d*x + c) - 2*((a - b)*cos(d*x + c
) - (I*a - I*b)*sin(d*x + c))*sqrt(a*b/(a^2 - 2*a*b + b^2)))*sqrt(-(2*(a - b)*sqrt(a*b/(a^2 - 2*a*b + b^2)) +
a + b)/(a - b))/(a - b)) - 2*(I*a - I*b)*sqrt(a*b/(a^2 - 2*a*b + b^2))*polylog(3, ((a + b)*cos(d*x + c) + (-I*
a - I*b)*sin(d*x + c) - 2*((a - b)*cos(d*x + c) + (-I*a + I*b)*sin(d*x + c))*sqrt(a*b/(a^2 - 2*a*b + b^2)))*sq
rt(-(2*(a - b)*sqrt(a*b/(a^2 - 2*a*b + b^2)) + a + b)/(a - b))/(a - b)) - 2*(-I*a + I*b)*sqrt(a*b/(a^2 - 2*a*b
+ b^2))*polylog(3, -((a + b)*cos(d*x + c) - (-I*a - I*b)*sin(d*x + c) - 2*((a - b)*cos(d*x + c) - (-I*a + I*b
)*sin(d*x + c))*sqrt(a*b/(a^2 - 2*a*b + b^2)))*sqrt(-(2*(a - b)*sqrt(a*b/(a^2 - 2*a*b + b^2)) + a + b)/(a - b)
)/(a - b)) - 2*(I*a - I*b)*sqrt(a*b/(a^2 - 2*a*b + b^2))*polylog(3, ((a + b)*cos(d*x + c) + (I*a + I*b)*sin(d*
x + c) + 2*((a - b)*cos(d*x + c) - (-I*a + I*b)*sin(d*x + c))*sqrt(a*b/(a^2 - 2*a*b + b^2)))*sqrt((2*(a - b)*s
qrt(a*b/(a^2 - 2*a*b + b^2)) - a - b)/(a - b))/(a - b)) - 2*(-I*a + I*b)*sqrt(a*b/(a^2 - 2*a*b + b^2))*polylog
(3, -((a + b)*cos(d*x + c) - (I*a + I*b)*sin(d*x + c) + 2*((a - b)*cos(d*x + c) + (-I*a + I*b)*sin(d*x + c))*s
qrt(a*b/(a^2 - 2*a*b + b^2)))*sqrt((2*(a - b)*sqrt(a*b/(a^2 - 2*a*b + b^2)) - a - b)/(a - b))/(a - b)) - 2*(-I
*a + I*b)*sqrt(a*b/(a^2 - 2*a*b + b^2))*polylog(3, ((a + b)*cos(d*x + c) + (-I*a - I*b)*sin(d*x + c) + 2*((a -
b)*cos(d*x + c) - (I*a - I*b)*sin(d*x + c))*sqrt(a*b/(a^2 - 2*a*b + b^2)))*sqrt((2*(a - b)*sqrt(a*b/(a^2 - 2*
a*b + b^2)) - a - b)/(a - b))/(a - b)) - 2*(I*a - I*b)*sqrt(a*b/(a^2 - 2*a*b + b^2))*polylog(3, -((a + b)*cos(
d*x + c) - (-I*a - I*b)*sin(d*x + c) + 2*((a - b)*cos(d*x + c) + (I*a - I*b)*sin(d*x + c))*sqrt(a*b/(a^2 - 2*a
*b + b^2)))*sqrt((2*(a - b)*sqrt(a*b/(a^2 - 2*a*b + b^2)) - a - b)/(a - b))/(a - b)))/(a*b*d^3)
Sympy [F]
\[
\int \frac {x^2 \sec ^2(c+d x)}{a+b \tan ^2(c+d x)} \, dx=\int \frac {x^{2} \sec ^{2}{\left (c + d x \right )}}{a + b \tan ^{2}{\left (c + d x \right )}}\, dx
\]
[In]
integrate(x**2*sec(d*x+c)**2/(a+b*tan(d*x+c)**2),x)
[Out]
Integral(x**2*sec(c + d*x)**2/(a + b*tan(c + d*x)**2), x)
Maxima [F]
\[
\int \frac {x^2 \sec ^2(c+d x)}{a+b \tan ^2(c+d x)} \, dx=\int { \frac {x^{2} \sec \left (d x + c\right )^{2}}{b \tan \left (d x + c\right )^{2} + a} \,d x }
\]
[In]
integrate(x^2*sec(d*x+c)^2/(a+b*tan(d*x+c)^2),x, algorithm="maxima")
[Out]
integrate(x^2*sec(d*x + c)^2/(b*tan(d*x + c)^2 + a), x)
Giac [F]
\[
\int \frac {x^2 \sec ^2(c+d x)}{a+b \tan ^2(c+d x)} \, dx=\int { \frac {x^{2} \sec \left (d x + c\right )^{2}}{b \tan \left (d x + c\right )^{2} + a} \,d x }
\]
[In]
integrate(x^2*sec(d*x+c)^2/(a+b*tan(d*x+c)^2),x, algorithm="giac")
[Out]
integrate(x^2*sec(d*x + c)^2/(b*tan(d*x + c)^2 + a), x)
Mupad [F(-1)]
Timed out. \[
\int \frac {x^2 \sec ^2(c+d x)}{a+b \tan ^2(c+d x)} \, dx=\int \frac {x^2}{{\cos \left (c+d\,x\right )}^2\,\left (b\,{\mathrm {tan}\left (c+d\,x\right )}^2+a\right )} \,d x
\]
[In]
int(x^2/(cos(c + d*x)^2*(a + b*tan(c + d*x)^2)),x)
[Out]
int(x^2/(cos(c + d*x)^2*(a + b*tan(c + d*x)^2)), x)