\(\int \frac {\sqrt {b \cos (c+d x)} (A+B \cos (c+d x))}{\cos ^{\frac {9}{2}}(c+d x)} \, dx\) [849]

Optimal result
Mathematica [A] (verified)
Rubi [A] (verified)
Maple [A] (verified)
Fricas [A] (verification not implemented)
Sympy [F(-1)]
Maxima [B] (verification not implemented)
Giac [A] (verification not implemented)
Mupad [F(-1)]
Reduce [B] (verification not implemented)

Optimal result

Integrand size = 33, antiderivative size = 145 \[ \int \frac {\sqrt {b \cos (c+d x)} (A+B \cos (c+d x))}{\cos ^{\frac {9}{2}}(c+d x)} \, dx=\frac {B \text {arctanh}(\sin (c+d x)) \sqrt {b \cos (c+d x)}}{2 d \sqrt {\cos (c+d x)}}+\frac {B \sqrt {b \cos (c+d x)} \sin (c+d x)}{2 d \cos ^{\frac {5}{2}}(c+d x)}+\frac {A \sqrt {b \cos (c+d x)} \sin (c+d x)}{d \cos ^{\frac {3}{2}}(c+d x)}+\frac {A \sqrt {b \cos (c+d x)} \sin ^3(c+d x)}{3 d \cos ^{\frac {7}{2}}(c+d x)} \] Output:

1/2*B*arctanh(sin(d*x+c))*(b*cos(d*x+c))^(1/2)/d/cos(d*x+c)^(1/2)+1/2*B*(b 
*cos(d*x+c))^(1/2)*sin(d*x+c)/d/cos(d*x+c)^(5/2)+A*(b*cos(d*x+c))^(1/2)*si 
n(d*x+c)/d/cos(d*x+c)^(3/2)+1/3*A*(b*cos(d*x+c))^(1/2)*sin(d*x+c)^3/d/cos( 
d*x+c)^(7/2)
                                                                                    
                                                                                    
 

Mathematica [A] (verified)

Time = 0.27 (sec) , antiderivative size = 76, normalized size of antiderivative = 0.52 \[ \int \frac {\sqrt {b \cos (c+d x)} (A+B \cos (c+d x))}{\cos ^{\frac {9}{2}}(c+d x)} \, dx=\frac {\sqrt {b \cos (c+d x)} \left (3 B \text {arctanh}(\sin (c+d x)) \cos ^2(c+d x)+3 B \sin (c+d x)+2 A (2+\cos (2 (c+d x))) \tan (c+d x)\right )}{6 d \cos ^{\frac {5}{2}}(c+d x)} \] Input:

Integrate[(Sqrt[b*Cos[c + d*x]]*(A + B*Cos[c + d*x]))/Cos[c + d*x]^(9/2),x 
]
 

Output:

(Sqrt[b*Cos[c + d*x]]*(3*B*ArcTanh[Sin[c + d*x]]*Cos[c + d*x]^2 + 3*B*Sin[ 
c + d*x] + 2*A*(2 + Cos[2*(c + d*x)])*Tan[c + d*x]))/(6*d*Cos[c + d*x]^(5/ 
2))
 

Rubi [A] (verified)

Time = 0.47 (sec) , antiderivative size = 87, normalized size of antiderivative = 0.60, number of steps used = 10, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.273, Rules used = {2031, 3042, 3227, 3042, 4254, 2009, 4255, 3042, 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 {\sqrt {b \cos (c+d x)} (A+B \cos (c+d x))}{\cos ^{\frac {9}{2}}(c+d x)} \, dx\)

\(\Big \downarrow \) 2031

\(\displaystyle \frac {\sqrt {b \cos (c+d x)} \int (A+B \cos (c+d x)) \sec ^4(c+d x)dx}{\sqrt {\cos (c+d x)}}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {\sqrt {b \cos (c+d x)} \int \frac {A+B \sin \left (c+d x+\frac {\pi }{2}\right )}{\sin \left (c+d x+\frac {\pi }{2}\right )^4}dx}{\sqrt {\cos (c+d x)}}\)

\(\Big \downarrow \) 3227

\(\displaystyle \frac {\sqrt {b \cos (c+d x)} \left (A \int \sec ^4(c+d x)dx+B \int \sec ^3(c+d x)dx\right )}{\sqrt {\cos (c+d x)}}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {\sqrt {b \cos (c+d x)} \left (A \int \csc \left (c+d x+\frac {\pi }{2}\right )^4dx+B \int \csc \left (c+d x+\frac {\pi }{2}\right )^3dx\right )}{\sqrt {\cos (c+d x)}}\)

