\(\int \sin ^4(c+d x) (a+b \tan (c+d x))^2 \, dx\) [22]

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

Optimal result

Integrand size = 21, antiderivative size = 122 \[ \int \sin ^4(c+d x) (a+b \tan (c+d x))^2 \, dx=\frac {3}{8} \left (a^2-5 b^2\right ) x+\frac {3 a b \cos ^2(c+d x)}{2 d}-\frac {2 a b \log (\cos (c+d x))}{d}-\frac {\left (5 a^2-7 b^2\right ) \cos (c+d x) \sin (c+d x)}{8 d}+\frac {b^2 \tan (c+d x)}{d}+\frac {\cos ^3(c+d x) \sin (c+d x) (a+b \tan (c+d x))^2}{4 d} \] Output:

3/8*(a^2-5*b^2)*x+3/2*a*b*cos(d*x+c)^2/d-2*a*b*ln(cos(d*x+c))/d-1/8*(5*a^2 
-7*b^2)*cos(d*x+c)*sin(d*x+c)/d+b^2*tan(d*x+c)/d+1/4*cos(d*x+c)^3*sin(d*x+ 
c)*(a+b*tan(d*x+c))^2/d
 

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(250\) vs. \(2(122)=244\).

Time = 1.94 (sec) , antiderivative size = 250, normalized size of antiderivative = 2.05 \[ \int \sin ^4(c+d x) (a+b \tan (c+d x))^2 \, dx=\frac {b \left (\frac {3 \left (a^2-b^2\right ) \arctan (\tan (c+d x))}{b}+\frac {4 \left (-2 a^2+3 b^2\right ) \arctan (\tan (c+d x))}{b}+16 a \cos ^2(c+d x)-4 a \cos ^4(c+d x)+4 \left (2 a+\frac {a^2-3 b^2}{\sqrt {-b^2}}\right ) \log \left (\sqrt {-b^2}-b \tan (c+d x)\right )+4 \left (2 a+\frac {-a^2+3 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 ) \cos ^3(c+d x) \sin (c+d x)}{b}+\frac {3 (a-b) (a+b) \sin (2 (c+d x))}{2 b}+\frac {2 \left (-2 a^2+3 b^2\right ) \sin (2 (c+d x))}{b}+8 b \tan (c+d x)\right )}{8 d} \] Input:

Integrate[Sin[c + d*x]^4*(a + b*Tan[c + d*x])^2,x]
 

Output:

(b*((3*(a^2 - b^2)*ArcTan[Tan[c + d*x]])/b + (4*(-2*a^2 + 3*b^2)*ArcTan[Ta 
n[c + d*x]])/b + 16*a*Cos[c + d*x]^2 - 4*a*Cos[c + d*x]^4 + 4*(2*a + (a^2 
- 3*b^2)/Sqrt[-b^2])*Log[Sqrt[-b^2] - b*Tan[c + d*x]] + 4*(2*a + (-a^2 + 3 
*b^2)/Sqrt[-b^2])*Log[Sqrt[-b^2] + b*Tan[c + d*x]] + (2*(a^2 - b^2)*Cos[c 
+ d*x]^3*Sin[c + d*x])/b + (3*(a - b)*(a + b)*Sin[2*(c + d*x)])/(2*b) + (2 
*(-2*a^2 + 3*b^2)*Sin[2*(c + d*x)])/b + 8*b*Tan[c + d*x]))/(8*d)
 

Rubi [A] (verified)

Time = 0.46 (sec) , antiderivative size = 171, normalized size of antiderivative = 1.40, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.286, Rules used = {3042, 3999, 531, 2176, 2341, 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 \sin ^4(c+d x) (a+b \tan (c+d x))^2 \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \sin (c+d x)^4 (a+b \tan (c+d x))^2dx\)

\(\Big \downarrow \) 3999

