3.4.9 \(\int \cos ^2(\frac {\pi x^2}{\sqrt {2}}) \, dx\) [309]

Optimal. Leaf size=23 \[ \frac {x}{2}+\frac {\operatorname {FresnelC}\left (2^{3/4} x\right )}{2\ 2^{3/4}} \]

[Out]

1/2*x+1/4*FresnelC(2^(3/4)*x)*2^(1/4)

________________________________________________________________________________________

Rubi [A]
time = 0.01, antiderivative size = 23, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.154, Rules used = {3439, 3433} \begin {gather*} \frac {\operatorname {FresnelC}\left (2^{3/4} x\right )}{2\ 2^{3/4}}+\frac {x}{2} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Cos[(Pi*x^2)/Sqrt[2]]^2,x]

[Out]

x/2 + FresnelC[2^(3/4)*x]/(2*2^(3/4))

Rule 3433

Int[Cos[(d_.)*((e_.) + (f_.)*(x_))^2], x_Symbol] :> Simp[(Sqrt[Pi/2]/(f*Rt[d, 2]))*FresnelC[Sqrt[2/Pi]*Rt[d, 2
]*(e + f*x)], x] /; FreeQ[{d, e, f}, x]

Rule 3439

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

Rubi steps

\begin {gather*} \begin {aligned} \text {Integral} &=\int \left (\frac {1}{2}+\frac {1}{2} \cos \left (\sqrt {2} \pi x^2\right )\right ) \, dx\\ &=\frac {x}{2}+\frac {1}{2} \int \cos \left (\sqrt {2} \pi x^2\right ) \, dx\\ &=\frac {x}{2}+\frac {\operatorname {FresnelC}\left (2^{3/4} x\right )}{2\ 2^{3/4}}\\ \end {aligned} \end {gather*}

________________________________________________________________________________________

Mathematica [A]
time = 0.02, size = 22, normalized size = 0.96 \begin {gather*} \frac {1}{4} \left (2 x+\sqrt [4]{2} \operatorname {FresnelC}\left (2^{3/4} x\right )\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Cos[(Pi*x^2)/Sqrt[2]]^2,x]

[Out]

(2*x + 2^(1/4)*FresnelC[2^(3/4)*x])/4

________________________________________________________________________________________

Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(33\) vs. \(2(15)=30\).
time = 0.12, size = 34, normalized size = 1.48

method result size
default \(\frac {x}{2}+\frac {\sqrt {2}\, \sqrt {\pi }\, \mathrm {C}\left (\frac {2 \sqrt {\pi }\, x}{\sqrt {\pi \sqrt {2}}}\right )}{4 \sqrt {\pi \sqrt {2}}}\) \(34\)
risch \(\frac {x}{2}+\frac {\sqrt {\pi }\, \erf \left (\sqrt {i \pi \sqrt {2}}\, x \right )}{8 \sqrt {i \pi \sqrt {2}}}+\frac {\sqrt {\pi }\, \erf \left (\sqrt {-i \pi \sqrt {2}}\, x \right )}{8 \sqrt {-i \pi \sqrt {2}}}\) \(57\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(1/2*Pi*x^2*2^(1/2))^2,x,method=_RETURNVERBOSE)

[Out]

1/2*x+1/4*2^(1/2)*Pi^(1/2)/(Pi*2^(1/2))^(1/2)*FresnelC(2*Pi^(1/2)/(Pi*2^(1/2))^(1/2)*x)

________________________________________________________________________________________

Maxima [C] Result contains complex when optimal does not.
time = 0.45, size = 46, normalized size = 2.00 \begin {gather*} -\frac {2^{\frac {1}{4}} \pi ^{2} {\left (\left (i - 1\right ) \, \operatorname {erf}\left (\sqrt {i \, \sqrt {2} \pi } x\right ) - \left (i + 1\right ) \, \operatorname {erf}\left (\sqrt {-i \, \sqrt {2} \pi } x\right )\right )} - 8 \, \pi ^{2} x}{16 \, \pi ^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/16*(2^(1/4)*pi^2*((I - 1)*erf(sqrt(I*sqrt(2)*pi)*x) - (I + 1)*erf(sqrt(-I*sqrt(2)*pi)*x)) - 8*pi^2*x)/pi^2

________________________________________________________________________________________

Fricas [A]
time = 0.61, size = 15, normalized size = 0.65 \begin {gather*} \frac {1}{4} \cdot 2^{\frac {1}{4}} \operatorname {C}\left (2^{\frac {3}{4}} x\right ) + \frac {1}{2} \, x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/4*2^(1/4)*fresnel_cos(2^(3/4)*x) + 1/2*x

________________________________________________________________________________________

Sympy [A]
time = 1.48, size = 27, normalized size = 1.17 \begin {gather*} \frac {x}{2} + \frac {\sqrt [4]{2} C\left (2^{\frac {3}{4}} x\right ) \Gamma \left (\frac {1}{4}\right )}{16 \Gamma \left (\frac {5}{4}\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

x/2 + 2**(1/4)*fresnelc(2**(3/4)*x)*gamma(1/4)/(16*gamma(5/4))

________________________________________________________________________________________

Giac [C] Result contains complex when optimal does not.
time = 0.47, size = 42, normalized size = 1.83 \begin {gather*} -\left (\frac {1}{16} i + \frac {1}{16}\right ) \cdot 2^{\frac {1}{4}} \operatorname {erf}\left (\left (\frac {1}{2} i - \frac {1}{2}\right ) \, \sqrt {2} \sqrt {\sqrt {2} \pi } x\right ) + \left (\frac {1}{16} i - \frac {1}{16}\right ) \cdot 2^{\frac {1}{4}} \operatorname {erf}\left (-\left (\frac {1}{2} i + \frac {1}{2}\right ) \, \sqrt {2} \sqrt {\sqrt {2} \pi } x\right ) + \frac {1}{2} \, x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-(1/16*I + 1/16)*2^(1/4)*erf((1/2*I - 1/2)*sqrt(2)*sqrt(sqrt(2)*pi)*x) + (1/16*I - 1/16)*2^(1/4)*erf(-(1/2*I +
 1/2)*sqrt(2)*sqrt(sqrt(2)*pi)*x) + 1/2*x

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.04 \begin {gather*} \int {\cos \left (\frac {\sqrt {2}\,\Pi \,x^2}{2}\right )}^2 \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Chatgpt [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {not solved} \end {gather*}

Warning: Unable to verify antiderivative.

[In]

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

[Out]

not solved

________________________________________________________________________________________