  In this paper we study both analytic and numerical solutions of option
pricing equations using systems of orthogonal polynomials. Using a
Galerkin-based method, we solve the parabolic partial diferential equation for
the Black-Scholes model using Hermite polynomials and for the Heston model
using Hermite and Laguerre polynomials. We compare obtained solutions to
existing semi-closed pricing formulas. Special attention is paid to the
solution of Heston model at the boundary with vanishing volatility.
