Sturm-Liouville Boundary Value problem

Given the following boundary value problem
′′
X
+λX0,0<x<1
​​
X(0)0,
′
X
(1)+X(1)0
Easilywecanprovefor
λ>0
,theeigenvaluesoftheproblemsatisfytheequation
λ
-tan
λ
We are going to solve this problem with two ways

First way

We are going to find the first 10 approximate values and then to find numerically the first 10 eigenvalues
In[]:=
Clear["Global`*"]
In[]:=
f[x_]:=
x
In[]:=
h[x_]:=-Tan[
x
]
In[]:=
Plot[f[x],{x,0,1200},PlotRange->All,PlotLegends->"Expressions"]
Out[]=
200
400
600
800
1000
1200
5
10
15
20
25
30
35
In[]:=
Plot[h[x],{x,0,1200}]
Out[]=
200
400
600
800
1000
1200
-6
-4
-2
2
4
6
In[]:=
Show[Plot[{f[x],h[x]},{x,0,1200}]]
Out[]=
200
400
600
800
1000
1200
-40
-20
20
40
60
From the plot we find the first 10 approximate values
In[]:=
Coord3={{"4.255","2.388"},{"25.05","4.748"},{"62.215","8.183"},{"125.792","11.655"},{"201.369","14.94"},{"299.318","17.09"},{"418.459","20.308"},{"550","23.698"},{"715.291","26.938"},{"891.183","30.122"}}
Out[]=
{{4.255,2.388},{25.05,4.748},{62.215,8.183},{125.792,11.655},{201.369,14.94},{299.318,17.09},{418.459,20.308},{550,23.698},{715.291,26.938},{891.183,30.122}}
No we use the command FindRoot and the approximate values to find numerically the first 10 eigenvalues
In[]:=
x1=FindRoot[f[x]==h[x],{x,4.255}]
Out[]=
{x4.11586}
In[]:=
x2=FindRoot[f[x]==h[x],{x,25.05}]
Out[]=
{x24.1393}
In[]:=
x3=FindRoot[f[x]==h[x],{x,62.215}]
Out[]=
{x63.6591}
In[]:=
x4=FindRoot[f[x]==h[x],{x,125.792}]
Out[]=
{x122.889}
In[]:=
x5=FindRoot[f[x]==h[x],{x,201.369}]
Out[]=
{x201.851}
In[]:=
x6=FindRoot[f[x]==h[x],{x,299.318}]
Out[]=
{x300.55}
In[]:=
x7=FindRoot[f[x]==h[x],{x,418.459}]
Out[]=
{x418.987}
In[]:=
x8=FindRoot[f[x]==h[x],{x,550}]
Out[]=
{x300.55}
In[]:=
x9=FindRoot[f[x]==h[x],{x,715.291}]
Out[]=
{x715.077}
In[]:=
x10=FindRoot[f[x]==h[x],{x,891.183}]
Out[]=
{x892.73}
In[]:=
a={x1,x2,x3,x4,x5,x6,x7,x8,x9,x10}
Out[]=
{{x4.11586},{x24.1393},{x63.6591},{x122.889},{x201.851},{x300.55},{x418.987},{x300.55},{x715.077},{x892.73}}
We define the asymptotic estimation
In[]:=
λ[n_]=((2*n-1)^2*(Pi^2))/4
Out[]=
1
4
2
(-1+2n)
2
π
and we compare with the numerical results
In[]:=
TableForm[Table[{Evaluate[a[[n]]],N[λ[n]]},{n,1,10}],TableSpacing->{3,3},TableAlignments->Center,TableHeadings->{Table[n,{n,1,10}],{"Root","Asymptotic estimation"}}]
Out[]//TableForm=
Root
Asymptotic estimation
1
x4.11586
2.4674
2
x24.1393
22.2066
3
x63.6591
61.685
4
x122.889
120.903
5
x201.851
199.859
6
x300.55
298.556
7
x418.987
416.991
8
x300.55
555.165
9
x715.077
713.079
10
x892.73
890.732

Second way

Now we are going to solve the same problem with the command DEigenSystem and NDEigenSystem

Let' s start with DEigenSystem

In[]:=
Clear["Global`*"]
In[]:=
​​ℒ=-Laplacian[u[x],{x}]
Out[]=
-
′′
u
[x]
In[]:=
=DirichletCondition[u[x]==0,x==0];
In[]:=
newv=NeumannValue[u[x],x==1];
In[]:=
eigensys=DEigensystem[{ℒ+newv,},u[x],{x,0,1},10];
(*EigenValues*)
In[]:=
eigensys[[1]]
Out[]=

4.12
…
,
24.1
…
,
63.7
…
,
123.
…
,
202.
…
,
301.
…
,
419.
…
,
557.
…
,
715.
…
,
893.
…

(*EigenFunctions*)
In[]:=
eigensys[[2]]

Now we are going to use NDEigenSystem

We notice that we receive the same result as the first way of our solution