Laplacian : laplacian

### 5.59.2 Laplacian : laplacian

laplacian takes one or two arguments.

- It can take an integer or floating-point integer n.
  laplacian(n) returns the n× n discrete Laplacian matrix; namely the n × n tridiagonal matrix with 2s on the main diagonal, −1s just above and below the main diagonal.
  Input :
  laplacian(3)
  Output :
  [[2,-1,0],[-1,2,-1],[0,-1,2]]
  Input :
  laplacian(2.0)
  Output :
  [[2.0,-1.0],[-1.0,2.0]]
- It can take an expression F of n real variables and a vector of these variable names.
  laplacian returns the Laplacian ofF, that is the sum of all second partial derivatives, for example in dimension n=3:

  ∇2(F)= |
  ∂2 F
  ∂ x2
  | + |
  ∂2 F
  ∂ y2
  | + |
  ∂2 F
  ∂ z2

  Example
  Find the Laplacian of F(x,y,z)=2x2y−xz3.
  Input :
  laplacian(2*x`^`2*y-x*z`^`3,[x,y,z])
  Output :
  4*y+-6*x*z