8
$\begingroup$

I'm playing around with Euler spirals, using a variable power to see how the plot changes,

$ \left\{\begin{matrix} x = \int_0^s \cos \left ( s^n \right ) ds \\ y = \int_0^s \sin \left ( s^n \right ) ds \end{matrix}\right. $

and finding the values for powers 2 or 3 work as expected in Mathematica:

Limit[ Integrate[Cos[s^2], {s, 0, x}], x -> ∞]
Limit[ Integrate[Sin[s^2], {s, 0, x}], x -> ∞]

$ \frac{\sqrt{\frac{\pi}{2}}}{2} \\ \frac{\sqrt{\frac{\pi}{2}}}{2} $

and similarly,

Limit[ Integrate[ Cos[s^3], {s, 0, x}], x -> ∞]
Limit[ Integrate[ Sin[s^3], {s, 0, x}], x -> ∞]

$ \frac{Gamma\left[\frac{1}{3} \right]}{2\sqrt{3}} \\ \frac{1}{6} Gamma \left [ \frac{1}{3} \right ] $

Plotting the spiral at different values (using a different general purpose graphics language) for $n$ suggests that there there should certainly be convergence values for both $x$ and $y$ for any value $1 \lt n \leq 3$ (and presumably above), but trying some of these leads to Mathematica giving most unhelpful answers:

$ Limit \left [ \int_0^s Cos \left [ s^{1.5} \right ]ds,s\rightarrow\infty \right ] \Rightarrow 0.451373 \\ Limit \left [ \int_0^s Sin \left [ s^{1.5} \right ]ds,s\rightarrow\infty \right ] \Rightarrow ComplexInfinity $

Which looks like the right $x$ coordinate, but a plain wrong $y$ coordinate, which quite clearly exists somewhere around 0.76ish:

enter image description here

Trying $n=2.5$ fails even harder, yielding "ComplexInfinity" for both coordinates, which is clearly incorrect (being somewhere near $(0.72,0.533)$):

enter image description here

Is there a way to make Mathematica generate these values anyway?

Or, is there a way to compute the general solution for symbolic power $n$ and getting a general formula for when $n\gt1$, using something like this (but then actually yielding a result):

$ Limit \left [ \int_0^s Cos \left [ s^n \right ]ds,s\rightarrow\infty \right ] \\ Limit \left [ \int_0^s Sin \left [ s^n \right ]ds,s\rightarrow\infty \right ] $

$\endgroup$
8
  • 4
    $\begingroup$ Limit doesn't like functions with inexact numbers. A very recent question was asked about this. Why don't you just integrate to infinity? Do this: Integrate[Cos[s^(3/2)], {s, 0, \[Infinity]}]. $\endgroup$
    – march
    Commented Jan 28, 2016 at 4:56
  • $\begingroup$ Because for whatever reason, that did not occur to me... Works a treat, thanks! A short answer, but if you want to turn that into a real answer I'll be happy to accept it. $\endgroup$ Commented Jan 28, 2016 at 4:59
  • $\begingroup$ @Artes those edits actually made the question reflect what I have in my notebook less, and makes it harder to read the output associated with the input. I write maths as much as possible, with nice looking functions. I don't use Integral[] or the like when I can avoid it. $\endgroup$ Commented Jan 28, 2016 at 18:45
  • 2
    $\begingroup$ @Mike'Pomax'Kamermans There is a general consensus on mathematica.stackexchange that whathever code one writes, it should be in a copyable form. As you may have seen the code written in latex cannot be easily copied. On the other hand in the Front End traditional notation is equivalent to the input form (with many restrictions though). So my intervention should be welcome, nevertheless you can edit your question to its initial form. However, I recommend to edit your question adding the code you have used to plot graphs. $\endgroup$
    – Artes
    Commented Jan 29, 2016 at 8:32
  • $\begingroup$ @Mike'Pomax'Kamermans Your graphs are slightly puzzling. I've made quite nice plots but I will be able to add them in a few days, because my version of Mathematica (10.1) involves some internal problems when exporting graphics. $\endgroup$
    – Artes
    Commented Jan 29, 2016 at 8:33

1 Answer 1

6
$\begingroup$

The problem occurs because of apparently complex form of the expression beyond the integral of Sin[s^k]. Nevertheless it is not too harmful to proceed. Adequate limits are real and we don't need playing to simplify complex expressions to explicitly real forms.

We can calculate the both integrals with appropriate assumptions:

f[x_, k_] = Integrate[{ Cos[s^k], Sin[s^k]}, {s, 0, x}, 
                      Assumptions -> {k > 1, x > 0}];

see it in TraditionalForm:

f[x, k] // TraditionalForm

and find appropriate limits with a needed assumption:

lim[k_] = Limit[ f[x, k], x -> Infinity, Assumptions -> k > 1]
{Cos[Pi/(2 k)] Gamma[1 + 1/k], Gamma[1 + 1/k] Sin[Pi/(2 k)]}

Now we can see that indeed limits are finite for k > 1. Here we write down a few exact values as expected:

Table[{k, lim[k]} // ComplexExpand // FullSimplify // ToRadicals, 
  {k, {5/4, 3/2, 2, 5/2, 3, 10/3}}] // TraditionalForm

enter image description here

We can plot adequate curves, e.g. using Quiet to avoid unneeded warnning related to apparently complex functions (involving I ), nevertheless if one uses f[x,k] it is not necessary.

With[{k = 5/2},
  ParametricPlot[f[x, k], {x, 0, 5}, PlotRange -> {{0.55, 1}, {0.3, 0.75}}, 
    PlotStyle -> {Black, Thickness[0.0015]}, AspectRatio -> Automatic, 
    PlotTheme -> "Detailed", Epilog -> {Red, PointSize[0.015], Point[lim[k]]}]]

enter image description here

and find slightly improved numerical limit:

lim[2.5]//Chop
{0.717812, 0.521521}
$\endgroup$
2
  • $\begingroup$ Why not just do Integrate[{Cos[s^k], Sin[s^k]}, {s, 0, ∞}, Assumptions -> k > 1]? $\endgroup$
    – Greg Hurst
    Commented Jun 28 at 18:21
  • 1
    $\begingroup$ E.g. an intermediate step might be finding function f[x, k] for drawnig a segment of spiral, right? $\endgroup$
    – Artes
    Commented Jun 28 at 22:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.