I'm writing this fairly simple function:
hermite[0, x] = 1;
hermite[1, x] = 2 x;
hermite[n_, x_] := (
hermite[n, x] = 2 x*hermite[n - 1, x] - 2 (n - 1) hermite[n - 2, x];
Expand[hermite[n, x]]
)
But the Expand
command is ignored.
Yet, when I do
Expand[hermite[10, x]]
The result is expanded like I wish.
Why is it not working when I put the same command inside a function? I'd like to do it in the function; it would be cleaner.
Comments
Post a Comment