4
$\begingroup$

I'd like to obtain an analytical form for the following definite integral, in which $f$ and $b$ are positive quantities.

Integrate[1/( Sqrt[f + b*x^2]), {x, 1, a}]

Mathematica is unable to provide an answer directly. Is there another way to obtain an analytical answer?

$\endgroup$

4 Answers 4

6
$\begingroup$

You can use Rubi

Get["Rubi`"]

Assuming[f > 0 && b > 0, Int[1/(Sqrt[f + b*x^2]), {x, 1, a}]]

rubi

Edit: Without Rubi and giving an extra assumption

FullSimplify@
 Assuming[f > 0 && b > 0 && a > 1, 
  Integrate[1/(Sqrt[f + b*x^2]), {x, 1, a}]]

res2

Edit 3: Noteworthy

FullSimplify@
   Assuming[f > 0 && b > 0, Int[1/(Sqrt[f + b*x^2]), {x, 1, a}]] // 
  TrigToExp // Simplify

rubiagain

$\endgroup$
2
  • $\begingroup$ Note to OP: In case you're unfamiliar with Rubi, it's an add-on package developed by Albert Rich. Installation instructions can be found here: rulebasedintegration.org $\endgroup$
    – theorist
    Commented Apr 13, 2022 at 6:21
  • $\begingroup$ @theorist many thanks. I have added the link to the answer $\endgroup$
    – bmf
    Commented Apr 13, 2022 at 14:16
5
$\begingroup$

Expanding the integrand into a series

coef[n_] = SeriesCoefficient[1/(Sqrt[f + b*x^2]), {x, 0, n}]

enter image description here

Verifying the series expansion,

