0

Is there an easy way in mathematica to approximate $x$ such that $A = \int^{x}_0 f(x) dx$? (where $A$ and $f$ are given)

I am sorry if it is trivial.

Novo
  • 101
  • 1
  • 1
    https://mathematica.stackexchange.com/questions/121986/numerically-solving-an-equation-in-which-variable-is-the-upper-limit-of-an-integ or https://mathematica.stackexchange.com/questions/75782/i-know-the-lower-limit-of-an-integration-as-well-as-the-integral-how-to-find-th – Moo Jan 11 '22 at 13:27

1 Answers1

1

You can do the integration, then use Solve to solve for x

f[x_] := 1 + x + x^2;
A = 10;
int = Integrate[f[t], {t, 0, x}];
eq = A == int

Mathematica graphics

sol = Solve[eq, x]//N

Mathematica graphics

Check:

Integrate[f[t], {t, 0, x /. #}] & /@ sol // Chop

Mathematica graphics

Nasser
  • 143,286
  • 11
  • 154
  • 359
  • I was actually looking for the numerical way of doing this, adding an N to solve and integrate doesn't work. However, @Moo linked the answer above. – Novo Jan 11 '22 at 16:05