Re: How to find the eigenvalues/eigenfunctions of a

*To*: mathgroup at smc.vnet.net*Subject*: [mg113407] Re: How to find the eigenvalues/eigenfunctions of a*From*: Bob Hanlon <hanlonr at cox.net>*Date*: Wed, 27 Oct 2010 05:17:00 -0400 (EDT)

Clear[u] u[x_] = (u[x] /. DSolve[ {u''[x] - lambda u[x] == 0, u'[0] == 0}, u[x], x][[1]] // ExpToTrig // Simplify) /. C[2] -> 1 2*Cosh[Sqrt[lambda]*x] v = Solve[FullSimplify[ Reduce[{u[m] == 0, Element[m, Integers]}, lambda], {Element[m, Integers], m > 0, C[1] == 0}], lambda][[1]] // Quiet {lambda -> -(Pi^2/(4*m^2))} Simplify[u[x] /. v, m > 0] 2*Cos[(Pi*x)/(2*m)] Simplify[u''[x] - lambda*u[x] /. v, Element[m, Integers]] 0 Bob Hanlon ---- "Nasser M. Abbasi" <nma at 12000.org> wrote: ============= This is a simple math problem, which I solved by hand, but having hard time to get the same result I had by using Mathematica. I'll describe the problem, the solution I obtained by hand, what I did to try to verify my result. I'd like to be able to get Mathematica to produce the same result I have. Summary: I need to have mathematica find the eigenvalues and eigenfunctions of differential operator without me having to do too much manual manipulation. Problem -------- Given Lu==u''[x], with boundary conditions u'[0]==0,u'[1]==0, need to find the eigenvalues and eigenfunctions of L. my solution: ------------ The eigenvalues are lambda[n_]= -(n Pi)^2 for n=0,1,2,3,... infinity with corresponding eigenfunctions Phi[n_,x_]:=Cos[ n Pi x] for n=0,1,2,3,... infinity So, the first eigenvalues are In[14]:= lambda[n_]:=-(n Pi)^2 Table[lambda[i],{i,0,5}]//N Out[15]= {0.,-9.869604401089358,-39.47841760435743,-88.82643960980423,-157.91367041742973,-246.74011002723395} What I tried in Mathematica ---------------------------- Tried to solve u''[x] == lambda * u[x], i.e. eigenvalue problem with the BVP above, but I get zero solution DSolve[{ u''[x]- lambda u[x]==0,u'[0]==0,u'[1]==0},u[x],x] {{u[x]->0}} Now tried just one BC, I picked one of the above 2, but I also tried the other one later, no success, do not get what I had. Clear[u] First@DSolve[{ u''[x]- lambda u[x]==0,u'[0]==0},u[x],x]; ExpToTrig[%]//Simplify {u[x]->2 C[2] Cosh[Sqrt[lambda] x]} u=u[x]/.% 2 C[2] Cosh[Sqrt[lambda] x] % find root of the above eigenfunction FindRoot[(u/.{C[2]->1,x->1})==0,{lambda,1}] {lambda->-2.46740110027234} % try to guess what the form is Sqrt[-lambda/.%] 1.5707963267948968 % see what it is Pi/2. 1.5707963267948966 Ok, so Sqrt[-lambda] = pi/2, then the (first?) eigenvalue is -(pi/2)^2 The rest, keep looking for next roots of the eigenfunction from above? But I get eigenvalue to be -(n*pi)^2, not -(n* pi/2)^2 anyway. Might have made a mistake there at the end. The bottom line is this: Is there a package or command to make it easier to find the eigenvalues and eigenfunctions of a linear operator in mathematica, without having to hunt for them by hand? One has to use one B.C. to get something, and them hunt for roots, and guess the form. It seems this task can be automated by some command or package if not already done. thanks --Nasser