Integrand size = 15, antiderivative size = 75 \[ \int \frac {\cos ^4(x)}{\left (a+b \sin ^2(x)\right )^2} \, dx=\frac {x}{b^2}-\frac {(2 a-b) \sqrt {a+b} \arctan \left (\frac {\sqrt {a+b} \tan (x)}{\sqrt {a}}\right )}{2 a^{3/2} b^2}+\frac {(a+b) \tan (x)}{2 a b \left (a+(a+b) \tan ^2(x)\right )} \] Output:
x/b^2-1/2*(2*a-b)*(a+b)^(1/2)*arctan((a+b)^(1/2)*tan(x)/a^(1/2))/a^(3/2)/b ^2+1/2*(a+b)*tan(x)/a/b/(a+(a+b)*tan(x)^2)
Time = 0.45 (sec) , antiderivative size = 79, normalized size of antiderivative = 1.05 \[ \int \frac {\cos ^4(x)}{\left (a+b \sin ^2(x)\right )^2} \, dx=\frac {2 x+\frac {\left (-2 a^2-a b+b^2\right ) \arctan \left (\frac {\sqrt {a+b} \tan (x)}{\sqrt {a}}\right )}{a^{3/2} \sqrt {a+b}}+\frac {b (a+b) \sin (2 x)}{a (2 a+b-b \cos (2 x))}}{2 b^2} \] Input:
Integrate[Cos[x]^4/(a + b*Sin[x]^2)^2,x]
Output:
(2*x + ((-2*a^2 - a*b + b^2)*ArcTan[(Sqrt[a + b]*Tan[x])/Sqrt[a]])/(a^(3/2 )*Sqrt[a + b]) + (b*(a + b)*Sin[2*x])/(a*(2*a + b - b*Cos[2*x])))/(2*b^2)
Time = 0.29 (sec) , antiderivative size = 87, normalized size of antiderivative = 1.16, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.400, Rules used = {3042, 3670, 316, 397, 216, 218}
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 {\cos ^4(x)}{\left (a+b \sin ^2(x)\right )^2} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\cos (x)^4}{\left (a+b \sin (x)^2\right )^2}dx\) |
\(\Big \downarrow \) 3670 |
\(\displaystyle \int \frac {1}{\left (\tan ^2(x)+1\right ) \left ((a+b) \tan ^2(x)+a\right )^2}d\tan (x)\) |
\(\Big \downarrow \) 316 |
\(\displaystyle \frac {(a+b) \tan (x)}{2 a b \left ((a+b) \tan ^2(x)+a\right )}-\frac {\int \frac {-\left ((a+b) \tan ^2(x)\right )+a-b}{\left (\tan ^2(x)+1\right ) \left ((a+b) \tan ^2(x)+a\right )}d\tan (x)}{2 a b}\) |
\(\Big \downarrow \) 397 |
\(\displaystyle \frac {(a+b) \tan (x)}{2 a b \left ((a+b) \tan ^2(x)+a\right )}-\frac {\frac {(2 a-b) (a+b) \int \frac {1}{(a+b) \tan ^2(x)+a}d\tan (x)}{b}-\frac {2 a \int \frac {1}{\tan ^2(x)+1}d\tan (x)}{b}}{2 a b}\) |
\(\Big \downarrow \) 216 |
\(\displaystyle \frac {(a+b) \tan (x)}{2 a b \left ((a+b) \tan ^2(x)+a\right )}-\frac {\frac {(2 a-b) (a+b) \int \frac {1}{(a+b) \tan ^2(x)+a}d\tan (x)}{b}-\frac {2 a \arctan (\tan (x))}{b}}{2 a b}\) |
\(\Big \downarrow \) 218 |
\(\displaystyle \frac {(a+b) \tan (x)}{2 a b \left ((a+b) \tan ^2(x)+a\right )}-\frac {\frac {(2 a-b) \sqrt {a+b} \arctan \left (\frac {\sqrt {a+b} \tan (x)}{\sqrt {a}}\right )}{\sqrt {a} b}-\frac {2 a \arctan (\tan (x))}{b}}{2 a b}\) |
Input:
Int[Cos[x]^4/(a + b*Sin[x]^2)^2,x]
Output:
-1/2*((-2*a*ArcTan[Tan[x]])/b + ((2*a - b)*Sqrt[a + b]*ArcTan[(Sqrt[a + b] *Tan[x])/Sqrt[a]])/(Sqrt[a]*b))/(a*b) + ((a + b)*Tan[x])/(2*a*b*(a + (a + b)*Tan[x]^2))
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*A rcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a , 0] || GtQ[b, 0])
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/R t[a/b, 2]], x] /; FreeQ[{a, b}, x] && PosQ[a/b]
Int[((a_) + (b_.)*(x_)^2)^(p_)*((c_) + (d_.)*(x_)^2)^(q_), x_Symbol] :> Sim p[(-b)*x*(a + b*x^2)^(p + 1)*((c + d*x^2)^(q + 1)/(2*a*(p + 1)*(b*c - a*d)) ), x] + Simp[1/(2*a*(p + 1)*(b*c - a*d)) Int[(a + b*x^2)^(p + 1)*(c + d*x ^2)^q*Simp[b*c + 2*(p + 1)*(b*c - a*d) + d*b*(2*(p + q + 2) + 1)*x^2, x], x ], x] /; FreeQ[{a, b, c, d, q}, x] && NeQ[b*c - a*d, 0] && LtQ[p, -1] && ! ( !IntegerQ[p] && IntegerQ[q] && LtQ[q, -1]) && IntBinomialQ[a, b, c, d, 2, p, q, x]
Int[((e_) + (f_.)*(x_)^2)/(((a_) + (b_.)*(x_)^2)*((c_) + (d_.)*(x_)^2)), x_ Symbol] :> Simp[(b*e - a*f)/(b*c - a*d) Int[1/(a + b*x^2), x], x] - Simp[ (d*e - c*f)/(b*c - a*d) Int[1/(c + d*x^2), x], x] /; FreeQ[{a, b, c, d, e , f}, x]
Int[cos[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]^2)^( p_.), x_Symbol] :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Simp[ff/f Su bst[Int[(a + (a + b)*ff^2*x^2)^p/(1 + ff^2*x^2)^(m/2 + p + 1), x], x, Tan[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f}, x] && IntegerQ[m/2] && IntegerQ[p]
Time = 0.60 (sec) , antiderivative size = 75, normalized size of antiderivative = 1.00
method | result | size |
default | \(-\frac {\left (a +b \right ) \left (-\frac {b \tan \left (x \right )}{2 a \left (\tan \left (x \right )^{2} a +b \tan \left (x \right )^{2}+a \right )}+\frac {\left (2 a -b \right ) \arctan \left (\frac {\left (a +b \right ) \tan \left (x \right )}{\sqrt {a \left (a +b \right )}}\right )}{2 a \sqrt {a \left (a +b \right )}}\right )}{b^{2}}+\frac {\arctan \left (\tan \left (x \right )\right )}{b^{2}}\) | \(75\) |
risch | \(\frac {x}{b^{2}}-\frac {i \left (2 \,{\mathrm e}^{2 i x} a^{2}+3 b \,{\mathrm e}^{2 i x} a +{\mathrm e}^{2 i x} b^{2}-a b -b^{2}\right )}{b^{2} a \left (-{\mathrm e}^{4 i x} b +4 \,{\mathrm e}^{2 i x} a +2 \,{\mathrm e}^{2 i x} b -b \right )}+\frac {\sqrt {-a \left (a +b \right )}\, \ln \left ({\mathrm e}^{2 i x}-\frac {2 i \sqrt {-a \left (a +b \right )}+2 a +b}{b}\right )}{2 a \,b^{2}}-\frac {\sqrt {-a \left (a +b \right )}\, \ln \left ({\mathrm e}^{2 i x}-\frac {2 i \sqrt {-a \left (a +b \right )}+2 a +b}{b}\right )}{4 a^{2} b}-\frac {\sqrt {-a \left (a +b \right )}\, \ln \left ({\mathrm e}^{2 i x}+\frac {2 i \sqrt {-a \left (a +b \right )}-2 a -b}{b}\right )}{2 a \,b^{2}}+\frac {\sqrt {-a \left (a +b \right )}\, \ln \left ({\mathrm e}^{2 i x}+\frac {2 i \sqrt {-a \left (a +b \right )}-2 a -b}{b}\right )}{4 a^{2} b}\) | \(262\) |
Input:
int(cos(x)^4/(a+b*sin(x)^2)^2,x,method=_RETURNVERBOSE)
Output:
-(a+b)/b^2*(-1/2*b/a*tan(x)/(tan(x)^2*a+b*tan(x)^2+a)+1/2*(2*a-b)/a/(a*(a+ b))^(1/2)*arctan((a+b)*tan(x)/(a*(a+b))^(1/2)))+1/b^2*arctan(tan(x))
Leaf count of result is larger than twice the leaf count of optimal. 141 vs. \(2 (63) = 126\).
Time = 0.11 (sec) , antiderivative size = 367, normalized size of antiderivative = 4.89 \[ \int \frac {\cos ^4(x)}{\left (a+b \sin ^2(x)\right )^2} \, dx=\left [\frac {8 \, a b x \cos \left (x\right )^{2} - 4 \, {\left (a b + b^{2}\right )} \cos \left (x\right ) \sin \left (x\right ) - {\left ({\left (2 \, a b - b^{2}\right )} \cos \left (x\right )^{2} - 2 \, a^{2} - a b + b^{2}\right )} \sqrt {-\frac {a + b}{a}} \log \left (\frac {{\left (8 \, a^{2} + 8 \, a b + b^{2}\right )} \cos \left (x\right )^{4} - 2 \, {\left (4 \, a^{2} + 5 \, a b + b^{2}\right )} \cos \left (x\right )^{2} - 4 \, {\left ({\left (2 \, a^{2} + a b\right )} \cos \left (x\right )^{3} - {\left (a^{2} + a b\right )} \cos \left (x\right )\right )} \sqrt {-\frac {a + b}{a}} \sin \left (x\right ) + a^{2} + 2 \, a b + b^{2}}{b^{2} \cos \left (x\right )^{4} - 2 \, {\left (a b + b^{2}\right )} \cos \left (x\right )^{2} + a^{2} + 2 \, a b + b^{2}}\right ) - 8 \, {\left (a^{2} + a b\right )} x}{8 \, {\left (a b^{3} \cos \left (x\right )^{2} - a^{2} b^{2} - a b^{3}\right )}}, \frac {4 \, a b x \cos \left (x\right )^{2} - 2 \, {\left (a b + b^{2}\right )} \cos \left (x\right ) \sin \left (x\right ) + {\left ({\left (2 \, a b - b^{2}\right )} \cos \left (x\right )^{2} - 2 \, a^{2} - a b + b^{2}\right )} \sqrt {\frac {a + b}{a}} \arctan \left (\frac {{\left ({\left (2 \, a + b\right )} \cos \left (x\right )^{2} - a - b\right )} \sqrt {\frac {a + b}{a}}}{2 \, {\left (a + b\right )} \cos \left (x\right ) \sin \left (x\right )}\right ) - 4 \, {\left (a^{2} + a b\right )} x}{4 \, {\left (a b^{3} \cos \left (x\right )^{2} - a^{2} b^{2} - a b^{3}\right )}}\right ] \] Input:
integrate(cos(x)^4/(a+b*sin(x)^2)^2,x, algorithm="fricas")
Output:
[1/8*(8*a*b*x*cos(x)^2 - 4*(a*b + b^2)*cos(x)*sin(x) - ((2*a*b - b^2)*cos( x)^2 - 2*a^2 - a*b + b^2)*sqrt(-(a + b)/a)*log(((8*a^2 + 8*a*b + b^2)*cos( x)^4 - 2*(4*a^2 + 5*a*b + b^2)*cos(x)^2 - 4*((2*a^2 + a*b)*cos(x)^3 - (a^2 + a*b)*cos(x))*sqrt(-(a + b)/a)*sin(x) + a^2 + 2*a*b + b^2)/(b^2*cos(x)^4 - 2*(a*b + b^2)*cos(x)^2 + a^2 + 2*a*b + b^2)) - 8*(a^2 + a*b)*x)/(a*b^3* cos(x)^2 - a^2*b^2 - a*b^3), 1/4*(4*a*b*x*cos(x)^2 - 2*(a*b + b^2)*cos(x)* sin(x) + ((2*a*b - b^2)*cos(x)^2 - 2*a^2 - a*b + b^2)*sqrt((a + b)/a)*arct an(1/2*((2*a + b)*cos(x)^2 - a - b)*sqrt((a + b)/a)/((a + b)*cos(x)*sin(x) )) - 4*(a^2 + a*b)*x)/(a*b^3*cos(x)^2 - a^2*b^2 - a*b^3)]
Timed out. \[ \int \frac {\cos ^4(x)}{\left (a+b \sin ^2(x)\right )^2} \, dx=\text {Timed out} \] Input:
integrate(cos(x)**4/(a+b*sin(x)**2)**2,x)
Output:
Timed out
Time = 0.11 (sec) , antiderivative size = 80, normalized size of antiderivative = 1.07 \[ \int \frac {\cos ^4(x)}{\left (a+b \sin ^2(x)\right )^2} \, dx=\frac {{\left (a + b\right )} \tan \left (x\right )}{2 \, {\left (a^{2} b + {\left (a^{2} b + a b^{2}\right )} \tan \left (x\right )^{2}\right )}} + \frac {x}{b^{2}} - \frac {{\left (2 \, a^{2} + a b - b^{2}\right )} \arctan \left (\frac {{\left (a + b\right )} \tan \left (x\right )}{\sqrt {{\left (a + b\right )} a}}\right )}{2 \, \sqrt {{\left (a + b\right )} a} a b^{2}} \] Input:
integrate(cos(x)^4/(a+b*sin(x)^2)^2,x, algorithm="maxima")
Output:
1/2*(a + b)*tan(x)/(a^2*b + (a^2*b + a*b^2)*tan(x)^2) + x/b^2 - 1/2*(2*a^2 + a*b - b^2)*arctan((a + b)*tan(x)/sqrt((a + b)*a))/(sqrt((a + b)*a)*a*b^ 2)
Time = 0.39 (sec) , antiderivative size = 109, normalized size of antiderivative = 1.45 \[ \int \frac {\cos ^4(x)}{\left (a+b \sin ^2(x)\right )^2} \, dx=\frac {x}{b^{2}} - \frac {{\left (\pi \left \lfloor \frac {x}{\pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (2 \, a + 2 \, b\right ) + \arctan \left (\frac {a \tan \left (x\right ) + b \tan \left (x\right )}{\sqrt {a^{2} + a b}}\right )\right )} {\left (2 \, a^{2} + a b - b^{2}\right )}}{2 \, \sqrt {a^{2} + a b} a b^{2}} + \frac {a \tan \left (x\right ) + b \tan \left (x\right )}{2 \, {\left (a \tan \left (x\right )^{2} + b \tan \left (x\right )^{2} + a\right )} a b} \] Input:
integrate(cos(x)^4/(a+b*sin(x)^2)^2,x, algorithm="giac")
Output:
x/b^2 - 1/2*(pi*floor(x/pi + 1/2)*sgn(2*a + 2*b) + arctan((a*tan(x) + b*ta n(x))/sqrt(a^2 + a*b)))*(2*a^2 + a*b - b^2)/(sqrt(a^2 + a*b)*a*b^2) + 1/2* (a*tan(x) + b*tan(x))/((a*tan(x)^2 + b*tan(x)^2 + a)*a*b)
Time = 34.73 (sec) , antiderivative size = 533, normalized size of antiderivative = 7.11 \[ \int \frac {\cos ^4(x)}{\left (a+b \sin ^2(x)\right )^2} \, dx=\frac {\mathrm {atan}\left (\frac {5\,\mathrm {tan}\left (x\right )}{2\,\left (\frac {3\,a}{2\,b}+\frac {b}{2\,a}-\frac {b^2}{2\,a^2}+\frac {5}{2}\right )}+\frac {\mathrm {tan}\left (x\right )}{2\,\left (\frac {5\,a}{2\,b}-\frac {b}{2\,a}+\frac {3\,a^2}{2\,b^2}+\frac {1}{2}\right )}+\frac {3\,a\,\mathrm {tan}\left (x\right )}{2\,\left (\frac {3\,a}{2}+\frac {5\,b}{2}+\frac {b^2}{2\,a}-\frac {b^3}{2\,a^2}\right )}-\frac {b\,\mathrm {tan}\left (x\right )}{2\,\left (\frac {a}{2}-\frac {b}{2}+\frac {5\,a^2}{2\,b}+\frac {3\,a^3}{2\,b^2}\right )}\right )}{b^2}+\frac {\mathrm {atanh}\left (\frac {\mathrm {tan}\left (x\right )\,\sqrt {-a^4-b\,a^3}}{a^2-\frac {3\,a\,b}{2}-\frac {b^2}{2}+\frac {b^3}{4\,a}+\frac {13\,a^3}{4\,b}+\frac {3\,a^4}{2\,b^2}}+\frac {3\,\mathrm {tan}\left (x\right )\,\sqrt {-a^4-b\,a^3}}{2\,\left (\frac {13\,a\,b}{4}+\frac {3\,a^2}{2}+b^2-\frac {3\,b^3}{2\,a}-\frac {b^4}{2\,a^2}+\frac {b^5}{4\,a^3}\right )}+\frac {13\,\mathrm {tan}\left (x\right )\,\sqrt {-a^4-b\,a^3}}{4\,\left (a\,b+\frac {13\,a^2}{4}-\frac {3\,b^2}{2}-\frac {b^3}{2\,a}+\frac {3\,a^3}{2\,b}+\frac {b^4}{4\,a^2}\right )}-\frac {3\,b\,\mathrm {tan}\left (x\right )\,\sqrt {-a^4-b\,a^3}}{2\,\left (a^3-\frac {3\,a^2\,b}{2}-\frac {a\,b^2}{2}+\frac {b^3}{4}+\frac {13\,a^4}{4\,b}+\frac {3\,a^5}{2\,b^2}\right )}-\frac {b^2\,\mathrm {tan}\left (x\right )\,\sqrt {-a^4-b\,a^3}}{2\,\left (\frac {a\,b^3}{4}-\frac {3\,a^3\,b}{2}+a^4-\frac {a^2\,b^2}{2}+\frac {13\,a^5}{4\,b}+\frac {3\,a^6}{2\,b^2}\right )}+\frac {b^3\,\mathrm {tan}\left (x\right )\,\sqrt {-a^4-b\,a^3}}{4\,\left (a^5-\frac {3\,a^4\,b}{2}+\frac {a^2\,b^3}{4}-\frac {a^3\,b^2}{2}+\frac {13\,a^6}{4\,b}+\frac {3\,a^7}{2\,b^2}\right )}\right )\,\sqrt {-a^3\,\left (a+b\right )}\,\left (2\,a-b\right )}{2\,a^3\,b^2}+\frac {\mathrm {tan}\left (x\right )\,\left (a+b\right )}{2\,a\,b\,\left (\left (a+b\right )\,{\mathrm {tan}\left (x\right )}^2+a\right )} \] Input:
int(cos(x)^4/(a + b*sin(x)^2)^2,x)
Output:
atan((5*tan(x))/(2*((3*a)/(2*b) + b/(2*a) - b^2/(2*a^2) + 5/2)) + tan(x)/( 2*((5*a)/(2*b) - b/(2*a) + (3*a^2)/(2*b^2) + 1/2)) + (3*a*tan(x))/(2*((3*a )/2 + (5*b)/2 + b^2/(2*a) - b^3/(2*a^2))) - (b*tan(x))/(2*(a/2 - b/2 + (5* a^2)/(2*b) + (3*a^3)/(2*b^2))))/b^2 + (atanh((tan(x)*(- a^3*b - a^4)^(1/2) )/(a^2 - (3*a*b)/2 - b^2/2 + b^3/(4*a) + (13*a^3)/(4*b) + (3*a^4)/(2*b^2)) + (3*tan(x)*(- a^3*b - a^4)^(1/2))/(2*((13*a*b)/4 + (3*a^2)/2 + b^2 - (3* b^3)/(2*a) - b^4/(2*a^2) + b^5/(4*a^3))) + (13*tan(x)*(- a^3*b - a^4)^(1/2 ))/(4*(a*b + (13*a^2)/4 - (3*b^2)/2 - b^3/(2*a) + (3*a^3)/(2*b) + b^4/(4*a ^2))) - (3*b*tan(x)*(- a^3*b - a^4)^(1/2))/(2*(a^3 - (3*a^2*b)/2 - (a*b^2) /2 + b^3/4 + (13*a^4)/(4*b) + (3*a^5)/(2*b^2))) - (b^2*tan(x)*(- a^3*b - a ^4)^(1/2))/(2*((a*b^3)/4 - (3*a^3*b)/2 + a^4 - (a^2*b^2)/2 + (13*a^5)/(4*b ) + (3*a^6)/(2*b^2))) + (b^3*tan(x)*(- a^3*b - a^4)^(1/2))/(4*(a^5 - (3*a^ 4*b)/2 + (a^2*b^3)/4 - (a^3*b^2)/2 + (13*a^6)/(4*b) + (3*a^7)/(2*b^2))))*( -a^3*(a + b))^(1/2)*(2*a - b))/(2*a^3*b^2) + (tan(x)*(a + b))/(2*a*b*(a + tan(x)^2*(a + b)))
Time = 0.26 (sec) , antiderivative size = 1650, normalized size of antiderivative = 22.00 \[ \int \frac {\cos ^4(x)}{\left (a+b \sin ^2(x)\right )^2} \, dx =\text {Too large to display} \] Input:
int(cos(x)^4/(a+b*sin(x)^2)^2,x)
Output:
(4*sqrt(b)*sqrt(a)*sqrt(a + b)*sqrt(2*sqrt(b)*sqrt(a + b) + a + 2*b)*atan( (tan(x/2)*a)/(sqrt(a)*sqrt(2*sqrt(b)*sqrt(a + b) + a + 2*b)))*sin(x)**2*a* b - 2*sqrt(b)*sqrt(a)*sqrt(a + b)*sqrt(2*sqrt(b)*sqrt(a + b) + a + 2*b)*at an((tan(x/2)*a)/(sqrt(a)*sqrt(2*sqrt(b)*sqrt(a + b) + a + 2*b)))*sin(x)**2 *b**2 + 4*sqrt(b)*sqrt(a)*sqrt(a + b)*sqrt(2*sqrt(b)*sqrt(a + b) + a + 2*b )*atan((tan(x/2)*a)/(sqrt(a)*sqrt(2*sqrt(b)*sqrt(a + b) + a + 2*b)))*a**2 - 2*sqrt(b)*sqrt(a)*sqrt(a + b)*sqrt(2*sqrt(b)*sqrt(a + b) + a + 2*b)*atan ((tan(x/2)*a)/(sqrt(a)*sqrt(2*sqrt(b)*sqrt(a + b) + a + 2*b)))*a*b - 4*sqr t(a)*sqrt(2*sqrt(b)*sqrt(a + b) + a + 2*b)*atan((tan(x/2)*a)/(sqrt(a)*sqrt (2*sqrt(b)*sqrt(a + b) + a + 2*b)))*sin(x)**2*a**2*b - 2*sqrt(a)*sqrt(2*sq rt(b)*sqrt(a + b) + a + 2*b)*atan((tan(x/2)*a)/(sqrt(a)*sqrt(2*sqrt(b)*sqr t(a + b) + a + 2*b)))*sin(x)**2*a*b**2 + 2*sqrt(a)*sqrt(2*sqrt(b)*sqrt(a + b) + a + 2*b)*atan((tan(x/2)*a)/(sqrt(a)*sqrt(2*sqrt(b)*sqrt(a + b) + a + 2*b)))*sin(x)**2*b**3 - 4*sqrt(a)*sqrt(2*sqrt(b)*sqrt(a + b) + a + 2*b)*a tan((tan(x/2)*a)/(sqrt(a)*sqrt(2*sqrt(b)*sqrt(a + b) + a + 2*b)))*a**3 - 2 *sqrt(a)*sqrt(2*sqrt(b)*sqrt(a + b) + a + 2*b)*atan((tan(x/2)*a)/(sqrt(a)* sqrt(2*sqrt(b)*sqrt(a + b) + a + 2*b)))*a**2*b + 2*sqrt(a)*sqrt(2*sqrt(b)* sqrt(a + b) + a + 2*b)*atan((tan(x/2)*a)/(sqrt(a)*sqrt(2*sqrt(b)*sqrt(a + b) + a + 2*b)))*a*b**2 + 2*cos(x)*sin(x)*a**3*b + 2*cos(x)*sin(x)*a**2*b** 2 + 2*sqrt(b)*sqrt(a)*sqrt(a + b)*sqrt(2*sqrt(b)*sqrt(a + b) - a - 2*b)...