# Problem with interpolating function returned by NDEigensystem

I'm trying to evaluate interpolating function returned by NDEigensystem at a point but Mathematica won't evaluate it.

{vals, funs} = NDEigensystem[-Laplacian[u[x], {x}], u[x], {x, 0, \[Pi]}, 4];
f = funs[] (*3rd eigenfunction*)
Plot[f[x], {x, 0, Pi}] (*this plot returns blank plot*)
Plot[f, {x, 0, Pi}] (*this plot works fine*)
f


As you can see, f is not evaluated. Any help with the problem with the plot and function evaluation would be appreciated. Change u[x] to u

{vals, funs} =NDEigensystem[-Laplacian[u[x], {x}], u , {x, 0, \[Pi]}, 4]


now

Plot[funs[][x],{x,0,Pi}]


does what you are looking for.

To plot all the eigenfunctions try Plot[Through[funs[x]],{x,0,Pi}] • Thank you so much, this fixed my problem. – Omar Nagib Jul 15 '19 at 13:33
• You're welcome! – Ulrich Neumann Jul 15 '19 at 13:33
• On a related note, how can I define new functions using my interpolating function f (or manipulate interpolating functions in general)? For example in my above code, if I define ff=f+2 or ff=2*f, I'm not able to evaluate this function (e.g., ff does not evaluate). Or how can I define new function ff= Sin[x]*f for example? – Omar Nagib Jul 15 '19 at 13:50
• Try ff = FunctionInterpolation[2 funs[][x], {x, 0, Pi}] or fff = Function[{x}, funs[][x] + 2] – Ulrich Neumann Jul 15 '19 at 13:53
• There are no errors in both variants( of my comment). Perhaps the second variant is preferable. – Ulrich Neumann Jul 15 '19 at 14:09