Integrand size = 15, antiderivative size = 98 \[ \int x \cos ^2\left (a+b \log \left (c x^n\right )\right ) \, dx=\frac {b^2 n^2 x^2}{4 \left (1+b^2 n^2\right )}+\frac {x^2 \cos ^2\left (a+b \log \left (c x^n\right )\right )}{2 \left (1+b^2 n^2\right )}+\frac {b n x^2 \cos \left (a+b \log \left (c x^n\right )\right ) \sin \left (a+b \log \left (c x^n\right )\right )}{2 \left (1+b^2 n^2\right )} \] Output:
b^2*n^2*x^2/(4*b^2*n^2+4)+x^2*cos(a+b*ln(c*x^n))^2/(2*b^2*n^2+2)+b*n*x^2*c os(a+b*ln(c*x^n))*sin(a+b*ln(c*x^n))/(2*b^2*n^2+2)
Time = 0.07 (sec) , antiderivative size = 54, normalized size of antiderivative = 0.55 \[ \int x \cos ^2\left (a+b \log \left (c x^n\right )\right ) \, dx=\frac {x^2 \left (1+b^2 n^2+\cos \left (2 \left (a+b \log \left (c x^n\right )\right )\right )+b n \sin \left (2 \left (a+b \log \left (c x^n\right )\right )\right )\right )}{4+4 b^2 n^2} \] Input:
Integrate[x*Cos[a + b*Log[c*x^n]]^2,x]
Output:
(x^2*(1 + b^2*n^2 + Cos[2*(a + b*Log[c*x^n])] + b*n*Sin[2*(a + b*Log[c*x^n ])]))/(4 + 4*b^2*n^2)
Time = 0.22 (sec) , antiderivative size = 98, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.133, Rules used = {4991, 15}
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 x \cos ^2\left (a+b \log \left (c x^n\right )\right ) \, dx\) |
\(\Big \downarrow \) 4991 |
\(\displaystyle \frac {b^2 n^2 \int xdx}{2 \left (b^2 n^2+1\right )}+\frac {x^2 \cos ^2\left (a+b \log \left (c x^n\right )\right )}{2 \left (b^2 n^2+1\right )}+\frac {b n x^2 \sin \left (a+b \log \left (c x^n\right )\right ) \cos \left (a+b \log \left (c x^n\right )\right )}{2 \left (b^2 n^2+1\right )}\) |
\(\Big \downarrow \) 15 |
\(\displaystyle \frac {x^2 \cos ^2\left (a+b \log \left (c x^n\right )\right )}{2 \left (b^2 n^2+1\right )}+\frac {b n x^2 \sin \left (a+b \log \left (c x^n\right )\right ) \cos \left (a+b \log \left (c x^n\right )\right )}{2 \left (b^2 n^2+1\right )}+\frac {b^2 n^2 x^2}{4 \left (b^2 n^2+1\right )}\) |
Input:
Int[x*Cos[a + b*Log[c*x^n]]^2,x]
Output:
(b^2*n^2*x^2)/(4*(1 + b^2*n^2)) + (x^2*Cos[a + b*Log[c*x^n]]^2)/(2*(1 + b^ 2*n^2)) + (b*n*x^2*Cos[a + b*Log[c*x^n]]*Sin[a + b*Log[c*x^n]])/(2*(1 + b^ 2*n^2))
Int[(a_.)*(x_)^(m_.), x_Symbol] :> Simp[a*(x^(m + 1)/(m + 1)), x] /; FreeQ[ {a, m}, x] && NeQ[m, -1]
Int[Cos[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*(d_.)]^(p_)*((e_.)*(x_))^(m_. ), x_Symbol] :> Simp[(m + 1)*(e*x)^(m + 1)*(Cos[d*(a + b*Log[c*x^n])]^p/(b^ 2*d^2*e*n^2*p^2 + e*(m + 1)^2)), x] + (Simp[b*d*n*p*(e*x)^(m + 1)*Sin[d*(a + b*Log[c*x^n])]*(Cos[d*(a + b*Log[c*x^n])]^(p - 1)/(b^2*d^2*e*n^2*p^2 + e* (m + 1)^2)), x] + Simp[b^2*d^2*n^2*p*((p - 1)/(b^2*d^2*n^2*p^2 + (m + 1)^2) ) Int[(e*x)^m*Cos[d*(a + b*Log[c*x^n])]^(p - 2), x], x]) /; FreeQ[{a, b, c, d, e, m, n}, x] && IGtQ[p, 1] && NeQ[b^2*d^2*n^2*p^2 + (m + 1)^2, 0]
Time = 0.69 (sec) , antiderivative size = 57, normalized size of antiderivative = 0.58
method | result | size |
parallelrisch | \(\frac {x^{2} \left (b^{2} n^{2}+b n \sin \left (2 b \ln \left (c \,x^{n}\right )+2 a \right )+\cos \left (2 b \ln \left (c \,x^{n}\right )+2 a \right )+1\right )}{4 b^{2} n^{2}+4}\) | \(57\) |
Input:
int(x*cos(a+b*ln(c*x^n))^2,x,method=_RETURNVERBOSE)
Output:
x^2*(b^2*n^2+b*n*sin(2*b*ln(c*x^n)+2*a)+cos(2*b*ln(c*x^n)+2*a)+1)/(4*b^2*n ^2+4)
Time = 0.08 (sec) , antiderivative size = 74, normalized size of antiderivative = 0.76 \[ \int x \cos ^2\left (a+b \log \left (c x^n\right )\right ) \, dx=\frac {b^{2} n^{2} x^{2} + 2 \, b n x^{2} \cos \left (b n \log \left (x\right ) + b \log \left (c\right ) + a\right ) \sin \left (b n \log \left (x\right ) + b \log \left (c\right ) + a\right ) + 2 \, x^{2} \cos \left (b n \log \left (x\right ) + b \log \left (c\right ) + a\right )^{2}}{4 \, {\left (b^{2} n^{2} + 1\right )}} \] Input:
integrate(x*cos(a+b*log(c*x^n))^2,x, algorithm="fricas")
Output:
1/4*(b^2*n^2*x^2 + 2*b*n*x^2*cos(b*n*log(x) + b*log(c) + a)*sin(b*n*log(x) + b*log(c) + a) + 2*x^2*cos(b*n*log(x) + b*log(c) + a)^2)/(b^2*n^2 + 1)
\[ \int x \cos ^2\left (a+b \log \left (c x^n\right )\right ) \, dx=\begin {cases} \int x \cos ^{2}{\left (a - \frac {i \log {\left (c x^{n} \right )}}{n} \right )}\, dx & \text {for}\: b = - \frac {i}{n} \\\int x \cos ^{2}{\left (a + \frac {i \log {\left (c x^{n} \right )}}{n} \right )}\, dx & \text {for}\: b = \frac {i}{n} \\\frac {b^{2} n^{2} x^{2} \sin ^{2}{\left (a + b \log {\left (c x^{n} \right )} \right )}}{4 b^{2} n^{2} + 4} + \frac {b^{2} n^{2} x^{2} \cos ^{2}{\left (a + b \log {\left (c x^{n} \right )} \right )}}{4 b^{2} n^{2} + 4} + \frac {2 b n x^{2} \sin {\left (a + b \log {\left (c x^{n} \right )} \right )} \cos {\left (a + b \log {\left (c x^{n} \right )} \right )}}{4 b^{2} n^{2} + 4} + \frac {2 x^{2} \cos ^{2}{\left (a + b \log {\left (c x^{n} \right )} \right )}}{4 b^{2} n^{2} + 4} & \text {otherwise} \end {cases} \] Input:
integrate(x*cos(a+b*ln(c*x**n))**2,x)
Output:
Piecewise((Integral(x*cos(a - I*log(c*x**n)/n)**2, x), Eq(b, -I/n)), (Inte gral(x*cos(a + I*log(c*x**n)/n)**2, x), Eq(b, I/n)), (b**2*n**2*x**2*sin(a + b*log(c*x**n))**2/(4*b**2*n**2 + 4) + b**2*n**2*x**2*cos(a + b*log(c*x* *n))**2/(4*b**2*n**2 + 4) + 2*b*n*x**2*sin(a + b*log(c*x**n))*cos(a + b*lo g(c*x**n))/(4*b**2*n**2 + 4) + 2*x**2*cos(a + b*log(c*x**n))**2/(4*b**2*n* *2 + 4), True))
Leaf count of result is larger than twice the leaf count of optimal. 282 vs. \(2 (92) = 184\).
Time = 0.06 (sec) , antiderivative size = 282, normalized size of antiderivative = 2.88 \[ \int x \cos ^2\left (a+b \log \left (c x^n\right )\right ) \, dx=\frac {{\left ({\left (b \cos \left (2 \, b \log \left (c\right )\right ) \sin \left (4 \, b \log \left (c\right )\right ) - b \cos \left (4 \, b \log \left (c\right )\right ) \sin \left (2 \, b \log \left (c\right )\right ) + b \sin \left (2 \, b \log \left (c\right )\right )\right )} n + \cos \left (4 \, b \log \left (c\right )\right ) \cos \left (2 \, b \log \left (c\right )\right ) + \sin \left (4 \, b \log \left (c\right )\right ) \sin \left (2 \, b \log \left (c\right )\right ) + \cos \left (2 \, b \log \left (c\right )\right )\right )} x^{2} \cos \left (2 \, b \log \left (x^{n}\right ) + 2 \, a\right ) + {\left ({\left (b \cos \left (4 \, b \log \left (c\right )\right ) \cos \left (2 \, b \log \left (c\right )\right ) + b \sin \left (4 \, b \log \left (c\right )\right ) \sin \left (2 \, b \log \left (c\right )\right ) + b \cos \left (2 \, b \log \left (c\right )\right )\right )} n - \cos \left (2 \, b \log \left (c\right )\right ) \sin \left (4 \, b \log \left (c\right )\right ) + \cos \left (4 \, b \log \left (c\right )\right ) \sin \left (2 \, b \log \left (c\right )\right ) - \sin \left (2 \, b \log \left (c\right )\right )\right )} x^{2} \sin \left (2 \, b \log \left (x^{n}\right ) + 2 \, a\right ) + 2 \, {\left ({\left (b^{2} \cos \left (2 \, b \log \left (c\right )\right )^{2} + b^{2} \sin \left (2 \, b \log \left (c\right )\right )^{2}\right )} n^{2} + \cos \left (2 \, b \log \left (c\right )\right )^{2} + \sin \left (2 \, b \log \left (c\right )\right )^{2}\right )} x^{2}}{8 \, {\left ({\left (b^{2} \cos \left (2 \, b \log \left (c\right )\right )^{2} + b^{2} \sin \left (2 \, b \log \left (c\right )\right )^{2}\right )} n^{2} + \cos \left (2 \, b \log \left (c\right )\right )^{2} + \sin \left (2 \, b \log \left (c\right )\right )^{2}\right )}} \] Input:
integrate(x*cos(a+b*log(c*x^n))^2,x, algorithm="maxima")
Output:
1/8*(((b*cos(2*b*log(c))*sin(4*b*log(c)) - b*cos(4*b*log(c))*sin(2*b*log(c )) + b*sin(2*b*log(c)))*n + cos(4*b*log(c))*cos(2*b*log(c)) + sin(4*b*log( c))*sin(2*b*log(c)) + cos(2*b*log(c)))*x^2*cos(2*b*log(x^n) + 2*a) + ((b*c os(4*b*log(c))*cos(2*b*log(c)) + b*sin(4*b*log(c))*sin(2*b*log(c)) + b*cos (2*b*log(c)))*n - cos(2*b*log(c))*sin(4*b*log(c)) + cos(4*b*log(c))*sin(2* b*log(c)) - sin(2*b*log(c)))*x^2*sin(2*b*log(x^n) + 2*a) + 2*((b^2*cos(2*b *log(c))^2 + b^2*sin(2*b*log(c))^2)*n^2 + cos(2*b*log(c))^2 + sin(2*b*log( c))^2)*x^2)/((b^2*cos(2*b*log(c))^2 + b^2*sin(2*b*log(c))^2)*n^2 + cos(2*b *log(c))^2 + sin(2*b*log(c))^2)
Leaf count of result is larger than twice the leaf count of optimal. 817 vs. \(2 (92) = 184\).
Time = 0.32 (sec) , antiderivative size = 817, normalized size of antiderivative = 8.34 \[ \int x \cos ^2\left (a+b \log \left (c x^n\right )\right ) \, dx=\text {Too large to display} \] Input:
integrate(x*cos(a+b*log(c*x^n))^2,x, algorithm="giac")
Output:
1/4*x^2 - 1/8*(2*b*n*x^2*e^(2*pi*b*n*sgn(x) - 2*pi*b*n + 2*pi*b*sgn(c) - 2 *pi*b)*tan(b*n*log(abs(x)) + b*log(abs(c)))^2*tan(a) + 2*b*n*x^2*e^(2*pi*b *n*sgn(x) - 2*pi*b*n + 2*pi*b*sgn(c) - 2*pi*b)*tan(b*n*log(abs(x)) + b*log (abs(c)))*tan(a)^2 + 2*b*n*x^2*tan(b*n*log(abs(x)) + b*log(abs(c)))^2*tan( a) + 2*b*n*x^2*tan(b*n*log(abs(x)) + b*log(abs(c)))*tan(a)^2 - x^2*e^(2*pi *b*n*sgn(x) - 2*pi*b*n + 2*pi*b*sgn(c) - 2*pi*b)*tan(b*n*log(abs(x)) + b*l og(abs(c)))^2*tan(a)^2 - 2*b*n*x^2*e^(2*pi*b*n*sgn(x) - 2*pi*b*n + 2*pi*b* sgn(c) - 2*pi*b)*tan(b*n*log(abs(x)) + b*log(abs(c))) - 2*b*n*x^2*e^(2*pi* b*n*sgn(x) - 2*pi*b*n + 2*pi*b*sgn(c) - 2*pi*b)*tan(a) - x^2*tan(b*n*log(a bs(x)) + b*log(abs(c)))^2*tan(a)^2 - 2*b*n*x^2*tan(b*n*log(abs(x)) + b*log (abs(c))) + x^2*e^(2*pi*b*n*sgn(x) - 2*pi*b*n + 2*pi*b*sgn(c) - 2*pi*b)*ta n(b*n*log(abs(x)) + b*log(abs(c)))^2 - 2*b*n*x^2*tan(a) + 4*x^2*e^(2*pi*b* n*sgn(x) - 2*pi*b*n + 2*pi*b*sgn(c) - 2*pi*b)*tan(b*n*log(abs(x)) + b*log( abs(c)))*tan(a) + x^2*e^(2*pi*b*n*sgn(x) - 2*pi*b*n + 2*pi*b*sgn(c) - 2*pi *b)*tan(a)^2 + x^2*tan(b*n*log(abs(x)) + b*log(abs(c)))^2 + 4*x^2*tan(b*n* log(abs(x)) + b*log(abs(c)))*tan(a) + x^2*tan(a)^2 - x^2*e^(2*pi*b*n*sgn(x ) - 2*pi*b*n + 2*pi*b*sgn(c) - 2*pi*b) - x^2)/(b^2*n^2*e^(pi*b*n*sgn(x) - pi*b*n + pi*b*sgn(c) - pi*b)*tan(b*n*log(abs(x)) + b*log(abs(c)))^2*tan(a) ^2 + b^2*n^2*e^(pi*b*n*sgn(x) - pi*b*n + pi*b*sgn(c) - pi*b)*tan(b*n*log(a bs(x)) + b*log(abs(c)))^2 + b^2*n^2*e^(pi*b*n*sgn(x) - pi*b*n + pi*b*sg...
Time = 20.67 (sec) , antiderivative size = 66, normalized size of antiderivative = 0.67 \[ \int x \cos ^2\left (a+b \log \left (c x^n\right )\right ) \, dx=\frac {x^2}{4}+\frac {x^2\,{\mathrm {e}}^{-a\,2{}\mathrm {i}}\,\frac {1}{{\left (c\,x^n\right )}^{b\,2{}\mathrm {i}}}\,1{}\mathrm {i}}{8\,b\,n+8{}\mathrm {i}}+\frac {x^2\,{\mathrm {e}}^{a\,2{}\mathrm {i}}\,{\left (c\,x^n\right )}^{b\,2{}\mathrm {i}}}{8+b\,n\,8{}\mathrm {i}} \] Input:
int(x*cos(a + b*log(c*x^n))^2,x)
Output:
x^2/4 + (x^2*exp(-a*2i)/(c*x^n)^(b*2i)*1i)/(8*b*n + 8i) + (x^2*exp(a*2i)*( c*x^n)^(b*2i))/(b*n*8i + 8)
Time = 0.19 (sec) , antiderivative size = 66, normalized size of antiderivative = 0.67 \[ \int x \cos ^2\left (a+b \log \left (c x^n\right )\right ) \, dx=\frac {x^{2} \left (2 \cos \left (\mathrm {log}\left (x^{n} c \right ) b +a \right ) \sin \left (\mathrm {log}\left (x^{n} c \right ) b +a \right ) b n -2 {\sin \left (\mathrm {log}\left (x^{n} c \right ) b +a \right )}^{2}+b^{2} n^{2}+2\right )}{4 b^{2} n^{2}+4} \] Input:
int(x*cos(a+b*log(c*x^n))^2,x)
Output:
(x**2*(2*cos(log(x**n*c)*b + a)*sin(log(x**n*c)*b + a)*b*n - 2*sin(log(x** n*c)*b + a)**2 + b**2*n**2 + 2))/(4*(b**2*n**2 + 1))