I would use =
instead of :=
, so that the integrals are evaluated symbolically once and for all, and a Chop
to get rid of small imaginary numerical noise:
Clear[m, ep, x];
ma[x_, m_, ep_] =
ep * 1/( Sqrt[2 Pi] )*Exp[-1/2 x^2] + (1 - ep)*
Integrate[
1/(m Sqrt[2 Pi] )* Cos[Pi th/(2 m)]^2 *
Exp[-1/2 (x - th)^2], {th, -m, m}];
mader[x_, m_, ep_] = (ma[x + 0.001, m, ep] - ma[x - 0.001, m, ep])/
0.002;
mao[x_, m_, ep_] =
ep*1/(Sqrt[2 Pi])*Exp[-1/2 x^2] + (1 - ep)*
Integrate[1/(2 m Sqrt[2 Pi])*Exp[-1/2 (x - th)^2], {th, -m, m}];
madero[x_, m_, ep_] = (mao[x + 0.001, m, ep] - mao[x - 0.001, m, ep])/
0.002;
With[{m = 20, ep = 0.8},
Plot[{x, Chop[x + madero[x, m, ep]/mao[x, m, ep]],
Chop[x + mader[x, m, ep]/ma[x, m, ep]]}, {x, -m - 5, m + 5},
PlotStyle -> {{GrayLevel[0]}, {Hue[5/8]}, {Hue[0]}},
AspectRatio -> Automatic]]