h=1

g=Plot[{Tan[x],-x/h},{x,0,10},PlotRange->{-20,20}]

?Solve

?NSolve

?FindRoot

Solve[x^3-x^2-5 x+4==0,x]

NSolve[x^3-x^2-5 x+4==0,x]

xs=x/.NSolve[x^3-x^2-5 x+4==0,x]

xs[[1]]

Table[FindRoot[Tan[x]==-x/h,{x,(n-1/2+0.001) Pi}],{n,1,10}]

lambda=x/.Table[FindRoot[Tan[x]==-x/h,{x,(n-1/2+0.001) Pi}],{n,1,10}]

Clear[a]

a[n_]:=a[n]=Integrate[x Sin[lambda[[n]]x],{x,0,1}]/Integrate[Sin[lambda[[n]]x]^2,{x,0,1}]

Table[a[n],{n,10}]

?a

u[x_,t_]:=Sum[a[n] Exp[-(lambda[[n]])^2 t] Sin[lambda[[n]] x],{n,1,4}]

Plot[u[x,0.1],{x,0,1},PlotRange->{0,1}]

g=Plot[Table[Evaluate[u[x,t]],{t,0,0.5,0.1}],{x,0,1},PlotRange->{0,1}]

u[x_,t_]:=Sum[a[n] Exp[-(lambda[[n]])^2 t] Sin[lambda[[n]] x],{n,1,10}]

g=Plot[Table[Evaluate[u[x,t]],{t,0,0.5,0.1}],{x,0,1},PlotRange->{0,1}]