  In this paper, we investigate the Cauchy problem for both linear and
semi-linear elliptic equations. In general, the equations have the form
  \[ \frac{\partial^{2}}{\partial
t^{2}}u\left(t\right)=\mathcal{A}u\left(t\right)+f\left(t,u\left(t\right)\right),\quad
t\in\left[0,T\right], \]
  where $\mathcal{A}$ is a positive-definite, self-adjoint operator with
compact inverse. As we know, these problems are well-known to be ill-posed. On
account of the orthonormal eigenbasis and the corresponding eigenvalues related
to the operator, the method of separation of variables is used to show the
solution in series representation. Thereby, we propose a modified method and
show error estimations in many accepted cases. For illustration, two numerical
examples, a modified Helmholtz equation and an elliptic sine-Gordon equation,
are constructed to demonstrate the feasibility and efficiency of the proposed
method.
