\subsection{Composite kernels}
We can construct kernels by combining existing kernels in valid ways. We will verify three kernels of these properties by computing the implied feature transformations.

For any valid kernels $K_1$ and $K_2$ with implied feature transformations $\Phi_1$ and $Phi_2$ and for nonnegative coefficients $c_1$, $c_2$, show that the following expressions are valid kernels:

\begin{enumerate}
    \item $K(x, x') = c_1 K_1(x, x') + c_2 K_2(x, x')$
    
    \begin{soln}
        We can show that $K$ is a valid kernel by finding a transformation $\Phi$ that recovers the linear combination of kernels $K_1$ and $K_2$ on the right hand side. 

        Recall that by definition, a kernel is some function $K_{\Phi}$ such that $K_{\Phi} (x, x') = \Phi (x)^\top \Phi(x')$ for all $x, x' \in \mathcal{X}$.
        
        We can decompose the linear combination into the inner products and then show that we can rewrite that expression as a new kernel-defining function $\Phi$:

        \begin{align*}
            c_1 K_1(x, x') + c_2 K_2(x, x') &= c_1 \Phi_1 (x) \Phi_1 (x') + c_2 \Phi_2 (x) \Phi_2 (x') \\
            &= [\sqrt{c_1} \Phi_1 (x), \sqrt{c_2} \Phi_2 (x) ] \cdot [\sqrt{c_1} \Phi_1 (x'), \sqrt{c_2} \Phi_2 (x') ]^\top \\
            &= \Phi(x) \Phi(x')
        \end{align*}
        where we have $\Phi(x) = [\sqrt{c_1} \Phi_1 (x), \sqrt{c_2} \Phi_2 (x) ]$. By finding a valid $\Phi$ that can replicate the kernel transformation, we have shown that $K$ is a valid kernel.
    \end{soln}  

    
    \item $K(x, x') = c_1 K_1(x, x') K_2(x, x')$

    \begin{soln}
        As before, we will write out the inner products of the right hand side:

        \begin{align*}
            c_1 K_1(x, x') K_2(x, x') &= c_1 \Phi_1(x) \Phi_1(x') \Phi_2(x) \Phi_2(x') \\
            &= (\sqrt{c_1} \Phi_1(x) \Phi_2(x) ) (\sqrt{c_2} \Phi_1(x') \Phi_2(x') ) \\
            &= \Phi(x) \Phi(x')
        \end{align*}
        where we have $\Phi(x) = \sqrt{c_1} \Phi_1(x) \Phi_2(x)$
    \end{soln}

    \item $K(x, x') = e^{K_1(x, x')}$

    \begin{soln}
        We begin by writing the Taylor expansion of the right hand side and then using the identities we proved above. Recall the Taylor expansion of the exponential function:
        \begin{align*}
            e^x = \sum_{n=1}^\infty \frac{x^n}{n!}
        \end{align*}

        \begin{align*}
            e^{K_1(x, x')} = 1 + K_1(x, x') + \frac{K_1(x, x')^2}{2} + \frac{K_1(x, x')^2}{2} + ... + \frac{K_1(x, x')^n}{n!} + ...
        \end{align*}

        Each term in the above summation is a kernel because it is a product of valid kernels (and constants), which we showed in example 2 above. Therefore, the entire summation is a kernel because a sum of valid kernels is a valid kernel, which we showed in example 1. 
    \end{soln}
\end{enumerate}