MATLAB: Solve integral for x with x as bound and part of the integrand

integral boundintegrationsolve equation

Good day,
i am trying to solve the function as attached in the picture for x. The issue is that x is the bound of the integral as well as part of the integrand. Possibly further complicated by the probability distributions in the integral.
I tried the following but got a "Empty sym: 0-by-1" error:
syms x t
eqn = 0 == a + b*normcdf(x,mu,sig)+c*int( normcdf(d+ x - t,mu,sig)*normpdf(t,mu,sig),t,0, x);
A = vpasolve(eqn,x)
Any help would be much appreciated! Thank you

Best Answer

a=0.2;
b=10;
c=-10;
d=15;
mu=3;
sig=1;
Pdf=@(x)1/(sig*sqrt(2*pi))*exp(-(x-mu).^2/(2*sig^2));
Cdf=@(x)integral(@(y)Pdf(y),-Inf,x);
Fun=@(x)a+b*Cdf(x)+c*integral(@(t)Cdf(d+x-t).*Pdf(t),0,x,'ArrayValued',true);
x0=100;
sol=fzero(Fun,[150 170])
Fun(sol)
Note that your function seems to have multiple zeros.
I suggest you plot "Fun" in the range [0:300] for x.
Best wishes
Torsten.