  Exponential integrators that use Krylov approximations of matrix functions
have turned out to be efficient for the time-integration of certain ordinary
differential equations (ODEs). This holds in particular for linear homogeneous
ODEs, where the exponential integrator is equivalent to approximating the
product of the matrix exponential and a vector. In this paper, we consider
linear inhomogeneous ODEs, $y'(t)=Ay(t)+g(t)$, where the function $g(t)$ is
assumed to satisfy certain regularity conditions. We derive an algorithm for
this problem which is equivalent to approximating the product of the matrix
exponential and a vector using Arnoldi's method. The construction is based on
expressing the function $g(t)$ as a linear combination of given basis functions
$[\phi_i]_{i=0}^\infty$ with particular properties. The properties are such
that the inhomogeneous ODE can be restated as an infinite-dimensional linear
homogeneous ODE. Moreover, the linear homogeneous infinite-dimensional ODE has
properties that directly allow us to extend a Krylov method for
finite-dimensional linear ODEs. Although the construction is based on an
infinite-dimensional operator, the algorithm can be carried out with operations
involving matrices and vectors of finite size. This type of construction
resembles in many ways the infinite Arnoldi method for nonlinear eigenvalue
problems. We prove convergence of the algorithm under certain natural
conditions, and illustrate properties of the algorithm with examples stemming
from the discretization of partial differential equations.