\(\Big \downarrow \) 4254

\(\displaystyle \frac {\sqrt {b \cos (c+d x)} \left (B \int \csc \left (c+d x+\frac {\pi }{2}\right )^3dx-\frac {A \int \left (\tan ^2(c+d x)+1\right )d(-\tan (c+d x))}{d}\right )}{\sqrt {\cos (c+d x)}}\)

\(\Big \downarrow \) 2009

\(\displaystyle \frac {\sqrt {b \cos (c+d x)} \left (B \int \csc \left (c+d x+\frac {\pi }{2}\right )^3dx-\frac {A \left (-\frac {1}{3} \tan ^3(c+d x)-\tan (c+d x)\right )}{d}\right )}{\sqrt {\cos (c+d x)}}\)

\(\Big \downarrow \) 4255

\(\displaystyle \frac {\sqrt {b \cos (c+d x)} \left (B \left (\frac {1}{2} \int \sec (c+d x)dx+\frac {\tan (c+d x) \sec (c+d x)}{2 d}\right )-\frac {A \left (-\frac {1}{3} \tan ^3(c+d x)-\tan (c+d x)\right )}{d}\right )}{\sqrt {\cos (c+d x)}}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {\sqrt {b \cos (c+d x)} \left (B \left (\frac {1}{2} \int \csc \left (c+d x+\frac {\pi }{2}\right )dx+\frac {\tan (c+d x) \sec (c+d x)}{2 d}\right )-\frac {A \left (-\frac {1}{3} \tan ^3(c+d x)-\tan (c+d x)\right )}{d}\right )}{\sqrt {\cos (c+d x)}}\)

\(\Big \downarrow \) 4257

\(\displaystyle \frac {\sqrt {b \cos (c+d x)} \left (B \left (\frac {\text {arctanh}(\sin (c+d x))}{2 d}+\frac {\tan (c+d x) \sec (c+d x)}{2 d}\right )-\frac {A \left (-\frac {1}{3} \tan ^3(c+d x)-\tan (c+d x)\right )}{d}\right )}{\sqrt {\cos (c+d x)}}\)

Input:

Int[(Sqrt[b*Cos[c + d*x]]*(A + B*Cos[c + d*x]))/Cos[c + d*x]^(9/2),x]
 

Output:

(Sqrt[b*Cos[c + d*x]]*(B*(ArcTanh[Sin[c + d*x]]/(2*d) + (Sec[c + d*x]*Tan[ 
c + d*x])/(2*d)) - (A*(-Tan[c + d*x] - Tan[c + d*x]^3/3))/d))/Sqrt[Cos[c + 
 d*x]]
 

