# The value of $\sqrt{\frac{\pi }{2}} C(1)$

I'm going through question 5 here, where they ask to approximate the integral $$I=\int_0^a \cos(t^2) \mathrm{d}t$$ with $a=\sqrt{\pi/2}$. This integral can be expressed using Fresnel integrals as

Sqrt[\[Pi]/2] FresnelC[1]


and using N here gives the approximate value

0.977451


A similar value is obtained using Simpson's rule. However, the command

FindRoot[Evaluate[NIntegrate[Cos[t^2], {t, 0, x}] - 1.22505], {x, 1}]


results in the value

{x -> 1.25331}


which indeed looks like $\sqrt{\pi/2}$.

My question is then: which is the true value of $I$? Is it $I \approx 1.22505$ as they claim in the exercise (in which case I'd like to know why numerical integration suggests the other value), or is it $I \approx 0.977451$ as Mathematica first suggests (in which case I'd like to know why the FindRoot approach results in the other value)?

Thanks!

• Something that might help you reason things out would be to look at the plot of your integral: Plot[Sqrt[π/2] FresnelC[Sqrt[2/π] x], {x, 0, 2}] Mar 19, 2017 at 1:24
• @J.M. I see, so it's $I \approx 0.977451$ indeed. Thanks. Nevertheless, I'm still curious as to why FindRoot' and the exercise itself suggest the impossible value $1.22505$. Mar 19, 2017 at 1:28
• Your FindRoot command is searching for a value for x to make the integral as close to 1.22505 as possible. What point on your plot has a y-coordinate closest to 1.22505? The number in the exercise is probably a typo (copied the wrong numeric value). Mar 19, 2017 at 1:37
• re: "results in the value". No it does not. It produces an error message which generally means the number it yields is garbage. You really should include such error messages in the question. Mar 20, 2017 at 14:18

max = NIntegrate[Cos[x^2], {x, 0, Sqrt[Pi/2]}]
`