Given the share price equation $$ dS_t=rS_tdt+\sigma S_tdW_t $$ working in the framework of Black-Scholes model, find the price at $t=0$ of the following two financial assets:
(a) The asset pays at $t=T$ exactly $S_T^2$.
(b) The asset pays at $t=T$ exactly $1$ if $S_T<K$, where $K$ is constant specified in the contract.
My attempt at solution.
(a) Since the solution of share price equation is given by $$ S_t=S_0\,\text{exp}\left[\left(r-\tfrac12\sigma^2\right)t+\sigma W_t\right] $$ we calculate using risk-neutral pricing \begin{align} C_0&=e^{-rT}\mathbb{E}_Q\left[C_T\right]\\ &=e^{-rT}\mathbb{E}_Q\left[S_T^2\right]\\ &=e^{(r-\sigma^2)T}S_0^2\,\mathbb{E}_Q\left[e^{2\sigma W_T}\right]\\ &=e^{(r-\sigma^2)T}S_0^2\,e^{2\sigma^2T} \\ &=e^{(r+\sigma^2)T}S_0^2\,\quad \text{(Answer)} \end{align}
(b) Denoting by $\Theta(x)=\begin{cases}1, x\ge 0\\ 0, x<0\end{cases}$ the unit step function we find \begin{align} C_0&=e^{-rT}\mathbb{E}_Q\left[C_T\right]\\ &=e^{-rT}\mathbb{E}_Q\left[\Theta(K-S_T)\right]\\ &=e^{-rT}\,\mathbb{Q}\left\{S_T<K\right\}\\ &=e^{-rT}\,\mathbb{Q}\left\{\frac{S_T}{S_0}<\frac{K}{S_0}\right\}. \end{align} Denote $a=r-\tfrac12\sigma^2$, $b=\sigma\sqrt{T}$, $x=\frac{K}{S_0}$. Then $S_T/S_0=X$, $X\sim N(a,b^2)$ and \begin{align} \mathbb{Q}\left\{e^X<x\right\}&=\mathbb{Q}\left\{X<\ln(x)\right\}\\ &=\mathbb{Q}\left\{\frac{X-a}{b}<\frac{\ln(x)-a}{b}\right\}\\ &=\Phi\left(-\frac{\ln(1/x)+a}{b}\right) \end{align} where $$ \Phi(x)=\frac{1}{\sqrt{2\pi}}\int_{-\infty}^xe^{-x^2/2}dx. $$ Thus $$ C_0=e^{-rT}\Phi\left(-\frac{\ln(S_0/K)+r-\tfrac12\sigma^2}{\sigma \sqrt{T}}\right)\quad \text{(Answer)} $$
Question: Is this solution correct?