\(\displaystyle \frac {b \int \frac {b^4 \tan ^4(c+d x) (a+b \tan (c+d x))^2}{\left (\tan ^2(c+d x) b^2+b^2\right )^3}d(b \tan (c+d x))}{d}\)

\(\Big \downarrow \) 531

\(\displaystyle \frac {b \left (\frac {b^3 \tan (c+d x) (a+b \tan (c+d x))^2}{4 \left (b^2 \tan ^2(c+d x)+b^2\right )^2}-\frac {\int \frac {(a+b \tan (c+d x)) \left (-4 \tan ^3(c+d x) b^5+3 \tan (c+d x) b^5-4 a \tan ^2(c+d x) b^4+a b^4\right )}{\left (\tan ^2(c+d x) b^2+b^2\right )^2}d(b \tan (c+d x))}{4 b^2}\right )}{d}\)

\(\Big \downarrow \) 2176

\(\displaystyle \frac {b \left (\frac {b^3 \tan (c+d x) (a+b \tan (c+d x))^2}{4 \left (b^2 \tan ^2(c+d x)+b^2\right )^2}-\frac {-\frac {\int \frac {8 \tan ^2(c+d x) b^6+16 a \tan (c+d x) b^5+\left (3 a^2-7 b^2\right ) b^4}{\tan ^2(c+d x) b^2+b^2}d(b \tan (c+d x))}{2 b^2}-\frac {b^2 (a+b \tan (c+d x)) \left (7 b^2-5 a b \tan (c+d x)\right )}{2 \left (b^2 \tan ^2(c+d x)+b^2\right )}}{4 b^2}\right )}{d}\)

\(\Big \downarrow \) 2341

\(\displaystyle \frac {b \left (\frac {b^3 \tan (c+d x) (a+b \tan (c+d x))^2}{4 \left (b^2 \tan ^2(c+d x)+b^2\right )^2}-\frac {-\frac {\int \left (8 b^4+\frac {16 a \tan (c+d x) b^5+3 \left (a^2-5 b^2\right ) b^4}{\tan ^2(c+d x) b^2+b^2}\right )d(b \tan (c+d x))}{2 b^2}-\frac {b^2 (a+b \tan (c+d x)) \left (7 b^2-5 a b \tan (c+d x)\right )}{2 \left (b^2 \tan ^2(c+d x)+b^2\right )}}{4 b^2}\right )}{d}\)

\(\Big \downarrow \) 2009

\(\displaystyle \frac {b \left (\frac {b^3 \tan (c+d x) (a+b \tan (c+d x))^2}{4 \left (b^2 \tan ^2(c+d x)+b^2\right )^2}-\frac {-\frac {3 b^3 \left (a^2-5 b^2\right ) \arctan (\tan (c+d x))+8 a b^4 \log \left (b^2 \tan ^2(c+d x)+b^2\right )+8 b^5 \tan (c+d x)}{2 b^2}-\frac {b^2 (a+b \tan (c+d x)) \left (7 b^2-5 a b \tan (c+d x)\right )}{2 \left (b^2 \tan ^2(c+d x)+b^2\right )}}{4 b^2}\right )}{d}\)

Input:

Int[Sin[c + d*x]^4*(a + b*Tan[c + d*x])^2,x]
 

Output:

(b*((b^3*Tan[c + d*x]*(a + b*Tan[c + d*x])^2)/(4*(b^2 + b^2*Tan[c + d*x]^2 
)^2) - (-1/2*(3*b^3*(a^2 - 5*b^2)*ArcTan[Tan[c + d*x]] + 8*a*b^4*Log[b^2 + 
 b^2*Tan[c + d*x]^2] + 8*b^5*Tan[c + d*x])/b^2 - (b^2*(a + b*Tan[c + d*x]) 
*(7*b^2 - 5*a*b*Tan[c + d*x]))/(2*(b^2 + b^2*Tan[c + d*x]^2)))/(4*b^2)))/d
 

Defintions of rubi rules used

