We study an associative algebra
$A$
over an arbitrary field that is a sum of two subalgebras
$B$
and
$C$
(i.e.,
$A\,=\,B+C$
). We show that if
$B$
is a right or left Artinian
$PI$
algebra and
$C$
is a
$PI$
algebra, then
$A$
is a
$PI$
algebra. Additionally, we generalize this result for semiprime algebras
$A$
. Consider the class of all semisimple finite dimensional algebras
$A\,=\,B+C$
for some subalgebras
$B$
and
$C$
that satisfy given polynomial identities
$f\,=\,0$
and
$g\,=\,0$
, respectively. We prove that all algebras in this class satisfy a common polynomial identity.