3
$\begingroup$

I have an integral

$\int_a^b \! f(x) \, \mathrm{d}x = c$

where I know c and either a or b. Now I want to compute either b or a (i.e., the missing limit). How would I do that in Mathematica/Wolfram Alpha?

2 Answers 2

4

$\tt{Solve[Integrate[f[x], \{x, a, b\}] == c]}$ seems to work.

Edit:
It has been pointed out by J.M. and monoid that the Solve function requires you to specify which variable you're searching for. In this case Mathematica understands which variable you want (assuming you have specified $c$ and either $a$ or $b$). In other cases it might be necessary to specify. For example $\tt{Solve[Integrate[f[x], \{x, a, b\}] == c,b]}.$ In any case there is no harm in specifying.

  • 0
    @J.M.: Yes, you're right. I edited my answer to clarify that. Thank you.2011-05-09
1

Eivind answer will only solve the integral to c, but if you want to solve it for a or b you must add it into the Solve expression:

For example:

g[x] := x^2 - x^3; c := 10; a := 3; Solve[Integrate[g[x], {x, a, b}] == c, b] 

Mathematica will answer:

{{b -> -(1/3) + 1/(3 Sqrt[2/(2 - (3 471^(2/3))/(-1 + 2 Sqrt[118])^(1/3) + 3 (471 (-1 + 2 Sqrt[118]))^(1/3))]) -  1/2 \[Sqrt](8/9 + (2 157^(2/3))/(3 (-1 + 2 Sqrt[118]))^(1/3) - (     2 (157 (-1 + 2 Sqrt[118]))^(1/3))/3^(2/3) -      8/9 Sqrt[2/(      2 - (3 471^(2/3))/(-1 + 2 Sqrt[118])^(1/3) +        3 (471 (-1 + 2 Sqrt[118]))^(1/3))])},... 

etc...

  • 0
    @Eivind: That could be the reason. I added the variable because reading the command gets more user-friendly.2011-05-13