The expected return of an option is given by its expected payoff under $P$ over its market price under $Q$.
For the Black-Scholes model, expected call option return is given as (see here):
$$ E(R)=\frac{E^P[(S_T-K)^+]}{e^{-rT}E^Q[(S_T-K)^+]}=\frac{e^{\mu \tau}[S_tN(d_1^*)-e^{\mu \tau}KN(d_2^*)]}{C_t(r,T,\sigma,S,K)}-1 $$
$$\text{with }d_1^*=\frac{\ln S_t/K+(\mu+\frac{1}{2}\sigma^2)\tau}{\sigma\sqrt{\tau}},\qquad d_2^*=d_1^*-\sqrt{\tau}\sigma$$
I implemented the $P$-payoff in MATLAB as
E(R) = exp((mu-d)*T)*blsprice(S, K, mu, T, sigma,d)
and get correct values (comparing with other studies).
However, I also tried to calculate out the expectation integral numerically in MATLAB as follows:
E(R2) = integral(@(S_T)max(S_T-K,0).*normpdf(log(S_T),mu-d-sigma^2/2,sigma),0,inf)
(with some arbitrary parameters) and I get a different value.
Can someone explain whether there is error in my code for E(R2), or is MATLAB integration just not accurate enough?
E.g. try with
S=1,T=1,K=1,r=0.01,mu=0.1,sigma=0.05,d=0.02