1
$\begingroup$

Suppose I have an equation $$ d=\int_A^B \dfrac{dr}{\sqrt{1-\dfrac{2M}{r}}}\\ =B\sqrt{1-\dfrac{2M}{B}}-A\sqrt{1-\dfrac{2M}{A}}+M\ln\left( B\sqrt{1-\dfrac{2M}{B}} +B-M\right)-M\ln\left( A\sqrt{1-\dfrac{2M}{A}} +A-M\right), $$ where $B>A>2M>0$.

I want to solve this equation for $B$ analytically. So far, I have tried

Solve[0.1==B*Sqrt[1-2/B]-3*Sqrt[1-2/3]+Log[B*Sqrt[1-2/B]+B-1]-Log[3*Sqrt[1-2/3]+3-1],B]

where $d=0.1, A=3, M=1$. However, Mathematica won't give a number.

Is there another way to solve this? Thanks.

$\endgroup$
1
  • 2
    $\begingroup$ Use FindRoot instead of Solve. $\endgroup$
    – LouisB
    Commented Jun 4, 2020 at 20:07

1 Answer 1

0
$\begingroup$

FindRoot works, but fun function.

inner[M_, xAB_] := Sqrt[1 - (2 M/xAB)];
expr[M_, A_, B_] := 
 B*inner[M, B] - A*inner[M, A] + M*Log[B*inner[M, B] + B - M] - 
  M*Log[A*inner[M, A] + A - M]
FindRoot[expr[M, A, B] == 
  d, {{M, 1.}, {A, 3.}, {B, 2, 2, 4}, {d, 0.1}}]

mine = FindRoot[expr[1., 3., B] == 0.1, {B, 2, 2, 4}]
(* Out: {B->3.05828} *)

original=FindRoot[0.1==B*Sqrt[1-2/B]-3*Sqrt[1-2/3]+Log[B*Sqrt[1-2/B]+B-1]-Log[3*Sqrt[1-2/3]+3-1],{B,2,2,4}]
(* Out: {B->3.05828} *)

In[10]:= mine==original
Out[10]= True

PS. Tried Plot[expr[1, 3, B] == 0.1, {B, 0, 10}] to see graph of B. Whew!

$\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.