Integrand size = 31, antiderivative size = 146 \[ \int \frac {\sec ^3(c+d x) (A+B \sec (c+d x))}{(a+a \sec (c+d x))^4} \, dx=-\frac {(A-B) \sec ^3(c+d x) \tan (c+d x)}{7 d (a+a \sec (c+d x))^4}+\frac {(4 A+3 B) \tan (c+d x)}{35 a d (a+a \sec (c+d x))^3}-\frac {8 (4 A+3 B) \tan (c+d x)}{105 d \left (a^2+a^2 \sec (c+d x)\right )^2}+\frac {(4 A+3 B) \tan (c+d x)}{15 d \left (a^4+a^4 \sec (c+d x)\right )} \] Output:
-1/7*(A-B)*sec(d*x+c)^3*tan(d*x+c)/d/(a+a*sec(d*x+c))^4+1/35*(4*A+3*B)*tan (d*x+c)/a/d/(a+a*sec(d*x+c))^3-8/105*(4*A+3*B)*tan(d*x+c)/d/(a^2+a^2*sec(d *x+c))^2+1/15*(4*A+3*B)*tan(d*x+c)/d/(a^4+a^4*sec(d*x+c))
Time = 1.54 (sec) , antiderivative size = 109, normalized size of antiderivative = 0.75 \[ \int \frac {\sec ^3(c+d x) (A+B \sec (c+d x))}{(a+a \sec (c+d x))^4} \, dx=\frac {\cos \left (\frac {1}{2} (c+d x)\right ) \sec \left (\frac {c}{2}\right ) \left (35 (2 A+3 B) \sin \left (\frac {d x}{2}\right )-70 A \sin \left (c+\frac {d x}{2}\right )+(4 A+3 B) \left (21 \sin \left (c+\frac {3 d x}{2}\right )+7 \sin \left (2 c+\frac {5 d x}{2}\right )+\sin \left (3 c+\frac {7 d x}{2}\right )\right )\right )}{210 a^4 d (1+\cos (c+d x))^4} \] Input:
Integrate[(Sec[c + d*x]^3*(A + B*Sec[c + d*x]))/(a + a*Sec[c + d*x])^4,x]
Output:
(Cos[(c + d*x)/2]*Sec[c/2]*(35*(2*A + 3*B)*Sin[(d*x)/2] - 70*A*Sin[c + (d* x)/2] + (4*A + 3*B)*(21*Sin[c + (3*d*x)/2] + 7*Sin[2*c + (5*d*x)/2] + Sin[ 3*c + (7*d*x)/2])))/(210*a^4*d*(1 + Cos[c + d*x])^4)
Time = 0.73 (sec) , antiderivative size = 138, normalized size of antiderivative = 0.95, number of steps used = 9, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.290, Rules used = {3042, 4500, 3042, 4286, 25, 3042, 4488, 3042, 4281}
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 {\sec ^3(c+d x) (A+B \sec (c+d x))}{(a \sec (c+d x)+a)^4} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\csc \left (c+d x+\frac {\pi }{2}\right )^3 \left (A+B \csc \left (c+d x+\frac {\pi }{2}\right )\right )}{\left (a \csc \left (c+d x+\frac {\pi }{2}\right )+a\right )^4}dx\) |
\(\Big \downarrow \) 4500 |
\(\displaystyle \frac {(4 A+3 B) \int \frac {\sec ^3(c+d x)}{(\sec (c+d x) a+a)^3}dx}{7 a}-\frac {(A-B) \tan (c+d x) \sec ^3(c+d x)}{7 d (a \sec (c+d x)+a)^4}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {(4 A+3 B) \int \frac {\csc \left (c+d x+\frac {\pi }{2}\right )^3}{\left (\csc \left (c+d x+\frac {\pi }{2}\right ) a+a\right )^3}dx}{7 a}-\frac {(A-B) \tan (c+d x) \sec ^3(c+d x)}{7 d (a \sec (c+d x)+a)^4}\) |
\(\Big \downarrow \) 4286 |
\(\displaystyle \frac {(4 A+3 B) \left (\frac {\int -\frac {\sec (c+d x) (3 a-5 a \sec (c+d x))}{(\sec (c+d x) a+a)^2}dx}{5 a^2}+\frac {\tan (c+d x)}{5 d (a \sec (c+d x)+a)^3}\right )}{7 a}-\frac {(A-B) \tan (c+d x) \sec ^3(c+d x)}{7 d (a \sec (c+d x)+a)^4}\) |
\(\Big \downarrow \) 25 |
\(\displaystyle \frac {(4 A+3 B) \left (\frac {\tan (c+d x)}{5 d (a \sec (c+d x)+a)^3}-\frac {\int \frac {\sec (c+d x) (3 a-5 a \sec (c+d x))}{(\sec (c+d x) a+a)^2}dx}{5 a^2}\right )}{7 a}-\frac {(A-B) \tan (c+d x) \sec ^3(c+d x)}{7 d (a \sec (c+d x)+a)^4}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {(4 A+3 B) \left (\frac {\tan (c+d x)}{5 d (a \sec (c+d x)+a)^3}-\frac {\int \frac {\csc \left (c+d x+\frac {\pi }{2}\right ) \left (3 a-5 a \csc \left (c+d x+\frac {\pi }{2}\right )\right )}{\left (\csc \left (c+d x+\frac {\pi }{2}\right ) a+a\right )^2}dx}{5 a^2}\right )}{7 a}-\frac {(A-B) \tan (c+d x) \sec ^3(c+d x)}{7 d (a \sec (c+d x)+a)^4}\) |
\(\Big \downarrow \) 4488 |
\(\displaystyle \frac {(4 A+3 B) \left (\frac {\tan (c+d x)}{5 d (a \sec (c+d x)+a)^3}-\frac {\frac {8 a \tan (c+d x)}{3 d (a \sec (c+d x)+a)^2}-\frac {7}{3} \int \frac {\sec (c+d x)}{\sec (c+d x) a+a}dx}{5 a^2}\right )}{7 a}-\frac {(A-B) \tan (c+d x) \sec ^3(c+d x)}{7 d (a \sec (c+d x)+a)^4}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {(4 A+3 B) \left (\frac {\tan (c+d x)}{5 d (a \sec (c+d x)+a)^3}-\frac {\frac {8 a \tan (c+d x)}{3 d (a \sec (c+d x)+a)^2}-\frac {7}{3} \int \frac {\csc \left (c+d x+\frac {\pi }{2}\right )}{\csc \left (c+d x+\frac {\pi }{2}\right ) a+a}dx}{5 a^2}\right )}{7 a}-\frac {(A-B) \tan (c+d x) \sec ^3(c+d x)}{7 d (a \sec (c+d x)+a)^4}\) |
\(\Big \downarrow \) 4281 |
\(\displaystyle \frac {(4 A+3 B) \left (\frac {\tan (c+d x)}{5 d (a \sec (c+d x)+a)^3}-\frac {\frac {8 a \tan (c+d x)}{3 d (a \sec (c+d x)+a)^2}-\frac {7 \tan (c+d x)}{3 d (a \sec (c+d x)+a)}}{5 a^2}\right )}{7 a}-\frac {(A-B) \tan (c+d x) \sec ^3(c+d x)}{7 d (a \sec (c+d x)+a)^4}\) |
Input:
Int[(Sec[c + d*x]^3*(A + B*Sec[c + d*x]))/(a + a*Sec[c + d*x])^4,x]
Output:
-1/7*((A - B)*Sec[c + d*x]^3*Tan[c + d*x])/(d*(a + a*Sec[c + d*x])^4) + (( 4*A + 3*B)*(Tan[c + d*x]/(5*d*(a + a*Sec[c + d*x])^3) - ((8*a*Tan[c + d*x] )/(3*d*(a + a*Sec[c + d*x])^2) - (7*Tan[c + d*x])/(3*d*(a + a*Sec[c + d*x] )))/(5*a^2)))/(7*a)
Int[csc[(e_.) + (f_.)*(x_)]/(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbo l] :> Simp[-Cot[e + f*x]/(f*(b + a*Csc[e + f*x])), x] /; FreeQ[{a, b, e, f} , x] && EqQ[a^2 - b^2, 0]
Int[csc[(e_.) + (f_.)*(x_)]^3*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_), x_Symbol] :> Simp[b*Cot[e + f*x]*((a + b*Csc[e + f*x])^m/(a*f*(2*m + 1))), x] - Simp[1/(a^2*(2*m + 1)) Int[Csc[e + f*x]*(a + b*Csc[e + f*x])^(m + 1) *(a*m - b*(2*m + 1)*Csc[e + f*x]), x], x] /; FreeQ[{a, b, e, f}, x] && EqQ[ a^2 - b^2, 0] && LtQ[m, -2^(-1)]
Int[csc[(e_.) + (f_.)*(x_)]*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_)*(cs c[(e_.) + (f_.)*(x_)]*(B_.) + (A_)), x_Symbol] :> Simp[(A*b - a*B)*Cot[e + f*x]*((a + b*Csc[e + f*x])^m/(a*f*(2*m + 1))), x] + Simp[(a*B*m + A*b*(m + 1))/(a*b*(2*m + 1)) Int[Csc[e + f*x]*(a + b*Csc[e + f*x])^(m + 1), x], x] /; FreeQ[{a, b, A, B, e, f}, x] && NeQ[A*b - a*B, 0] && EqQ[a^2 - b^2, 0] && NeQ[a*B*m + A*b*(m + 1), 0] && LtQ[m, -2^(-1)]
Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + ( a_))^(m_)*(csc[(e_.) + (f_.)*(x_)]*(B_.) + (A_)), x_Symbol] :> Simp[(-(A*b - a*B))*Cot[e + f*x]*(a + b*Csc[e + f*x])^m*((d*Csc[e + f*x])^n/(b*f*(2*m + 1))), x] + Simp[(a*A*m + b*B*(m + 1))/(a^2*(2*m + 1)) Int[(a + b*Csc[e + f*x])^(m + 1)*(d*Csc[e + f*x])^n, x], x] /; FreeQ[{a, b, d, e, f, A, B, n} , x] && NeQ[A*b - a*B, 0] && EqQ[a^2 - b^2, 0] && EqQ[m + n + 1, 0] && LeQ[ m, -1]
Time = 0.26 (sec) , antiderivative size = 84, normalized size of antiderivative = 0.58
method | result | size |
parallelrisch | \(\frac {\left (\left (32 A +24 B \right ) \cos \left (2 d x +2 c \right )+\left (4 A +3 B \right ) \cos \left (3 d x +3 c \right )+\left (116 A +87 B \right ) \cos \left (d x +c \right )+58 A +96 B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right ) \sec \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}}{1680 a^{4} d}\) | \(84\) |
derivativedivides | \(\frac {\frac {\left (-A +B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7}}{7}+\frac {\left (-A +3 B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{5}+\frac {\left (A +3 B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{3}+\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) A +\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) B}{8 d \,a^{4}}\) | \(88\) |
default | \(\frac {\frac {\left (-A +B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7}}{7}+\frac {\left (-A +3 B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{5}+\frac {\left (A +3 B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{3}+\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) A +\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) B}{8 d \,a^{4}}\) | \(88\) |
risch | \(\frac {4 i \left (70 A \,{\mathrm e}^{4 i \left (d x +c \right )}+70 A \,{\mathrm e}^{3 i \left (d x +c \right )}+105 B \,{\mathrm e}^{3 i \left (d x +c \right )}+84 A \,{\mathrm e}^{2 i \left (d x +c \right )}+63 B \,{\mathrm e}^{2 i \left (d x +c \right )}+28 \,{\mathrm e}^{i \left (d x +c \right )} A +21 B \,{\mathrm e}^{i \left (d x +c \right )}+4 A +3 B \right )}{105 d \,a^{4} \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )^{7}}\) | \(114\) |
norman | \(\frac {-\frac {\left (A -B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{13}}{56 a d}-\frac {\left (A +B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{8 a d}-\frac {3 \left (3 A +B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{40 a d}+\frac {\left (4 A +3 B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{12 a d}-\frac {\left (4 A +3 B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7}}{70 a d}+\frac {\left (4 A +3 B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{11}}{140 a d}+\frac {\left (53 A -39 B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{9}}{840 a d}}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1\right )^{3} a^{3}}\) | \(193\) |
Input:
int(sec(d*x+c)^3*(A+B*sec(d*x+c))/(a+a*sec(d*x+c))^4,x,method=_RETURNVERBO SE)
Output:
1/1680*((32*A+24*B)*cos(2*d*x+2*c)+(4*A+3*B)*cos(3*d*x+3*c)+(116*A+87*B)*c os(d*x+c)+58*A+96*B)*tan(1/2*d*x+1/2*c)*sec(1/2*d*x+1/2*c)^6/a^4/d
Time = 0.08 (sec) , antiderivative size = 125, normalized size of antiderivative = 0.86 \[ \int \frac {\sec ^3(c+d x) (A+B \sec (c+d x))}{(a+a \sec (c+d x))^4} \, dx=\frac {{\left (2 \, {\left (4 \, A + 3 \, B\right )} \cos \left (d x + c\right )^{3} + 8 \, {\left (4 \, A + 3 \, B\right )} \cos \left (d x + c\right )^{2} + 13 \, {\left (4 \, A + 3 \, B\right )} \cos \left (d x + c\right ) + 13 \, A + 36 \, B\right )} \sin \left (d x + c\right )}{105 \, {\left (a^{4} d \cos \left (d x + c\right )^{4} + 4 \, a^{4} d \cos \left (d x + c\right )^{3} + 6 \, a^{4} d \cos \left (d x + c\right )^{2} + 4 \, a^{4} d \cos \left (d x + c\right ) + a^{4} d\right )}} \] Input:
integrate(sec(d*x+c)^3*(A+B*sec(d*x+c))/(a+a*sec(d*x+c))^4,x, algorithm="f ricas")
Output:
1/105*(2*(4*A + 3*B)*cos(d*x + c)^3 + 8*(4*A + 3*B)*cos(d*x + c)^2 + 13*(4 *A + 3*B)*cos(d*x + c) + 13*A + 36*B)*sin(d*x + c)/(a^4*d*cos(d*x + c)^4 + 4*a^4*d*cos(d*x + c)^3 + 6*a^4*d*cos(d*x + c)^2 + 4*a^4*d*cos(d*x + c) + a^4*d)
\[ \int \frac {\sec ^3(c+d x) (A+B \sec (c+d x))}{(a+a \sec (c+d x))^4} \, dx=\frac {\int \frac {A \sec ^{3}{\left (c + d x \right )}}{\sec ^{4}{\left (c + d x \right )} + 4 \sec ^{3}{\left (c + d x \right )} + 6 \sec ^{2}{\left (c + d x \right )} + 4 \sec {\left (c + d x \right )} + 1}\, dx + \int \frac {B \sec ^{4}{\left (c + d x \right )}}{\sec ^{4}{\left (c + d x \right )} + 4 \sec ^{3}{\left (c + d x \right )} + 6 \sec ^{2}{\left (c + d x \right )} + 4 \sec {\left (c + d x \right )} + 1}\, dx}{a^{4}} \] Input:
integrate(sec(d*x+c)**3*(A+B*sec(d*x+c))/(a+a*sec(d*x+c))**4,x)
Output:
(Integral(A*sec(c + d*x)**3/(sec(c + d*x)**4 + 4*sec(c + d*x)**3 + 6*sec(c + d*x)**2 + 4*sec(c + d*x) + 1), x) + Integral(B*sec(c + d*x)**4/(sec(c + d*x)**4 + 4*sec(c + d*x)**3 + 6*sec(c + d*x)**2 + 4*sec(c + d*x) + 1), x) )/a**4
Time = 0.04 (sec) , antiderivative size = 175, normalized size of antiderivative = 1.20 \[ \int \frac {\sec ^3(c+d x) (A+B \sec (c+d x))}{(a+a \sec (c+d x))^4} \, dx=\frac {\frac {A {\left (\frac {105 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \frac {35 \, \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} - \frac {21 \, \sin \left (d x + c\right )^{5}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{5}} - \frac {15 \, \sin \left (d x + c\right )^{7}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{7}}\right )}}{a^{4}} + \frac {3 \, B {\left (\frac {35 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \frac {35 \, \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} + \frac {21 \, \sin \left (d x + c\right )^{5}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{5}} + \frac {5 \, \sin \left (d x + c\right )^{7}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{7}}\right )}}{a^{4}}}{840 \, d} \] Input:
integrate(sec(d*x+c)^3*(A+B*sec(d*x+c))/(a+a*sec(d*x+c))^4,x, algorithm="m axima")
Output:
1/840*(A*(105*sin(d*x + c)/(cos(d*x + c) + 1) + 35*sin(d*x + c)^3/(cos(d*x + c) + 1)^3 - 21*sin(d*x + c)^5/(cos(d*x + c) + 1)^5 - 15*sin(d*x + c)^7/ (cos(d*x + c) + 1)^7)/a^4 + 3*B*(35*sin(d*x + c)/(cos(d*x + c) + 1) + 35*s in(d*x + c)^3/(cos(d*x + c) + 1)^3 + 21*sin(d*x + c)^5/(cos(d*x + c) + 1)^ 5 + 5*sin(d*x + c)^7/(cos(d*x + c) + 1)^7)/a^4)/d
Time = 0.18 (sec) , antiderivative size = 117, normalized size of antiderivative = 0.80 \[ \int \frac {\sec ^3(c+d x) (A+B \sec (c+d x))}{(a+a \sec (c+d x))^4} \, dx=-\frac {15 \, A \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 15 \, B \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 21 \, A \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 63 \, B \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 35 \, A \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 105 \, B \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 105 \, A \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 105 \, B \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{840 \, a^{4} d} \] Input:
integrate(sec(d*x+c)^3*(A+B*sec(d*x+c))/(a+a*sec(d*x+c))^4,x, algorithm="g iac")
Output:
-1/840*(15*A*tan(1/2*d*x + 1/2*c)^7 - 15*B*tan(1/2*d*x + 1/2*c)^7 + 21*A*t an(1/2*d*x + 1/2*c)^5 - 63*B*tan(1/2*d*x + 1/2*c)^5 - 35*A*tan(1/2*d*x + 1 /2*c)^3 - 105*B*tan(1/2*d*x + 1/2*c)^3 - 105*A*tan(1/2*d*x + 1/2*c) - 105* B*tan(1/2*d*x + 1/2*c))/(a^4*d)
Time = 11.36 (sec) , antiderivative size = 85, normalized size of antiderivative = 0.58 \[ \int \frac {\sec ^3(c+d x) (A+B \sec (c+d x))}{(a+a \sec (c+d x))^4} \, dx=\frac {\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (A+3\,B\right )}{24\,a^4}-\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5\,\left (A-3\,B\right )}{40\,a^4}-\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7\,\left (A-B\right )}{56\,a^4}+\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (A+B\right )}{8\,a^4}}{d} \] Input:
int((A + B/cos(c + d*x))/(cos(c + d*x)^3*(a + a/cos(c + d*x))^4),x)
Output:
((tan(c/2 + (d*x)/2)^3*(A + 3*B))/(24*a^4) - (tan(c/2 + (d*x)/2)^5*(A - 3* B))/(40*a^4) - (tan(c/2 + (d*x)/2)^7*(A - B))/(56*a^4) + (tan(c/2 + (d*x)/ 2)*(A + B))/(8*a^4))/d
Time = 0.18 (sec) , antiderivative size = 108, normalized size of antiderivative = 0.74 \[ \int \frac {\sec ^3(c+d x) (A+B \sec (c+d x))}{(a+a \sec (c+d x))^4} \, dx=\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (-15 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6} a +15 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6} b -21 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4} a +63 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4} b +35 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} a +105 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} b +105 a +105 b \right )}{840 a^{4} d} \] Input:
int(sec(d*x+c)^3*(A+B*sec(d*x+c))/(a+a*sec(d*x+c))^4,x)
Output:
(tan((c + d*x)/2)*( - 15*tan((c + d*x)/2)**6*a + 15*tan((c + d*x)/2)**6*b - 21*tan((c + d*x)/2)**4*a + 63*tan((c + d*x)/2)**4*b + 35*tan((c + d*x)/2 )**2*a + 105*tan((c + d*x)/2)**2*b + 105*a + 105*b))/(840*a**4*d)