1/Sqrt[f + b*x^2] == Sum[coef[n] x^n, {n, 0, Infinity, 2}] // 
 Simplify[#, f > 0] &

(* True *)

Exchanging the order of integration and summation, the integral is

int = Assuming[{a > 1, f > 0}, 
  Sum[Integrate[coef[n] x^n, {x, 1, a}], {n, 0, Infinity, 2}]]

(* (-ArcSinh[Sqrt[b/f]] + ArcSinh[a Sqrt[b/f]])/Sqrt[b] *)

The Rubi result provided by bmf is

int2 = -ArcTanh[Sqrt[b/(b + f)]]/Sqrt[b] + ArcTanh[a/Sqrt[a^2 + f/b]]/Sqrt[b];

Numerically, comparing the results

And @@ Table[int == int2 /. {
    a -> RandomReal[{11/10, 100}, WorkingPrecision -> 15],
    b -> RandomReal[{1/10, 100}, WorkingPrecision -> 15],
    f -> RandomReal[{1/10, 100}, WorkingPrecision -> 15]}, {10000}]

(* True *)
$\endgroup$
1
  • $\begingroup$ Very clever approach! $\endgroup$
    – bmf
    Commented Apr 12, 2022 at 22:02
4
$\begingroup$

Extending a trick I picked up from one of Daniel Lichtblau's answers, we can try substituting symbolic mathematical constants for the parameters f and b, and for the upper integration limit a, and then then back-substitute:

expr = (1/Sqrt[f + b*x^2]) /. {f -> Khinchin, b -> GoldenRatio};
int = Integrate[expr, {x, 1, Catalan}]
int1 = int /. {Khinchin -> f, GoldenRatio -> b, Catalan -> a}

enter image description here

enter image description here

Note that since these mathematical constants are all specific real-valued positive numbers, the answer may not be general. Nevertheless, in this case, it gives an answer identical to Bob Hanlon's, whose only restrictions were $a > 1, f > 0$.

$\endgroup$
2
  • 1
    $\begingroup$ Integrate[1/(Sqrt[f + b*x^2]), {x, 1, a}, GenerateConditions -> False] yields this result without tricks, while with assumptions in the questions Integrate[1/(Sqrt[f + b*x^2]), {x, 1, a}, Assumptions -> b > 0 && f > 0 && a \[Element] Reals] it returns that with condition a>1. $\endgroup$
    – Artes
    Commented Apr 13, 2022 at 6:57
  • $\begingroup$ @Artes Ah--I assumed the other posters had already tried those more basic approaches before giving their answers, but I should have checked those myself. $\endgroup$
    – theorist
    Commented Apr 13, 2022 at 17:01
2
$\begingroup$

The older version 8.0 for Microsoft Windows (32-bit) has no problems with that integral at all.

Let me show, how it works with different assumptions:

int1[a_, b_, f_] = 
 Integrate[1/(Sqrt[f + b*x^2]), {x, 1, a}, 
  Assumptions -> {f > 0, b > 0, a > 1}]

(*   Log[(a b + Sqrt[b (a^2 b + f)])/(b + Sqrt[b (b + f)])]/Sqrt[b]   *)

int2[a_, b_, f_] = 
 Integrate[1/(Sqrt[f + b*x^2]), {x, 1, a}, 
  Assumptions -> {f > 0, b > 0}]

(*   ConditionalExpression[(-ArcSinh[Sqrt[b/f]] + 
  ArcSinh[a Sqrt[b/f]])/Sqrt[b], a > 1]   *)

int1[a, b, f] == int2[a, b, f] // TrigToExp // 
 FullSimplify[#, Assumptions -> {f > 0, b > 0, a > 1}] &

(*   True   *)

int3[a_, b_, f_] = 
 Integrate[1/(Sqrt[f + b*x^2]), {x, 1, a}, 
  Assumptions -> {f > 0, b \[Element] Reals}]

(*   ConditionalExpression[-((
  I Log[(a + Sqrt[a^2 + f/b])/(1 + Sqrt[(b + f)/b])])/Sqrt[-b]), 
 b + f < 0 && a > 1]   *)

int4[a_, b_, f_] = 
 Integrate[1/(Sqrt[f + b*x^2]), {x, 1, a}, 
  Assumptions -> Element[{b, f}, Reals]]

(*   ConditionalExpression[-((
  I Log[(a + Sqrt[a^2 + f/b])/(1 + Sqrt[(b + f)/b])])/Sqrt[-b]), 
 f > 0 && b + f < 0 && a > 1]   *)

int5[a_, b_, f_] = 
 Integrate[1/(Sqrt[f + b*x^2]), {x, 1, a}, 
  Assumptions -> {Element[{b, f}, Reals], a < 1}]

(*   ConditionalExpression[-((
  I Log[(a + Sqrt[a^2 + f/b])/(1 + Sqrt[(b + f)/b])])/Sqrt[-b]), 
 f > 0 && a > 0 && a^2 b + f < 0]   *)

int6[a_, b_, f_] = 
 Integrate[1/(Sqrt[f + b*x^2]), {x, 1, a}, 
  Assumptions -> {Element[{b, f}, Reals], a < 0}]

(*   ConditionalExpression[(-ArcSinh[Sqrt[b/f]] + 
  ArcSinh[a Sqrt[b/f]])/Sqrt[b], (b >= 0 || a + Sqrt[-(f/b)] > 0) && 
  f > 0 && b + f > 0]   *)

nint[a_, b_, f_] := 
 NIntegrate[1/(Sqrt[f + b*x^2]), {x, 1, a}, MaxRecursion -> 50]

Comparison with numerical integration indicates, that int1 is valid for all parameter values. (Didn't check it intensivly)

tab = (Table[
       With[{a = RandomReal[{-3, 3}] // Rationalize[#, 10^-3] &, 
         b = RandomReal[{-3, 3}] // Rationalize[#, 10^-3] &, 
         f = RandomReal[{-3, 3}] // Rationalize[#, 10^-3] &}, {{a, b, 
          f}, nint[a, b, 
          f], {int1[a, b, f] // N}, {int2[a, b, f] // 
           N}, {int3[a, b, f] // N}, {int4[a, b, f] // 
           N}, {int5[a, b, f] // N}, {int6[a, b, f] // N}}], {10}] /. 
      Undefined -> {}) // Quiet // Chop // MatrixForm
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.