  We show that infinitely differentiable solutions to parabolic and hyperbolic
equations, whose right-hand sides are analytical in time, are also analytical
in time at each fixed point of the space. These solutions are given in the form
of the Taylor expansion with respect to time $t$ with coefficients depending on
$x$. The coefficients of the expansion are defined by recursion relations,
which are obtained from the condition of compatibility of order $k=\infty$. The
value of the solution on the boundary is defined by the right-hand side and
initial data, so that it is not prescribed. We show that exact regular and weak
solutions to the initial-boundary value problems for parabolic and hyperbolic
equations can be determined as the sum of a function that satisfies the
boundary conditions and the limit of the infinitely differentiable solutions
for smooth approximations of the data of the corresponding problem with zero
boundary conditions. These solutions are represented in the form of the Taylor
expansion with respect to $t$. The suggested me