rule 531
Int[(x_)^(m_.)*((c_) + (d_.)*(x_))^(n_.)*((a_) + (b_.)*(x_)^2)^(p_), x_Symb 
ol] :> With[{Qx = PolynomialQuotient[x^m, a + b*x^2, x], e = Coeff[Polynomi 
alRemainder[x^m, a + b*x^2, x], x, 0], f = Coeff[PolynomialRemainder[x^m, a 
 + b*x^2, x], x, 1]}, Simp[(c + d*x)^n*(a*f - b*e*x)*((a + b*x^2)^(p + 1)/( 
2*a*b*(p + 1))), x] + Simp[1/(2*a*b*(p + 1))   Int[(c + d*x)^(n - 1)*(a + b 
*x^2)^(p + 1)*ExpandToSum[2*a*b*(p + 1)*(c + d*x)*Qx - a*d*f*n + b*c*e*(2*p 
 + 3) + b*d*e*(n + 2*p + 3)*x, x], x], x]] /; FreeQ[{a, b, c, d}, x] && IGt 
Q[n, 0] && IGtQ[m, 0] && LtQ[p, -1] && GtQ[n, 1] && IntegerQ[2*p]
 

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

rule 2176
Int[(Pq_)*((d_) + (e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^2)^(p_), x_Symbol] : 
> With[{Qx = PolynomialQuotient[Pq, a + b*x^2, x], R = Coeff[PolynomialRema 
inder[Pq, a + b*x^2, x], x, 0], S = Coeff[PolynomialRemainder[Pq, a + b*x^2 
, x], x, 1]}, Simp[(d + e*x)^m*(a + b*x^2)^(p + 1)*((a*S - b*R*x)/(2*a*b*(p 
 + 1))), x] + Simp[1/(2*a*b*(p + 1))   Int[(d + e*x)^(m - 1)*(a + b*x^2)^(p 
 + 1)*ExpandToSum[2*a*b*(p + 1)*(d + e*x)*Qx - a*e*S*m + b*d*R*(2*p + 3) + 
b*e*R*(m + 2*p + 3)*x, x], x], x]] /; FreeQ[{a, b, d, e}, x] && PolyQ[Pq, x 
] && NeQ[b*d^2 + a*e^2, 0] && LtQ[p, -1] && GtQ[m, 0] &&  !(IGtQ[m, 0] && R 
ationalQ[a, b, d, e] && (IntegerQ[p] || ILtQ[p + 1/2, 0]))
 

rule 2341
Int[(Pq_)*((a_) + (b_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegrand[Pq* 
(a + b*x^2)^p, x], x] /; FreeQ[{a, b}, x] && PolyQ[Pq, x] && IGtQ[p, -2]
 

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

rule 3999
Int[sin[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_ 
), x_Symbol] :> Simp[b/f   Subst[Int[x^m*((a + x)^n/(b^2 + x^2)^(m/2 + 1)), 
 x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, n}, x] && IntegerQ[m/2]
 
Maple [A] (verified)

Time = 3.46 (sec) , antiderivative size = 140, normalized size of antiderivative = 1.15

method result size
derivativedivides \(\frac {a^{2} \left (-\frac {\left (\sin \left (d x +c \right )^{3}+\frac {3 \sin \left (d x +c \right )}{2}\right ) \cos \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )+2 a b \left (-\frac {\sin \left (d x +c \right )^{4}}{4}-\frac {\sin \left (d x +c \right )^{2}}{2}-\ln \left (\cos \left (d x +c \right )\right )\right )+b^{2} \left (\frac {\sin \left (d x +c \right )^{7}}{\cos \left (d x +c \right )}+\left (\sin \left (d x +c \right )^{5}+\frac {5 \sin \left (d x +c \right )^{3}}{4}+\frac {15 \sin \left (d x +c \right )}{8}\right ) \cos \left (d x +c \right )-\frac {15 d x}{8}-\frac {15 c}{8}\right )}{d}\) \(140\)
default \(\frac {a^{2} \left (-\frac {\left (\sin \left (d x +c \right )^{3}+\frac {3 \sin \left (d x +c \right )}{2}\right ) \cos \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )+2 a b \left (-\frac {\sin \left (d x +c \right )^{4}}{4}-\frac {\sin \left (d x +c \right )^{2}}{2}-\ln \left (\cos \left (d x +c \right )\right )\right )+b^{2} \left (\frac {\sin \left (d x +c \right )^{7}}{\cos \left (d x +c \right )}+\left (\sin \left (d x +c \right )^{5}+\frac {5 \sin \left (d x +c \right )^{3}}{4}+\frac {15 \sin \left (d x +c \right )}{8}\right ) \cos \left (d x +c \right )-\frac {15 d x}{8}-\frac {15 c}{8}\right )}{d}\) \(140\)
risch \(2 i x a b +\frac {3 a^{2} x}{8}-\frac {15 b^{2} x}{8}+\frac {3 \,{\mathrm e}^{2 i \left (d x +c \right )} a b}{8 d}-\frac {i {\mathrm e}^{2 i \left (d x +c \right )} b^{2}}{4 d}-\frac {i {\mathrm e}^{-2 i \left (d x +c \right )} a^{2}}{8 d}+\frac {3 \,{\mathrm e}^{-2 i \left (d x +c \right )} a b}{8 d}+\frac {4 i a b c}{d}+\frac {i {\mathrm e}^{-2 i \left (d x +c \right )} b^{2}}{4 d}+\frac {2 i b^{2}}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}+\frac {i {\mathrm e}^{2 i \left (d x +c \right )} a^{2}}{8 d}-\frac {2 a b \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}{d}-\frac {a b \cos \left (4 d x +4 c \right )}{16 d}+\frac {\sin \left (4 d x +4 c \right ) a^{2}}{32 d}-\frac {\sin \left (4 d x +4 c \right ) b^{2}}{32 d}\) \(224\)

Input:

int(sin(d*x+c)^4*(a+b*tan(d*x+c))^2,x,method=_RETURNVERBOSE)
 

Output:

1/d*(a^2*(-1/4*(sin(d*x+c)^3+3/2*sin(d*x+c))*cos(d*x+c)+3/8*d*x+3/8*c)+2*a 
*b*(-1/4*sin(d*x+c)^4-1/2*sin(d*x+c)^2-ln(cos(d*x+c)))+b^2*(sin(d*x+c)^7/c 
os(d*x+c)+(sin(d*x+c)^5+5/4*sin(d*x+c)^3+15/8*sin(d*x+c))*cos(d*x+c)-15/8* 
d*x-15/8*c))
 

Fricas [A] (verification not implemented)

Time = 0.10 (sec) , antiderivative size = 137, normalized size of antiderivative = 1.12 \[ \int \sin ^4(c+d x) (a+b \tan (c+d x))^2 \, dx=-\frac {8 \, a b \cos \left (d x + c\right )^{5} - 32 \, a b \cos \left (d x + c\right )^{3} + 32 \, a b \cos \left (d x + c\right ) \log \left (-\cos \left (d x + c\right )\right ) - {\left (6 \, {\left (a^{2} - 5 \, b^{2}\right )} d x - 13 \, a b\right )} \cos \left (d x + c\right ) - 2 \, {\left (2 \, {\left (a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{4} - {\left (5 \, a^{2} - 9 \, b^{2}\right )} \cos \left (d x + c\right )^{2} + 8 \, b^{2}\right )} \sin \left (d x + c\right )}{16 \, d \cos \left (d x + c\right )} \] Input:

integrate(sin(d*x+c)^4*(a+b*tan(d*x+c))^2,x, algorithm="fricas")
 

Output:

-1/16*(8*a*b*cos(d*x + c)^5 - 32*a*b*cos(d*x + c)^3 + 32*a*b*cos(d*x + c)* 
log(-cos(d*x + c)) - (6*(a^2 - 5*b^2)*d*x - 13*a*b)*cos(d*x + c) - 2*(2*(a 
^2 - b^2)*cos(d*x + c)^4 - (5*a^2 - 9*b^2)*cos(d*x + c)^2 + 8*b^2)*sin(d*x 
 + c))/(d*cos(d*x + c))
 

Sympy [F]

\[ \int \sin ^4(c+d x) (a+b \tan (c+d x))^2 \, dx=\int \left (a + b \tan {\left (c + d x \right )}\right )^{2} \sin ^{4}{\left (c + d x \right )}\, dx \] Input:

integrate(sin(d*x+c)**4*(a+b*tan(d*x+c))**2,x)
 

Output:

Integral((a + b*tan(c + d*x))**2*sin(c + d*x)**4, x)
 

Maxima [A] (verification not implemented)

Time = 0.12 (sec) , antiderivative size = 128, normalized size of antiderivative = 1.05 \[ \int \sin ^4(c+d x) (a+b \tan (c+d x))^2 \, dx=\frac {8 \, a b \log \left (\tan \left (d x + c\right )^{2} + 1\right ) + 8 \, b^{2} \tan \left (d x + c\right ) + 3 \, {\left (a^{2} - 5 \, b^{2}\right )} {\left (d x + c\right )} + \frac {16 \, a b \tan \left (d x + c\right )^{2} - {\left (5 \, a^{2} - 9 \, b^{2}\right )} \tan \left (d x + c\right )^{3} + 12 \, a b - {\left (3 \, a^{2} - 7 \, b^{2}\right )} \tan \left (d x + c\right )}{\tan \left (d x + c\right )^{4} + 2 \, \tan \left (d x + c\right )^{2} + 1}}{8 \, d} \] Input:

integrate(sin(d*x+c)^4*(a+b*tan(d*x+c))^2,x, algorithm="maxima")
 

Output:

1/8*(8*a*b*log(tan(d*x + c)^2 + 1) + 8*b^2*tan(d*x + c) + 3*(a^2 - 5*b^2)* 
(d*x + c) + (16*a*b*tan(d*x + c)^2 - (5*a^2 - 9*b^2)*tan(d*x + c)^3 + 12*a 
*b - (3*a^2 - 7*b^2)*tan(d*x + c))/(tan(d*x + c)^4 + 2*tan(d*x + c)^2 + 1) 
)/d
 

Giac [A] (verification not implemented)

Time = 0.20 (sec) , antiderivative size = 124, normalized size of antiderivative = 1.02 \[ \int \sin ^4(c+d x) (a+b \tan (c+d x))^2 \, dx=\frac {a b \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{d} + \frac {b^{2} \tan \left (d x + c\right )}{d} + \frac {3 \, {\left (a^{2} - 5 \, b^{2}\right )} {\left (d x + c\right )}}{8 \, d} + \frac {16 \, a b \tan \left (d x + c\right )^{2} - {\left (5 \, a^{2} - 9 \, b^{2}\right )} \tan \left (d x + c\right )^{3} + 12 \, a b - {\left (3 \, a^{2} - 7 \, b^{2}\right )} \tan \left (d x + c\right )}{8 \, {\left (\tan \left (d x + c\right )^{2} + 1\right )}^{2} d} \] Input:

integrate(sin(d*x+c)^4*(a+b*tan(d*x+c))^2,x, algorithm="giac")
 

Output:

a*b*log(tan(d*x + c)^2 + 1)/d + b^2*tan(d*x + c)/d + 3/8*(a^2 - 5*b^2)*(d* 
x + c)/d + 1/8*(16*a*b*tan(d*x + c)^2 - (5*a^2 - 9*b^2)*tan(d*x + c)^3 + 1 
2*a*b - (3*a^2 - 7*b^2)*tan(d*x + c))/((tan(d*x + c)^2 + 1)^2*d)
 

Mupad [B] (verification not implemented)

Time = 0.85 (sec) , antiderivative size = 127, normalized size of antiderivative = 1.04 \[ \int \sin ^4(c+d x) (a+b \tan (c+d x))^2 \, dx=x\,\left (\frac {3\,a^2}{8}-\frac {15\,b^2}{8}\right )+\frac {b^2\,\mathrm {tan}\left (c+d\,x\right )}{d}+\frac {\left (\frac {9\,b^2}{8}-\frac {5\,a^2}{8}\right )\,{\mathrm {tan}\left (c+d\,x\right )}^3+2\,a\,b\,{\mathrm {tan}\left (c+d\,x\right )}^2+\left (\frac {7\,b^2}{8}-\frac {3\,a^2}{8}\right )\,\mathrm {tan}\left (c+d\,x\right )+\frac {3\,a\,b}{2}}{d\,\left ({\mathrm {tan}\left (c+d\,x\right )}^4+2\,{\mathrm {tan}\left (c+d\,x\right )}^2+1\right )}+\frac {a\,b\,\ln \left ({\mathrm {tan}\left (c+d\,x\right )}^2+1\right )}{d} \] Input:

int(sin(c + d*x)^4*(a + b*tan(c + d*x))^2,x)
 

Output:

x*((3*a^2)/8 - (15*b^2)/8) + (b^2*tan(c + d*x))/d + ((3*a*b)/2 - tan(c + d 
*x)*((3*a^2)/8 - (7*b^2)/8) - tan(c + d*x)^3*((5*a^2)/8 - (9*b^2)/8) + 2*a 
*b*tan(c + d*x)^2)/(d*(2*tan(c + d*x)^2 + tan(c + d*x)^4 + 1)) + (a*b*log( 
tan(c + d*x)^2 + 1))/d
 

Reduce [B] (verification not implemented)

Time = 0.21 (sec) , antiderivative size = 241, normalized size of antiderivative = 1.98 \[ \int \sin ^4(c+d x) (a+b \tan (c+d x))^2 \, dx=\frac {16 \cos \left (d x +c \right ) \mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+1\right ) a b -16 \cos \left (d x +c \right ) \mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) a b -16 \cos \left (d x +c \right ) \mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) a b -4 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{4} a b -8 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{2} a b +3 \cos \left (d x +c \right ) a^{2} c +3 \cos \left (d x +c \right ) a^{2} d x -15 \cos \left (d x +c \right ) b^{2} c -15 \cos \left (d x +c \right ) b^{2} d x +2 \sin \left (d x +c \right )^{5} a^{2}-2 \sin \left (d x +c \right )^{5} b^{2}+\sin \left (d x +c \right )^{3} a^{2}-5 \sin \left (d x +c \right )^{3} b^{2}-3 \sin \left (d x +c \right ) a^{2}+15 \sin \left (d x +c \right ) b^{2}}{8 \cos \left (d x +c \right ) d} \] Input:

int(sin(d*x+c)^4*(a+b*tan(d*x+c))^2,x)
 

Output:

(16*cos(c + d*x)*log(tan((c + d*x)/2)**2 + 1)*a*b - 16*cos(c + d*x)*log(ta 
n((c + d*x)/2) - 1)*a*b - 16*cos(c + d*x)*log(tan((c + d*x)/2) + 1)*a*b - 
4*cos(c + d*x)*sin(c + d*x)**4*a*b - 8*cos(c + d*x)*sin(c + d*x)**2*a*b + 
3*cos(c + d*x)*a**2*c + 3*cos(c + d*x)*a**2*d*x - 15*cos(c + d*x)*b**2*c - 
 15*cos(c + d*x)*b**2*d*x + 2*sin(c + d*x)**5*a**2 - 2*sin(c + d*x)**5*b** 
2 + sin(c + d*x)**3*a**2 - 5*sin(c + d*x)**3*b**2 - 3*sin(c + d*x)*a**2 + 
15*sin(c + d*x)*b**2)/(8*cos(c + d*x)*d)