I an not too familiar with FindSequenceFunction.

Is there a trick to make Mathematica produce the obvious sequence function for this sequence?

Example 1

op={-y''[x],DirichletCondition[y[x]==0, True]};

Mathematica graphics

It is clear that the eigenfunctions are of the form $\sin\left( n \pi x\right)$ for $n=1,2,\dots$ and I thought that using FindSequenceFunction would be the way to show this, so I typed


But it gives

Mathematica graphics

It works well for things like:

Example 2


Mathematica graphics


Mathematica graphics

Question Is there a better function or way to change this to produce the desired result for example 1? I looked at options for FindSequenceFunction. Why did Matghematica do a good job for example 2 and not example 1?

ClearAll[y, x];
op = {-y''[x], DirichletCondition[y[x] == 0, True]};
eigf = Last@DEigensystem[op, y[x], {x, 0, 1}, 8]

(*  {Sin[π x], Sin[2 π x], Sin[3 π x], Sin[4 π x], Sin[5 π x],
  Sin[6 π x], Sin[7 π x], Sin[8 π x]}  *)

Use FullSimplify

sf = FindSequenceFunction[eigf, n] // FullSimplify

(*  1/2 I ((E^(-I π x))^n - (E^(I π x))^n)  *)

For integer values of n

sf // FullSimplify[#, Element[n, Integers]] &

(*  Sin[n π x]  *)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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