Solution (source code)

= Solution

For an <even function>, the interior sine term must vanish, because <sine> is odd and <cosine> is even. Comparing reflected exterior tails at any $x>a$ gives $De^{-kx}=Ae^{-kx}$. Hence the <parity> condition alone is
$$
\boxed{C=0,\qquad A=D.}
$$
It does not yet impose the matching condition on $B$. Continuity at $x=a$, when imposed in the next part, additionally gives $A=D=Be^{ka}\cos(\kappa a)$.