# Differential equation with integral of its parameters

I wanted to solve a differential equation involving a term with integration over its parameters. I want to call the integral expression but I get the wrong result:

 ysol4 = ParametricNDSolveValue[{D[y[t], t] == y[t]*x +
Integrate[y[t], {x, 0, 1}],
y[0] == 1}, Integrate[y[t], {x, 0, 1}], {t, 0, 30}, {x}];
Plot[Evaluate[ysol4[0.1]], {t, 0, 1}]


I know that the result is wrong since the plot is sensitive to x. It should not be since I called the expression that is an integral of x. Any help will be appreciated.

• It's because Integrate[y[t], {x, 0, 1}] is just y[t] - in other words, it's treating y[t] like a constant in the integral. Aug 24 '20 at 16:21

Generally speaking, we have here integrodifferential equation, so function $$y=y(x,t)$$, and we can consider equation and its solution as follows

ysol = NDSolveValue[{D[y[x, t], t] ==
y[x, t]*x + Integrate[y[x, t], {x, 0, 1}], y[x, 0] == 1},
y[x, t], {t, 0, 30}, {x, 0, 1}]


It looks like NDSolve can recognize and solve it (?), and we can visualize solution as

Plot3D[ysol, {t, 0, 1}, {x, .0, 1}, AxesLabel -> Automatic,
Mesh -> None, ColorFunction -> "Rainbow"]


• This seems to work. Thanks! Aug 25 '20 at 4:01
• @khvillegas You are welcome! Aug 25 '20 at 10:15

DSolve[{D[y[t], t] == y[t]*x +