### 3.56 $$\int x \cos (\pi x) \, dx$$

Optimal. Leaf size=18 $\frac{x \sin (\pi x)}{\pi }+\frac{\cos (\pi x)}{\pi ^2}$

[Out]

Cos[Pi*x]/Pi^2 + (x*Sin[Pi*x])/Pi

________________________________________________________________________________________

Rubi [A]  time = 0.0125108, antiderivative size = 18, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 2, integrand size = 6, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.333, Rules used = {3296, 2638} $\frac{x \sin (\pi x)}{\pi }+\frac{\cos (\pi x)}{\pi ^2}$

Antiderivative was successfully veriﬁed.

[In]

Int[x*Cos[Pi*x],x]

[Out]

Cos[Pi*x]/Pi^2 + (x*Sin[Pi*x])/Pi

Rule 3296

Int[((c_.) + (d_.)*(x_))^(m_.)*sin[(e_.) + (f_.)*(x_)], x_Symbol] :> -Simp[((c + d*x)^m*Cos[e + f*x])/f, x] +
Dist[(d*m)/f, Int[(c + d*x)^(m - 1)*Cos[e + f*x], x], x] /; FreeQ[{c, d, e, f}, x] && GtQ[m, 0]

Rule 2638

Int[sin[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Cos[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin{align*} \int x \cos (\pi x) \, dx &=\frac{x \sin (\pi x)}{\pi }-\frac{\int \sin (\pi x) \, dx}{\pi }\\ &=\frac{\cos (\pi x)}{\pi ^2}+\frac{x \sin (\pi x)}{\pi }\\ \end{align*}

Mathematica [A]  time = 0.0146212, size = 18, normalized size = 1. $\frac{x \sin (\pi x)}{\pi }+\frac{\cos (\pi x)}{\pi ^2}$

Antiderivative was successfully veriﬁed.

[In]

Integrate[x*Cos[Pi*x],x]

[Out]

Cos[Pi*x]/Pi^2 + (x*Sin[Pi*x])/Pi

________________________________________________________________________________________

Maple [A]  time = 0.005, size = 17, normalized size = 0.9 \begin{align*}{\frac{\cos \left ( \pi \,x \right ) +x\pi \,\sin \left ( \pi \,x \right ) }{{\pi }^{2}}} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

int(x*cos(Pi*x),x)

[Out]

1/Pi^2*(cos(Pi*x)+x*Pi*sin(Pi*x))

________________________________________________________________________________________

Maxima [A]  time = 0.935002, size = 22, normalized size = 1.22 \begin{align*} \frac{\pi x \sin \left (\pi x\right ) + \cos \left (\pi x\right )}{\pi ^{2}} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*cos(pi*x),x, algorithm="maxima")

[Out]

(pi*x*sin(pi*x) + cos(pi*x))/pi^2

________________________________________________________________________________________

Fricas [A]  time = 2.56099, size = 47, normalized size = 2.61 \begin{align*} \frac{\pi x \sin \left (\pi x\right ) + \cos \left (\pi x\right )}{\pi ^{2}} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*cos(pi*x),x, algorithm="fricas")

[Out]

(pi*x*sin(pi*x) + cos(pi*x))/pi^2

________________________________________________________________________________________

Sympy [A]  time = 0.216689, size = 15, normalized size = 0.83 \begin{align*} \frac{x \sin{\left (\pi x \right )}}{\pi } + \frac{\cos{\left (\pi x \right )}}{\pi ^{2}} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*cos(pi*x),x)

[Out]

x*sin(pi*x)/pi + cos(pi*x)/pi**2

________________________________________________________________________________________

Giac [A]  time = 1.05167, size = 24, normalized size = 1.33 \begin{align*} \frac{x \sin \left (\pi x\right )}{\pi } + \frac{\cos \left (\pi x\right )}{\pi ^{2}} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*cos(pi*x),x, algorithm="giac")

[Out]

x*sin(pi*x)/pi + cos(pi*x)/pi^2