
Re: NDSolve with NIntegrate where Integral is a function of x
Posted:
Jul 20, 2012 3:56 AM


Hi dude, Your solution had a few problems I'm afraid. For example, in NDSolve you should always write y'[x]==... and not y'(x)=.. (note the == and the [] instead of = and () ). Also, the same applies for the initial condition y[x]=..
The following seems to work (with a few warnings).
f[x_]:=x^2 g[x_?NumberQ,t_?NumberQ]:=Sin[x*t] sol=NDSolve[{y'[x]==f[x]*NIntegrate[g[x,t],{t,0,1}],y[0]==0.04},y[x],{x,0,10}][[1]]; Plot[y[x]/.sol,{x,0,10}]
Cheers

