# How to get the explicit result of this limit?

Let $$f(x) = x^2+1$$. I would like to compute the limit $$\lim_{k \to +\infty} k \int_0^1 \sin \left [ \left ( k + \frac{1}{2} \right ) \pi x \right ] f(x) \, \mathrm d x.$$

Then I use the command

Limit[Integrate[k * Sin[( k + 1 / 2) * Pi * x] * (x^2 + 1), {x, 0, 1}], k -> Infinity]


Mathematica returns Indeterminate

Could you explain how to get the explicit limit? Thank you so much for your help!

• @Nasser I have corrected the code. It is strange to me because the limit seems to be $1 / \pi$. I have verified it by computing the integral for big values of $k$. Commented Dec 10, 2023 at 10:15
• You are right, it should be 1/pi !Mathematica graphics Commented Dec 10, 2023 at 10:24
• The limit does not exists because it oscillates around 1/pi with no decreasing amplitude of oscillations so Mathematica is right. Commented Dec 10, 2023 at 10:28
• @azerbajdzan I actually proved that the limit exists in this thread. I just want to confirm it with Mathematica. Commented Dec 10, 2023 at 10:29
• @Akira: So then your proof is wrong. Commented Dec 10, 2023 at 10:31

DiscreteLimit[k Integrate[Sin[(k + 1/2)*Pi*x]*(x^2 + 1), {x, 0, 1}],
k -> Infinity]


1/π

Also,

Series[Integrate[k Sin[(k + 1/2)*Pi*x]*(x^2 + 1), {x, 0, 1}], {k,
Infinity, 0}] // Normal


1/π + (2 Sin[k π])/π

Edit: From the documentation we read

DiscreteLimit is also known as discrete limit or limit over the integers.

which is my understanding of the basic difference between this and Limit

Edit 2: Thanks to @BobHanlon

The corresponding Series to the DiscreteLimit is given by

Series[Integrate[k Sin[(k + 1/2)*Pi*x]*(x^2 + 1), {x, 0, 1}], {k, Infinity, 0}, Assumptions -> k ∈ PositiveIntegers] // Normal


and evaluates to the expected result.

• Voila, this subtlety is important. Thank you so much for your help! Commented Dec 10, 2023 at 10:33
• This is not a good answer to this question because OP do not ask for limit over integers and your answer makes an impression that the limit over reals is same as over integers. But the limit over reals does not exist while over integers exists in this case. Commented Dec 10, 2023 at 10:36
• @azerbajdzan Some people should focus their efforts on READING carefully what is written in the reply. According to the timestamps I already had added my edit. Hence, it is very clear that DiscreteLimit is taken over the integers. It is, also, very clear that this differentiates DiscreteLimit from Limit. Thanks for your comment. It was not a good one.
– bmf
Commented Dec 10, 2023 at 10:42
• @Akira glad I was able to help :-)
– bmf
Commented Dec 10, 2023 at 10:44
• Since you are looking at the DiscreteLimit, the corresponding Series is Series[Integrate[k Sin[(k + 1/2)*Pi*x]*(x^2 + 1), {x, 0, 1}], {k, Infinity, 0}, Assumptions -> k \[Element] PositiveIntegers] // Normal which evaluates to the expected 1/Pi Commented Dec 10, 2023 at 18:09

No need to only consider Element[k,Integers]

Integrate[k Sin[(k + 1/2)*Pi*x]*(x^2 + 1), {x, 0, 1}]
Asymptotic[%, k -> Infinity]// Collect[#, k] &



$$\frac{2 \sin (\pi k)}{\pi }+\frac{-\frac{\sin (\pi k)}{\pi }+\frac{2 \cos(\pi k)}{\pi ^2}-\frac{1}{2 \pi}}{k}+\frac{1}{\pi }$$

• While this is the asymptotic behavior, it is not a limit. Taking the Limit of this result gives Indeterminate and taking the DiscreteLimit gives 1/Pi Commented Dec 10, 2023 at 18:27
• @BobHanlon For k->Infinity we get 1/Pi+2 Sin[Pi k]/Pi which is indead Indeterminate! Restriction Element[k,Integers] gives the correct result 1/Pi! Commented Dec 10, 2023 at 21:28
{"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 3, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "url": "https://mathematica.stackexchange.com/questions/293885/how-to-get-the-explicit-result-of-this-limit", "fetch_time": 1726163490000000000, "content_mime_type": "text/html", "warc_filename": "crawl-data/CC-MAIN-2024-38/segments/1725700651491.39/warc/CC-MAIN-20240912174615-20240912204615-00788.warc.gz", "warc_record_offset": 352309082, "warc_record_length": 42892, "token_count": 1143, "char_count": 3569, "score": 3.609375, "int_score": 4, "crawl": "CC-MAIN-2024-38", "snapshot_type": "latest", "language": "en", "language_score": 0.8314129710197449, "file_path": "/sailhome/yjruan/project/latent-lm/data/processed/finemath-4plus/finemath-4plus/train-00049-of-00064.parquet"}