# 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