Skip to main content
added 127 characters in body
Source Link
Michael E2
  • 244.8k
  • 18
  • 351
  • 774

NDSolve will compute a numeric antiderivative.

Example:

ClearAll[f];
f[t_] := Re@Zeta[1/2 + Sqrt[t] I];

Plot[f[t], {t, 1, 1000}]

enter image description here

The antiderivative:

ListLinePlot@NDSolveValue[{y'[t] == f[t], y[1] == 0}, y, {t, 1, 1000}]

enter image description here

Here's the definite integral int[x, y]:

ClearAll[int];
With[{F = NDSolveValue[{y'[t] == f[t], y[1] == 0}, y, {t, 1, 1000}]},
  int[x_, y_] := Subtract @@ F[{y, x}]
  ];

Plot3D[int[x, y], {x, 1, 1000}, {y, 1, 1000}]

enter image description here

For greater accuracy, use

NDSolveValue[{y'[t] == f[t], y[1] == 0}, y, {t, 1, 1000}, InterpolatingOrder -> All]

NDSolve will compute a numeric antiderivative.

Example:

ClearAll[f];
f[t_] := Re@Zeta[1/2 + Sqrt[t] I];

Plot[f[t], {t, 1, 1000}]

enter image description here

The antiderivative:

ListLinePlot@NDSolveValue[{y'[t] == f[t], y[1] == 0}, y, {t, 1, 1000}]

enter image description here

Here's the definite integral int[x, y]:

ClearAll[int];
With[{F = NDSolveValue[{y'[t] == f[t], y[1] == 0}, y, {t, 1, 1000}]},
  int[x_, y_] := Subtract @@ F[{y, x}]
  ];

Plot3D[int[x, y], {x, 1, 1000}, {y, 1, 1000}]

enter image description here

NDSolve will compute a numeric antiderivative.

Example:

ClearAll[f];
f[t_] := Re@Zeta[1/2 + Sqrt[t] I];

Plot[f[t], {t, 1, 1000}]

enter image description here

The antiderivative:

ListLinePlot@NDSolveValue[{y'[t] == f[t], y[1] == 0}, y, {t, 1, 1000}]

enter image description here

Here's the definite integral int[x, y]:

ClearAll[int];
With[{F = NDSolveValue[{y'[t] == f[t], y[1] == 0}, y, {t, 1, 1000}]},
  int[x_, y_] := Subtract @@ F[{y, x}]
  ];

Plot3D[int[x, y], {x, 1, 1000}, {y, 1, 1000}]

enter image description here

For greater accuracy, use

NDSolveValue[{y'[t] == f[t], y[1] == 0}, y, {t, 1, 1000}, InterpolatingOrder -> All]
Source Link
Michael E2
  • 244.8k
  • 18
  • 351
  • 774

NDSolve will compute a numeric antiderivative.

Example:

ClearAll[f];
f[t_] := Re@Zeta[1/2 + Sqrt[t] I];

Plot[f[t], {t, 1, 1000}]

enter image description here

The antiderivative:

ListLinePlot@NDSolveValue[{y'[t] == f[t], y[1] == 0}, y, {t, 1, 1000}]

enter image description here

Here's the definite integral int[x, y]:

ClearAll[int];
With[{F = NDSolveValue[{y'[t] == f[t], y[1] == 0}, y, {t, 1, 1000}]},
  int[x_, y_] := Subtract @@ F[{y, x}]
  ];

Plot3D[int[x, y], {x, 1, 1000}, {y, 1, 1000}]

enter image description here