3.279 \(\int \cos (\sqrt{x}) \, dx\)

Optimal. Leaf size=22 \[ 2 \sqrt{x} \sin \left (\sqrt{x}\right )+2 \cos \left (\sqrt{x}\right ) \]

[Out]

2*Cos[Sqrt[x]] + 2*Sqrt[x]*Sin[Sqrt[x]]

________________________________________________________________________________________

Rubi [A]  time = 0.0114538, antiderivative size = 22, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 6, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.5, Rules used = {3362, 3296, 2638} \[ 2 \sqrt{x} \sin \left (\sqrt{x}\right )+2 \cos \left (\sqrt{x}\right ) \]

Antiderivative was successfully verified.

[In]

Int[Cos[Sqrt[x]],x]

[Out]

2*Cos[Sqrt[x]] + 2*Sqrt[x]*Sin[Sqrt[x]]

Rule 3362

Int[((a_.) + Cos[(c_.) + (d_.)*((e_.) + (f_.)*(x_))^(n_)]*(b_.))^(p_.), x_Symbol] :> Dist[1/(n*f), Subst[Int[x
^(1/n - 1)*(a + b*Cos[c + d*x])^p, x], x, (e + f*x)^n], x] /; FreeQ[{a, b, c, d, e, f}, x] && IGtQ[p, 0] && In
tegerQ[1/n]

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 \cos \left (\sqrt{x}\right ) \, dx &=2 \operatorname{Subst}\left (\int x \cos (x) \, dx,x,\sqrt{x}\right )\\ &=2 \sqrt{x} \sin \left (\sqrt{x}\right )-2 \operatorname{Subst}\left (\int \sin (x) \, dx,x,\sqrt{x}\right )\\ &=2 \cos \left (\sqrt{x}\right )+2 \sqrt{x} \sin \left (\sqrt{x}\right )\\ \end{align*}

Mathematica [A]  time = 0.0132581, size = 22, normalized size = 1. \[ 2 \sqrt{x} \sin \left (\sqrt{x}\right )+2 \cos \left (\sqrt{x}\right ) \]

Antiderivative was successfully verified.

[In]

Integrate[Cos[Sqrt[x]],x]

[Out]

2*Cos[Sqrt[x]] + 2*Sqrt[x]*Sin[Sqrt[x]]

________________________________________________________________________________________

Maple [A]  time = 0., size = 17, normalized size = 0.8 \begin{align*} 2\,\cos \left ( \sqrt{x} \right ) +2\,\sin \left ( \sqrt{x} \right ) \sqrt{x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(x^(1/2)),x)

[Out]

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

________________________________________________________________________________________

Maxima [A]  time = 0.940533, size = 22, normalized size = 1. \begin{align*} 2 \, \sqrt{x} \sin \left (\sqrt{x}\right ) + 2 \, \cos \left (\sqrt{x}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x^(1/2)),x, algorithm="maxima")

[Out]

2*sqrt(x)*sin(sqrt(x)) + 2*cos(sqrt(x))

________________________________________________________________________________________

Fricas [A]  time = 2.03848, size = 55, normalized size = 2.5 \begin{align*} 2 \, \sqrt{x} \sin \left (\sqrt{x}\right ) + 2 \, \cos \left (\sqrt{x}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x^(1/2)),x, algorithm="fricas")

[Out]

2*sqrt(x)*sin(sqrt(x)) + 2*cos(sqrt(x))

________________________________________________________________________________________

Sympy [A]  time = 0.294535, size = 20, normalized size = 0.91 \begin{align*} 2 \sqrt{x} \sin{\left (\sqrt{x} \right )} + 2 \cos{\left (\sqrt{x} \right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x**(1/2)),x)

[Out]

2*sqrt(x)*sin(sqrt(x)) + 2*cos(sqrt(x))

________________________________________________________________________________________

Giac [A]  time = 1.06754, size = 22, normalized size = 1. \begin{align*} 2 \, \sqrt{x} \sin \left (\sqrt{x}\right ) + 2 \, \cos \left (\sqrt{x}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x^(1/2)),x, algorithm="giac")

[Out]

2*sqrt(x)*sin(sqrt(x)) + 2*cos(sqrt(x))