Defintions of rubi rules used

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 2031
Int[(Fx_.)*((a_.)*(v_))^(m_)*((b_.)*(v_))^(n_), x_Symbol] :> Simp[a^(m + 1/ 
2)*b^(n - 1/2)*(Sqrt[b*v]/Sqrt[a*v])   Int[v^(m + n)*Fx, x], x] /; FreeQ[{a 
, b, m}, x] &&  !IntegerQ[m] && IGtQ[n + 1/2, 0] && IntegerQ[m + n]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 3227
Int[((b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*sin[(e_.) + (f_.)*(x 
_)]), x_Symbol] :> Simp[c   Int[(b*Sin[e + f*x])^m, x], x] + Simp[d/b   Int 
[(b*Sin[e + f*x])^(m + 1), x], x] /; FreeQ[{b, c, d, e, f, m}, x]
 

rule 4254
Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> Simp[-d^(-1)   Subst[Int[Exp 
andIntegrand[(1 + x^2)^(n/2 - 1), x], x], x, Cot[c + d*x]], x] /; FreeQ[{c, 
 d}, x] && IGtQ[n/2, 0]
 

rule 4255
Int[(csc[(c_.) + (d_.)*(x_)]*(b_.))^(n_), x_Symbol] :> Simp[(-b)*Cos[c + d* 
x]*((b*Csc[c + d*x])^(n - 1)/(d*(n - 1))), x] + Simp[b^2*((n - 2)/(n - 1)) 
  Int[(b*Csc[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1] 
&& IntegerQ[2*n]
 

rule 4257
Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] 
 /; FreeQ[{c, d}, x]
 
Maple [A] (verified)

Time = 8.79 (sec) , antiderivative size = 116, normalized size of antiderivative = 0.80

method result size
default \(\frac {\left (-3 B \cos \left (d x +c \right )^{3} \ln \left (-\cot \left (d x +c \right )+\csc \left (d x +c \right )-1\right )+3 B \cos \left (d x +c \right )^{3} \ln \left (-\cot \left (d x +c \right )+\csc \left (d x +c \right )+1\right )+\left (4 \cos \left (d x +c \right )^{2}+2\right ) \sin \left (d x +c \right ) A +3 B \cos \left (d x +c \right ) \sin \left (d x +c \right )\right ) \sqrt {\cos \left (d x +c \right ) b}}{6 d \cos \left (d x +c \right )^{\frac {7}{2}}}\) \(116\)
parts \(\frac {B \left (\cos \left (d x +c \right )^{2} \ln \left (-\cot \left (d x +c \right )+\csc \left (d x +c \right )+1\right )-\cos \left (d x +c \right )^{2} \ln \left (-\cot \left (d x +c \right )+\csc \left (d x +c \right )-1\right )+\sin \left (d x +c \right )\right ) \sqrt {\cos \left (d x +c \right ) b}}{2 d \cos \left (d x +c \right )^{\frac {5}{2}}}+\frac {A \sin \left (d x +c \right ) \left (2 \cos \left (d x +c \right )^{2}+1\right ) \sqrt {\cos \left (d x +c \right ) b}}{3 d \cos \left (d x +c \right )^{\frac {7}{2}}}\) \(128\)
risch \(-\frac {i \sqrt {\cos \left (d x +c \right ) b}\, \left (3 B \,{\mathrm e}^{5 i \left (d x +c \right )}-12 A \,{\mathrm e}^{2 i \left (d x +c \right )}-3 B \,{\mathrm e}^{i \left (d x +c \right )}-4 A \right )}{3 \sqrt {\cos \left (d x +c \right )}\, d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{3}}+\frac {\sqrt {\cos \left (d x +c \right ) b}\, B \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{2 \sqrt {\cos \left (d x +c \right )}\, d}-\frac {\sqrt {\cos \left (d x +c \right ) b}\, B \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{2 \sqrt {\cos \left (d x +c \right )}\, d}\) \(153\)

Input:

int((cos(d*x+c)*b)^(1/2)*(A+B*cos(d*x+c))/cos(d*x+c)^(9/2),x,method=_RETUR 
NVERBOSE)
 

Output:

1/6/d*(-3*B*cos(d*x+c)^3*ln(-cot(d*x+c)+csc(d*x+c)-1)+3*B*cos(d*x+c)^3*ln( 
-cot(d*x+c)+csc(d*x+c)+1)+(4*cos(d*x+c)^2+2)*sin(d*x+c)*A+3*B*cos(d*x+c)*s 
in(d*x+c))*(cos(d*x+c)*b)^(1/2)/cos(d*x+c)^(7/2)
 

Fricas [A] (verification not implemented)

Time = 0.12 (sec) , antiderivative size = 253, normalized size of antiderivative = 1.74 \[ \int \frac {\sqrt {b \cos (c+d x)} (A+B \cos (c+d x))}{\cos ^{\frac {9}{2}}(c+d x)} \, dx=\left [\frac {3 \, B \sqrt {b} \cos \left (d x + c\right )^{4} \log \left (-\frac {b \cos \left (d x + c\right )^{3} - 2 \, \sqrt {b \cos \left (d x + c\right )} \sqrt {b} \sqrt {\cos \left (d x + c\right )} \sin \left (d x + c\right ) - 2 \, b \cos \left (d x + c\right )}{\cos \left (d x + c\right )^{3}}\right ) + 2 \, {\left (4 \, A \cos \left (d x + c\right )^{2} + 3 \, B \cos \left (d x + c\right ) + 2 \, A\right )} \sqrt {b \cos \left (d x + c\right )} \sqrt {\cos \left (d x + c\right )} \sin \left (d x + c\right )}{12 \, d \cos \left (d x + c\right )^{4}}, -\frac {3 \, B \sqrt {-b} \arctan \left (\frac {\sqrt {b \cos \left (d x + c\right )} \sqrt {-b} \sin \left (d x + c\right )}{b \sqrt {\cos \left (d x + c\right )}}\right ) \cos \left (d x + c\right )^{4} - {\left (4 \, A \cos \left (d x + c\right )^{2} + 3 \, B \cos \left (d x + c\right ) + 2 \, A\right )} \sqrt {b \cos \left (d x + c\right )} \sqrt {\cos \left (d x + c\right )} \sin \left (d x + c\right )}{6 \, d \cos \left (d x + c\right )^{4}}\right ] \] Input:

integrate((b*cos(d*x+c))^(1/2)*(A+B*cos(d*x+c))/cos(d*x+c)^(9/2),x, algori 
thm="fricas")
 

Output:

[1/12*(3*B*sqrt(b)*cos(d*x + c)^4*log(-(b*cos(d*x + c)^3 - 2*sqrt(b*cos(d* 
x + c))*sqrt(b)*sqrt(cos(d*x + c))*sin(d*x + c) - 2*b*cos(d*x + c))/cos(d* 
x + c)^3) + 2*(4*A*cos(d*x + c)^2 + 3*B*cos(d*x + c) + 2*A)*sqrt(b*cos(d*x 
 + c))*sqrt(cos(d*x + c))*sin(d*x + c))/(d*cos(d*x + c)^4), -1/6*(3*B*sqrt 
(-b)*arctan(sqrt(b*cos(d*x + c))*sqrt(-b)*sin(d*x + c)/(b*sqrt(cos(d*x + c 
))))*cos(d*x + c)^4 - (4*A*cos(d*x + c)^2 + 3*B*cos(d*x + c) + 2*A)*sqrt(b 
*cos(d*x + c))*sqrt(cos(d*x + c))*sin(d*x + c))/(d*cos(d*x + c)^4)]
 

Sympy [F(-1)]

Timed out. \[ \int \frac {\sqrt {b \cos (c+d x)} (A+B \cos (c+d x))}{\cos ^{\frac {9}{2}}(c+d x)} \, dx=\text {Timed out} \] Input:

integrate((b*cos(d*x+c))**(1/2)*(A+B*cos(d*x+c))/cos(d*x+c)**(9/2),x)
 

Output:

Timed out
 

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 957 vs. \(2 (123) = 246\).

Time = 0.30 (sec) , antiderivative size = 957, normalized size of antiderivative = 6.60 \[ \int \frac {\sqrt {b \cos (c+d x)} (A+B \cos (c+d x))}{\cos ^{\frac {9}{2}}(c+d x)} \, dx=\text {Too large to display} \] Input:

integrate((b*cos(d*x+c))^(1/2)*(A+B*cos(d*x+c))/cos(d*x+c)^(9/2),x, algori 
thm="maxima")
 

Output:

1/12*(16*((3*cos(2*d*x + 2*c) + 1)*sin(6*d*x + 6*c) + 3*(3*cos(2*d*x + 2*c 
) + 1)*sin(4*d*x + 4*c) - 3*cos(6*d*x + 6*c)*sin(2*d*x + 2*c) - 9*cos(4*d* 
x + 4*c)*sin(2*d*x + 2*c))*A*sqrt(b)/(2*(3*cos(4*d*x + 4*c) + 3*cos(2*d*x 
+ 2*c) + 1)*cos(6*d*x + 6*c) + cos(6*d*x + 6*c)^2 + 6*(3*cos(2*d*x + 2*c) 
+ 1)*cos(4*d*x + 4*c) + 9*cos(4*d*x + 4*c)^2 + 9*cos(2*d*x + 2*c)^2 + 6*(s 
in(4*d*x + 4*c) + sin(2*d*x + 2*c))*sin(6*d*x + 6*c) + sin(6*d*x + 6*c)^2 
+ 9*sin(4*d*x + 4*c)^2 + 18*sin(4*d*x + 4*c)*sin(2*d*x + 2*c) + 9*sin(2*d* 
x + 2*c)^2 + 6*cos(2*d*x + 2*c) + 1) - 3*(4*(sin(4*d*x + 4*c) + 2*sin(2*d* 
x + 2*c))*cos(3/2*arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c))) - 4*(sin(4* 
d*x + 4*c) + 2*sin(2*d*x + 2*c))*cos(1/2*arctan2(sin(2*d*x + 2*c), cos(2*d 
*x + 2*c))) - (2*(2*cos(2*d*x + 2*c) + 1)*cos(4*d*x + 4*c) + cos(4*d*x + 4 
*c)^2 + 4*cos(2*d*x + 2*c)^2 + sin(4*d*x + 4*c)^2 + 4*sin(4*d*x + 4*c)*sin 
(2*d*x + 2*c) + 4*sin(2*d*x + 2*c)^2 + 4*cos(2*d*x + 2*c) + 1)*log(cos(1/2 
*arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c)))^2 + sin(1/2*arctan2(sin(2*d* 
x + 2*c), cos(2*d*x + 2*c)))^2 + 2*sin(1/2*arctan2(sin(2*d*x + 2*c), cos(2 
*d*x + 2*c))) + 1) + (2*(2*cos(2*d*x + 2*c) + 1)*cos(4*d*x + 4*c) + cos(4* 
d*x + 4*c)^2 + 4*cos(2*d*x + 2*c)^2 + sin(4*d*x + 4*c)^2 + 4*sin(4*d*x + 4 
*c)*sin(2*d*x + 2*c) + 4*sin(2*d*x + 2*c)^2 + 4*cos(2*d*x + 2*c) + 1)*log( 
cos(1/2*arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c)))^2 + sin(1/2*arctan2(s 
in(2*d*x + 2*c), cos(2*d*x + 2*c)))^2 - 2*sin(1/2*arctan2(sin(2*d*x + 2...
 

Giac [A] (verification not implemented)

Time = 0.34 (sec) , antiderivative size = 149, normalized size of antiderivative = 1.03 \[ \int \frac {\sqrt {b \cos (c+d x)} (A+B \cos (c+d x))}{\cos ^{\frac {9}{2}}(c+d x)} \, dx=\frac {{\left (3 \, B \log \left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1\right ) - 3 \, B \log \left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1\right ) - \frac {2 \, {\left (6 \, A \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 3 \, B \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 4 \, A \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 6 \, A \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 3 \, B \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{6} - 3 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 3 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1}\right )} \sqrt {b}}{6 \, d} \] Input:

integrate((b*cos(d*x+c))^(1/2)*(A+B*cos(d*x+c))/cos(d*x+c)^(9/2),x, algori 
thm="giac")
 

Output:

1/6*(3*B*log(tan(1/2*d*x + 1/2*c) + 1) - 3*B*log(tan(1/2*d*x + 1/2*c) - 1) 
 - 2*(6*A*tan(1/2*d*x + 1/2*c)^5 - 3*B*tan(1/2*d*x + 1/2*c)^5 - 4*A*tan(1/ 
2*d*x + 1/2*c)^3 + 6*A*tan(1/2*d*x + 1/2*c) + 3*B*tan(1/2*d*x + 1/2*c))/(t 
an(1/2*d*x + 1/2*c)^6 - 3*tan(1/2*d*x + 1/2*c)^4 + 3*tan(1/2*d*x + 1/2*c)^ 
2 - 1))*sqrt(b)/d
 

Mupad [F(-1)]

Timed out. \[ \int \frac {\sqrt {b \cos (c+d x)} (A+B \cos (c+d x))}{\cos ^{\frac {9}{2}}(c+d x)} \, dx=\int \frac {\sqrt {b\,\cos \left (c+d\,x\right )}\,\left (A+B\,\cos \left (c+d\,x\right )\right )}{{\cos \left (c+d\,x\right )}^{9/2}} \,d x \] Input:

int(((b*cos(c + d*x))^(1/2)*(A + B*cos(c + d*x)))/cos(c + d*x)^(9/2),x)
 

Output:

int(((b*cos(c + d*x))^(1/2)*(A + B*cos(c + d*x)))/cos(c + d*x)^(9/2), x)
 

Reduce [B] (verification not implemented)

Time = 0.17 (sec) , antiderivative size = 163, normalized size of antiderivative = 1.12 \[ \int \frac {\sqrt {b \cos (c+d x)} (A+B \cos (c+d x))}{\cos ^{\frac {9}{2}}(c+d x)} \, dx=\frac {\sqrt {b}\, \left (-3 \cos \left (d x +c \right ) \mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) \sin \left (d x +c \right )^{2} b +3 \cos \left (d x +c \right ) \mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) b +3 \cos \left (d x +c \right ) \mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) \sin \left (d x +c \right )^{2} b -3 \cos \left (d x +c \right ) \mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) b -3 \cos \left (d x +c \right ) \sin \left (d x +c \right ) b +4 \sin \left (d x +c \right )^{3} a -6 \sin \left (d x +c \right ) a \right )}{6 \cos \left (d x +c \right ) d \left (\sin \left (d x +c \right )^{2}-1\right )} \] Input:

int((b*cos(d*x+c))^(1/2)*(A+B*cos(d*x+c))/cos(d*x+c)^(9/2),x)
 

Output:

(sqrt(b)*( - 3*cos(c + d*x)*log(tan((c + d*x)/2) - 1)*sin(c + d*x)**2*b + 
3*cos(c + d*x)*log(tan((c + d*x)/2) - 1)*b + 3*cos(c + d*x)*log(tan((c + d 
*x)/2) + 1)*sin(c + d*x)**2*b - 3*cos(c + d*x)*log(tan((c + d*x)/2) + 1)*b 
 - 3*cos(c + d*x)*sin(c + d*x)*b + 4*sin(c + d*x)**3*a - 6*sin(c + d*x)*a) 
)/(6*cos(c + d*x)*d*(sin(c + d*x)**2 - 1))